Why Drumee Is a Modular Monolith: One Go Binary, Many Modules
A modular monolith is one deployable program split into self-contained modules with explicit boundaries. Drumee is built this way: a single Go binary runs as an API server, a background worker or a migration job, and each domain (files, chat, task...

Drumee's modular monolith: one Go binary runs as API server, background worker or migration job, with files, chat and tasks as separate modules inside it
A modular monolith is one deployable program split into self-contained modules with explicit boundaries. Drumee is built this way: a single Go binary runs as an API server, a background worker or a migration job, and each domain (files, chat, tasks and the rest) is a module with the same handler, service and repository layers.
This post explains how that architecture works on the hosted service at app.drumee.com, why it was preferred over a fleet of microservices, and what it costs. The facts come from the Technology Overview, the Request Pipeline and The Drumee Stack docs.
The short answer
Drumee is one Go binary with three modes: server (REST API, WebSocket hub and web app), worker (previews, imports, notifications, scheduled clean-up) and migrate. Domains are modules built, tested and deployed together. Servers keep no state of their own, so several servers and workers run side by side on MongoDB, S3-compatible storage and Redis.
In the docs' own words, "there is no fleet of services to version against each other." The rest of this post is about what that buys and how the platform still scales out.

One binary, two runtime roles, three shared stores.
One binary, three modes
drumee binary (Go)
├── server REST API (/api/v1), WebSocket hub (/ws), the web application
├── worker previews and video renditions, imports, notifications,
│ scheduled clean-up
└── migrate one-shot migration job
The server handles requests; the worker does everything that should not make a request wait. Both are the same program, so there is no separate worker codebase to keep in step with the API.
Inside the binary, each domain is a self-contained package with explicit boundaries. Modules are built, tested and deployed together. That is the "modular" half: the boundaries exist in the code, not in the network.
Why not microservices?
Microservices solve real problems: independent deploys for independent teams, and per-service scaling. They also add network calls where function calls used to be, version skew between services, distributed failure modes and an authorization story that has to be repeated at every hop. Martin Fowler's MonolithFirst essay makes the general case for starting with a well-structured monolith.
For a collaboration product, the cross-domain path is the common one. Sending a chat message about a file, turning it into a task and notifying the assignee touches three domains in one user action. In Drumee that path stays inside one process, under one permission model.

One deployable unit with module boundaries, versus many deployable units with network boundaries.
The trade-offs are honest ones:
- Boundaries need discipline. Nothing physical stops one module reaching into another, so the shared layering and explicit interfaces carry that weight.
- Everything ships together. A change to one module means a new build of the binary. In exchange, there is never a compatibility matrix between services.
- Scaling is by role, not by module. You add servers or workers, not "more chat". Separate job queues soften this: video transcoding has its own queue so it never delays thumbnails.
Inside a module: handler, service, repository
Every domain package has the same three layers:
- Handler: decodes the request, calls the service, encodes the response. Knows about HTTP.
- Service: checks permissions, applies business rules, publishes events. Knows about the domain.
- Repository: runs queries. Knows about the database, and always about the tenant.
Inputs are validated before the service runs: JSON bodies are size-limited, unknown fields are rejected, and declared constraints are checked.
The key design choice is where authorization lives. Authentication happens in middleware; authorization happens in the service, next to the code that performs the action. The service resolves the caller's role in the workspace that owns the resource, and the tenant with it. The request never names its tenant. The data protection and tenant isolation post shows why that matters.
Stateless servers and how they scale out
No server keeps files on disk or sessions in memory. Durable state lives in MongoDB and object storage; shared short-lived state lives in Redis. The file storage post shows how uploads go straight to storage so no server holds file bytes.
Each concern is shared like this:
- Sessions and data: MongoDB, so any server can serve any request.
- Role cache, rate limits, short-lived challenges: Redis.
- Realtime: every server runs a hub; Redis fans each event out to all of them and the replay buffer is shared, so a client can reconnect to any server.
- Jobs and event consumers: Redis consumer groups, so each item is handled by one worker.
- Scheduled tasks: a distributed lock elects one runner.
- File content: object storage.
The only in-memory state a server keeps is its own open WebSocket connections. Servers and workers can be added, removed or replaced freely.
The edge and the middleware chain
A reverse proxy terminates TLS, compresses responses, adds HSTS and sets the client address, which the server accepts only from trusted proxies. Then every request passes the same chain, in this order:
1 Request ID X-Request-Id on every log line and error
2 Security headers nosniff, framing, referrer, CSP, Permissions-Policy
3 Version header lets an open tab detect it is outdated
4 Recover unexpected failure -> clean 500
5 Logger one structured line per request
6 CORS allow-list of the app's own origins
7 App tokens installed apps, checked against their scopes
8 Session cookie or bearer token
9 Rate limit per user, or per address when anonymous
10 CSRF state-changing requests must come from the app
11 Require private routes need a signed-in user (401)
One chain for every route means a security fix lands everywhere at once. CSRF is handled without tokens: state-changing requests must carry a custom header that browsers will not send cross-site without a CORS preflight, and the preflight is refused for unlisted origins.
Sessions are opaque and stored server-side: a random 256-bit token in an HttpOnly, Secure, SameSite=Lax, __Host- cookie, with only its SHA-256 hash in the database. Because sessions live on the server, signing out or removing a device ends them at once and disconnects their realtime connections.
One error format everywhere
Every error has the same shape:
{
"error": {
"code": "authz.insufficient_role",
"message": "…",
"params": { "action": "write", "role": "View", "required": "Edit" },
"request_id": "01JD…"
}
}
code is stable and machine-readable (<domain>.<reason>), and clients translate it into the user's language using params, which is how one backend serves an interface in English, French, German and Vietnamese. message is for developers, request_id ties a user report to server logs, and internal causes are logged, never returned. Status codes are used consistently: 402 when a plan limit stands in the way, 404 for "does not exist or not visible to you", 409 for conflicts, 422 for validation with each field named.
A contract-first API
The REST API lives under /api/v1 and is described by an OpenAPI contract. The web application's client types are generated from it, so the web app uses exactly the API that integrations will use; a public API reference and an SDK are coming soon.
Three conventions make the API safe to build on:
- Cursor pagination: lists return
{ "items": […], "next_cursor": "…" }with an opaque cursor. - Safe retries: creating a message or task carries a client-generated
client_id, so a retried request returns the first result instead of a duplicate. Completing an upload is idempotent the same way. - No silent optimism: every failed action reports an error, and the client restores the previous state.
One event bus, delivered over WebSocket
A change is not finished when the response is sent. Services publish an event for every change, with a fixed envelope: a time-ordered id (also the replay position), a type such as task.updated, a room (user:, ws:, conv:, tenant: or link:), the tenant and actor, the originating client_id, a timestamp and a payload.
Publishing does three things at once: it fans the event out to the hub on every server, appends it to a short replay buffer for its room, and appends it to a durable stream for background consumers. Follow-up work runs after the response, so the caller never waits.
The WebSocket connection uses the same session as the API and accepts only the app's own origins. Each room subscription is checked with the API's access rules and re-checked when membership changes. On reconnect, the client states the last event it saw and receives what it missed within a five-minute replay window; beyond that, it reloads. A new member never receives, by replay, events from before they joined.
Background jobs
Slow work, or work that must survive a restart, is queued in Redis:
mediafor image thumbnails and previews, andmedia-videofor poster frames and renditionsarchivefor zip extraction,exportfor account exports,gdrivefor Google Drive importsmailandpushfor email and mobile push delivery
A failed job is retried a limited number of times, then moved to a dead-letter queue, and a job whose worker died is picked up by another. Scheduled tasks (purging expired trash, pruning versions, garbage-collecting content, reconciling storage usage, meeting reminders) run under a distributed lock, so exactly one worker runs each one however many are deployed. Notifications are consumed from the event stream with at-least-once delivery, and never go to the person who made the change.
Two traces through the system

Creating a task: authorize in the service, respond, then publish and notify after the response.
Creating a task. The browser sends POST /api/v1/workspaces/{id}/tasks with a client_id. The middleware chain identifies the user and applies the rate limit and CSRF check. The handler validates the body; the service resolves the caller's role, requires task_write (Editor) and takes the tenant from the workspace. It checks that assignees are members and attachments are in the same workspace, inserts the task and returns 201. After the response, it records the activity and publishes task.created to the workspace room. Every hub delivers it to subscribed tabs, the creating tab ignores its own echo, and a worker notifies assignees and mentioned people.
Sending a chat message. The browser shows the message immediately and posts it with a client_id. The chat service checks access (a participant for a direct conversation, at least Chatter for a workspace conversation), validates attachments and mentions, and stores the message. A retried client_id returns the first message and publishes nothing twice. message.new goes to the conversation room, and counters, previews and notifications follow after the response. The chat-to-task workflow post shows the same flow from the user's side.
The stack

Nine layers, one application binary: Go, React and TypeScript, MongoDB, S3-compatible storage, Redis, LiveKit, Drumee's own office engine and a reverse proxy.
Media processing runs in the background workers, with ffmpeg for video. Office documents are co-edited in the browser through Drumee's own office engine rather than a third-party document server.
What this means for teams that run on Drumee
A collaboration product assembled from separate tools usually means several vendors, data models and permission systems, the pattern we described in what is tool sprawl. One binary and one data model is the engineering counterpart of that product promise.
For control, there are few moving parts to reason about: one application, three stores, one error format, one event bus. For sovereignty, the docs describe the self-hosted edition, which is coming soon, as the same platform packaged for your own infrastructure, so operators will run the same platform the hosted service runs today. For cost, fewer components means fewer things to provision, monitor and pay for, and one system in place of several services reduces the vendor lock-in that a stitched-together stack creates.
FAQ
What is a modular monolith?
A modular monolith is a single deployable application divided into self-contained modules with explicit boundaries. Modules are built, tested and deployed together, so calls between them are in-process rather than over the network. Drumee uses this pattern with one Go binary.
Is Drumee built with microservices?
No. Drumee runs as one Go binary in server, worker or migrate mode, and each domain is a module inside it. The docs state that there is no fleet of services to version against each other.
How does a modular monolith scale horizontally?
By keeping servers stateless. Drumee stores durable data in MongoDB and object storage and shared short-lived state in Redis, so any number of servers and workers can run side by side, and Redis fans realtime events out to all of them.
What happens to realtime updates when a connection drops?
The client reconnects with back-off, states the last event it saw and receives what it missed within a five-minute replay window. If it was away longer, the server says so and the client reloads its data instead.
Does Drumee have a public API?
The REST API under /api/v1 is described by an OpenAPI contract, and Drumee's own web app uses exactly that API. The public API reference and the SDK are listed as coming soon.
Conclusion
Drumee's architecture trades the flexibility of independent services for one binary, one permission model and one event bus, and recovers scale through stateless servers and shared stores. The next post explains how the data inside that binary stays separated: tenant isolation and data protection in Drumee. To see it working, try Drumee at app.drumee.com.
Try Drumee with your team: your first month is $1. Start your team for $1
Keep reading

Role-Based Access Control for Collaboration Apps: Drumee's RBAC Model
Role-based access control (RBAC) for a collaboration app means permissions follow from a person's role, not from per-file settings. In Drumee, each person holds exactly one role per workspace, on a ladder from Viewer to Owner, and the server check...

How Drumee Stores Files: Resumable Uploads to S3-Compatible Storage
Drumee stores every file in two places. What the file is (name, folder, owner, current version) is a node in MongoDB. What the file contains is an object in S3-compatible storage. Browsers upload bytes directly to that storage in resumable par...

How Drumee Isolates Tenant Data: Multi-Tenant Isolation and Encryption
Multi-tenant data isolation means one customer's data can never be read through another customer's account, even though both run on shared infrastructure. In Drumee, every document carries the ID of the tenant that owns it, every query filters by ...