saas-architecture-deep-dive

Dominio de arquitectura SaaS para Senior Full-Stack Developer. Usar cuando el usuario necesite explicar arquitectura SaaS, multi-tenancy, disenar sistemas escalables, evaluar trade-offs arquitectonicos, o preparar respuestas sobre diseño de sistemas. Activa con palabras como SaaS, multi-tenant, arquitectura, escalabilidad, tenant isolation, subscription, billing, feature flags, scaling. Especializado en plataformas como HostelOS y Digitaliza.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "saas-architecture-deep-dive" with this command: npx skills add founderjourney/claude-skills/founderjourney-claude-skills-saas-architecture-deep-dive

SaaS Architecture Deep Dive

Sistema para dominar arquitectura SaaS y comunicarla con autoridad senior.

Workflow Principal

1. Identificar necesidad

Usuario dice...Accion
"Explicar multi-tenancy"Ver multi-tenancy-patterns.md
"Disenar sistema SaaS"Ir a Decision Framework (abajo)
"Integrar pagos/billing"Ver billing-integration.md
"Escalar mi sistema"Ver scaling-strategies.md
"Explicar mi arquitectura"Ver your-architecture-answers.md

2. Decision Framework: Disenar SaaS

Paso 1: Requirements

Preguntas clave:
- Cuantos tenants esperamos? (10, 100, 10000?)
- Que tan sensibles son los datos? (compliance requirements?)
- Tenants similares o muy diferentes en uso?
- Budget de infraestructura?

Paso 2: Elegir modelo de tenancy

POCOS TENANTS + DATOS SENSIBLES + ALTO BUDGET
→ SILO (database per tenant)

MUCHOS TENANTS + DATOS NO SENSIBLES + BAJO BUDGET
→ POOL (shared database, tenant_id)

BALANCE
→ BRIDGE (schema per tenant)

Paso 3: Definir isolation boundaries

- Data isolation: como separar datos por tenant
- Compute isolation: recursos compartidos o dedicados
- Network isolation: VPCs, subnets separados?

Paso 4: Billing model

- Flat rate: simple, predecible
- Usage-based: justo, complejo de trackear
- Tiered: balance, feature gates
- Hybrid: base + overage

3. Patrones Core SaaS

Multi-Tenancy (resumen)

ModeloIsolationCostoComplejidadCuando usar
SiloAltoAltoMedioHealthcare, Finance
PoolBajoBajoBajoSaaS general
BridgeMedioMedioAltoEnterprise SaaS

Ver multi-tenancy-patterns.md para detalles.

Tenant Context

// Middleware pattern
const tenantMiddleware = (req, res, next) => {
  const tenantId = req.headers['x-tenant-id'] || extractFromJWT(req);
  if (!tenantId) return res.status(401).json({ error: 'Tenant required' });
  req.tenant = tenantId;
  next();
};

// Query builder injection
const withTenant = (query, tenantId) => {
  return query.where('tenant_id', tenantId);
};

Feature Flags

// Feature flag pattern por plan
const features = {
  free: ['basic_reports'],
  pro: ['basic_reports', 'advanced_reports', 'api_access'],
  enterprise: ['basic_reports', 'advanced_reports', 'api_access', 'sso', 'audit_logs']
};

const hasFeature = (tenant, feature) => {
  return features[tenant.plan]?.includes(feature) ?? false;
};

4. Trade-offs Comunes

Monolito vs Microservicios

Monolito cuando:
- Equipo pequeno (<5 devs)
- Dominio no claramente separable
- Time-to-market prioritario

Microservicios cuando:
- Equipos independientes por servicio
- Scaling muy diferente por componente
- Diferentes stacks por servicio tienen sentido

SQL vs NoSQL para SaaS

SQL (PostgreSQL) cuando:
- Datos relacionales (users, orders, subscriptions)
- Transacciones importantes (pagos)
- Queries complejas con JOINs

NoSQL (MongoDB) cuando:
- Schemas muy variables por tenant
- Write-heavy workloads
- Document-centric data

Sync vs Async processing

Sync cuando:
- Usuario espera resultado inmediato
- Operacion rapida (<500ms)
- Feedback importante para UX

Async cuando:
- Operaciones largas (emails, reports)
- Puede fallar y necesita retry
- No bloquea al usuario

5. Checklist de Arquitectura SaaS

DATA LAYER
[ ] Tenant isolation implementado
[ ] Backup strategy por tenant o global
[ ] Data retention policies definidas
[ ] Audit logging para compliance

APPLICATION LAYER
[ ] Tenant context en cada request
[ ] Feature flags por plan
[ ] Rate limiting por tenant
[ ] Error handling con tenant context

INFRASTRUCTURE
[ ] Scaling strategy definida
[ ] Monitoring por tenant
[ ] Cost allocation posible
[ ] Disaster recovery plan

BILLING
[ ] Subscription lifecycle manejado
[ ] Usage tracking si aplica
[ ] Webhook handlers para Stripe events
[ ] Dunning flow para pagos fallidos

Referencias

ArchivoContenidoCuando usar
multi-tenancy-patterns.mdPool, Silo, Bridge en detalleDisenar multi-tenancy
billing-integration.mdStripe subscriptions, webhooksIntegrar billing
scaling-strategies.mdHorizontal, vertical, shardingEscalar sistema
your-architecture-answers.mdHostelOS, Digitaliza explicadosDefender tu experiencia

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

claude-code-guide

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-review-senior-perspective

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

yc-sv-development-framework

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

devops-pathfinders

No summary provided by upstream source.

Repository SourceNeeds Review