Modular Monolith concept page: one deploy unit with hard internal module boundaries (catalog/orders/payments), own DB schemas per module, in-process event bus, dependency-cruiser as fitness function, Strangler Fig extraction to microservice when operationally justified.
Modular monolith — один deployable/runtime boundary с внутренними modules, которые имеют явные APIs, ownership и dependency rules. Он может упростить deployment и local transactions, но не гарантирует 100K RPS, error isolation или лёгкое будущее разделение. Modularity надо проверять кодом и данными, иначе monolith остаётся tightly coupled.
| Компонент | Ответственность |
|---|---|
| Single Deployment Entrypoint | Маршрутизирует requests к public module APIs в одном process. |
| Orders Module | Владеет Orders API, model, schema и transaction rules. |
| Billing Module | Владеет Billing API, model и idempotent operations. |
| Catalog Module | Предоставляет read API без table-level shortcuts. |
| Logically Partitioned Database | Один engine допустим, но tables/schema ownership разделены. |
| Module Transactional Outbox | Коммитит durable integration intent вместе с module state. |
| Outbox Relay | Повторяет event delivery и изолирует handler failure от producer commit. |
| Candidate Extracted Service | Shadow/consume path с idempotency и explicit ownership epoch. |
| Architecture Boundary Tests | Запрещает invalid imports и cross-module table access. |
The entrypoint invokes Orders. Orders reads Catalog and asks Billing only through declared APIs; no module imports another module’s internals or tables.
Проверяемый исход: A boundary test can identify every allowed dependency and owner.
A local operation can use one DB transaction only when ownership and coupling are intentionally accepted. Cross-module invariants require an explicit owner/API rather than ad hoc multi-table writes.
Проверяемый исход: Transaction convenience does not erase module ownership or create a distributed guarantee after extraction.
Orders commits an outbox row. Relay retries after crashes; a failing downstream handler cannot roll back the already committed order and must deduplicate.
Проверяемый исход: In-process location is not confused with durable delivery or error isolation.
Backfill and shadow reads validate candidate state. Old and new paths use stable operation IDs; a fenced routing epoch selects one authoritative writer before contract removal.
Проверяемый исход: There is no unfenced dual-writer interval and rollback remains compatible.
Числа здесь — размерностные формулы или явно помеченные учебные inputs. Паттерн архитектуры сам по себе не задаёт SLA, throughput, latency или fault tolerance.
[CONCEPT]evolutionary-architecture
The lesson models one safe modular-monolith operating approach. It does not claim a monolith is always preferable, automatically modular, fault-isolated, horizontally scalable or trivially extractable.
Введите числа или выберите пресет