Files
Messenger/docs/adr/0001-monolith.md
T

22 lines
871 B
Markdown
Raw Normal View History

# ADR 0001: Monolith over microservices
- Status: accepted
- Date: 2026-09
## Context
The messenger serves a single family (tens of users) on a home-lab mini PC
with ~8 GB RAM. A microservice split would add operational overhead
(networking, service discovery, per-service containers) with zero benefit at
this scale.
## Decision
Build a single Go process exposing REST, WebSocket, media serving and static
files, with PostgreSQL as the only external state. Internal packages
(`store`, `auth`, `realtime`, `api`, `media`) are cleanly separated with
explicit interfaces, so extraction later is mechanical.
## Consequences
- One container, trivial `docker compose up`.
- In-process WebSocket hub gives O(1) presence checks for push decisions.
- If the service ever needs horizontal scaling, `realtime` and `store`
already hide their implementations behind interfaces.