Topologia de cloud
Visão de produção (DOKS)
Seção intitulada “Visão de produção (DOKS)”flowchart TB
subgraph EDGE[Edge & DNS]
CF[Cloudflare DNS + WAF]
CDN[Static assets CDN]
end
subgraph DOKS[DigitalOcean Kubernetes Cluster]
ING[Ingress NGINX]
subgraph APPS[Apps]
FRONT[solutio-front<br/>Next 16]
API[solutio-api<br/>Rails]
LISTENER[alarm-listener]
VOICE[voice-agent]
DOCS[solutio-docs<br/>Fumadocs]
ATLAS[solutio-atlas<br/>Astro]
end
subgraph DATA[Data layer]
PG[(PostgreSQL<br/>+ TimescaleDB)]
REDIS[(Redis)]
end
subgraph MEDIA[Media layer]
LK[LiveKit cluster]
G2[go2rtc]
MTX[MediaMTX]
end
subgraph AI[AI layer]
VECTOR[Vector DB externo<br/>Qdrant/Pinecone]
end
end
CF --> ING
ING --> FRONT
ING --> API
ING --> DOCS
ING --> ATLAS
LISTENER --> API
VOICE --> API
API --> PG
API --> REDIS
API --> VECTOR
LISTENER --> PG
FRONT --> LK
LK --> G2
G2 --> MTX
classDef edge fill:#92ccdf,stroke:#0e2a3a,color:#0e2a3a
classDef app fill:#00a9c9,stroke:#2b5383,color:#fff
classDef data fill:#2b5383,stroke:#0e2a3a,color:#fff
classDef media fill:#f4a261,stroke:#9a5d2c,color:#fff
classDef ai fill:#76c0d5,stroke:#0e2a3a,color:#0e2a3a
class CF,CDN edge
class FRONT,API,LISTENER,VOICE,DOCS,ATLAS,ING app
class PG,REDIS data
class LK,G2,MTX media
class VECTOR ai
Decisões macro
Seção intitulada “Decisões macro”| Decisão | Escolha | Alternativa rejeitada |
|---|---|---|
| Orquestrador | DOKS (DO Kubernetes) | App Platform (limitado), AWS (custo BR) |
| DB principal | PostgreSQL 16 + TimescaleDB | pgvector (separação de concerns), MongoDB |
| Mídia ao vivo | LiveKit self-hosted | Twilio (custo), Agora |
| Bridge câmera | go2rtc + MediaMTX | Janus, Kurento (descontinuados) |
| Vector DB | Externo (Qdrant ou Pinecone) | pgvector no main DB |
| Backend | Rails canonical | Modular Rails, Hanami, NestJS |
| Front | Next 16 (App Router) | Remix, Astro (apenas para docs) |
| Mobile | Expo SDK 54 | Flutter (Sowil), React Native bare |
Multi-tenancy
Seção intitulada “Multi-tenancy”flowchart TB
subgraph DEFAULT[Default — multi-tenant pod]
DB1[(PostgreSQL único)]
APP1[solutio-api]
APP1 -->|acts_as_tenant| DB1
DB1 --> ORG1[Org A]
DB1 --> ORG2[Org B]
DB1 --> ORG3[Org C]
end
subgraph ENT[Enterprise — pod isolado opcional]
DB2[(PostgreSQL dedicado)]
APP2[solutio-api dedicado]
APP2 -->|acts_as_tenant| DB2
DB2 --> ORGE[Org Enterprise]
end
classDef def fill:#00a9c9,stroke:#2b5383,color:#fff
classDef ent fill:#2b5383,stroke:#0e2a3a,color:#fff
class DEFAULT,DB1,APP1,ORG1,ORG2,ORG3 def
class ENT,DB2,APP2,ORGE ent
Default é pod multi-tenant. Enterprise tier (preço diferenciado) oferece pod dedicado por exigência de isolamento físico.
Custo aproximado (baseline, multi-tenant pod)
Seção intitulada “Custo aproximado (baseline, multi-tenant pod)”| Item | Mensal (USD) | Notas |
|---|---|---|
| DOKS 3 nodes (POC) | $144 | Subscrita; escala por demanda |
| PostgreSQL droplet | $48 | Self-host TimescaleDB |
| LiveKit cluster | $96 | 3 nodes pequenos |
| Vector DB externo | $50 | Plano starter |
| Object storage | $20 | Spaces |
| Total baseline | ~$360 | Antes de tráfego e replicas |
Detalhe de custo e plano de escala vivem em docs/architecture/cloud-deployment-plan.md.