Startups make tradeoffs. Speed wins, and technical debt is often the cost of moving fast. That decision is not wrong, but the problem shows up later.
At Manatal, we are still in a growth phase, but our Django monolith is slowing us down. Not because it is failing, but because changes feel risky, engineers need too much context, and small updates can trigger unexpected side effects.
The Monolith Problem We Hit
Our Django application grew to handle multiple domains and responsibilities:
core business logic
data access and persistence
background processing
external integrations
event handling
This included candidate management, calendar synchronization, and workflow orchestration, all running in the same execution context.
Over time, models accumulated too many responsibilities. They represented business concepts, handled persistence, triggered side effects, and published events. A single change often required touching the same files repeatedly, increasing coupling and review overhead.
This worked early on. At scale, it became fundamentally limiting.
Hidden Control Flow in Django
One of the hardest things to reason about in large Django codebases is hidden control flow.
When a model is saved, Django immediately executes any registered signal handlers in the same process, often triggering additional logic that is not visible at the call site.
As more signals were added, behavior became difficult to predict:
bulk operations bypass signals
state transitions lose per row context
ordering is implicit
failures are hard to reason about
Signals are easy to add in Django, but they encourage hidden behavior and weak composition at scale. We are not rewriting existing code, but we no longer introduce new signals going forward.
Our High-Level Goal
We did not want a rewrite. We wanted safer change, clearer ownership, and a path forward.
To reduce risk, improve clarity, and prepare the system for future scale, we focused on two changes that reinforce each other:
Introduce a service and repository layer to improve separation of concerns and give us central, managed, and testable control over business logic and data access.
Replace signals with a controlled event system, allowing us to react to changes asynchronously, either within the same application or across services.
Step 1: Controlling ORM Access With Repositories
Repositories act as a boundary around the Django ORM.
Instead of scattering query logic across views, services, signals, and models, repositories give us a single place to manage reads and writes. This makes queries easier to reason about, test, and optimize without leaking persistence details into the rest of the system.
Step 2: Introducing a Service Layer
The service layer exists to make changes explicit and controlled.
Instead of allowing writes to happen anywhere in the codebase, services define how and why data changes. They also centralize business logic that would otherwise be spread across models, signals, and utility functions.
This becomes especially important for complex business rules involving multiple models. By coordinating service logic, we avoid tight cross-entity references and keep domain behavior in one place, rather than duplicating it across the system.
Instead of calling model.save() or QuerySet.update() directly from many places, writes are orchestrated through services. This allows us to:
make state transitions explicit
centralize and maintain complex business logic
control side effects
improve testability
prepare for asynchronous processing
The service layer is intentionally thin. It does not replace Django. It constrains how Django is used.
Moving From Signals to Events
Instead of relying on Django signals, we introduced a generic internal event system.
Model changes are published as events to a RabbitMQ exchange using a shared contract. These events are not tied to Django internals and can be consumed by any application that understands the contract.
This allows us to react to changes:
inside the same application as background tasks
in isolated workers
in other services, without exposing APIs or databases
Because events are generic and decoupled, we can gradually move isolated parts of the monolith into separate domains and services, without forcing a big rewrite.
We initially consumed these events within the same application to validate scalability. Today, they are designed to support multiple consumers across services with minimal coupling.
Scaling Benefits
Internal events also give us more control over how we scale.
Different workloads have different resource profiles. Some are CPU-heavy, others are IO-bound. By processing events asynchronously, we can run smaller, specialized workers for specific workloads instead of scaling the entire monolith.
This also comes with cost benefits. We can scale consumers independently, disable certain functionality via startup configuration, or shift workloads out of the monolith entirely as domains mature.
Where This Leaves Us
We are making steady progress, slimming down the monolith in safe, incremental steps.
This approach may not align perfectly with classic Django conventions, but it gives us control. It creates a clear path toward faster APIs, independently scalable workloads, and future services without forcing a rewrite or destabilizing the system.
The monolith still exists. It is just becoming easier to understand, safer to change, and ready for what comes next.
About this work
This post was written by Kevin Bronsdijk, Director of Engineering.
The high-level service architecture and design direction were initiated by Mickael Ohlen, Head of Engineering.
The event exchange design and execution were led by Anton Savchuk, Lead Software Engineer.




