Monolith or Microservices: Notes from a Small Team

Notes on why a modular Go monolith worked better than twelve microservices for a small team, with a rough cost comparison.

· 3 min read · Erik Kubica

I've seen several small teams adopt an architecture sized for a much larger company.

One of them had four developers, twenty-five thousand monthly active users, and a Postgres database with forty tables. Their architecture diagram had twelve microservices, three gRPC protocols, an asynchronous event bus, and Docker containers falling over on an overloaded Kubernetes node.

When I asked why they split the codebase, the answer was: "Microservices let teams deploy independently."

They had four developers sitting at the same desk, so that benefit didn't really apply to them.

The Cost of a Function Call

In a monolith, calling another domain module is an in-process function call, which takes on the order of nanoseconds:

// Direct in-process call inside a single Go binary
order, err := billingService.ProcessPayment(ctx, orderID, amount)
if err != nil {
    return fmt.Errorf("billing failed: %w", err)
}

The moment you move billingService into its own microservice, that call becomes:

  1. DNS resolution and TLS negotiation over a private virtual network.
  2. JSON or Protobuf payload serialization on the sender side.
  3. A TCP roundtrip, which in my setups took roughly 12 to 35 ms.
  4. Payload deserialization and memory allocation on the receiver.
  5. Handling partial network drops, retries, and backoff.

Each of these is manageable, but together they add a lot to debug compared with a plain function call.

The Hardware Economics

Here are the server costs from my own setups.

I run modular monoliths written in Go on small production instances (2 vCPUs, 4 GB RAM). A single compiled binary holding billing, inventory, authentication, and notifications idles at about 35 MB of RAM. Under load, it handled around 4,500 req/sec with CPU utilization below 12%. Server prices change over time, but keeping the application in one binary meant it fit on a single modest instance.

For comparison, here is roughly what the same business logic cost when split across eight containerized microservices:

Architecture Memory Baseline Monthly Compute Cost Latency Floor
Go Modular Monolith 35 MB RAM $15.00 / mo (Single node) 0.8 ms
8 Microservices (Node/Go) 1,800 MB RAM $64.00 / mo (Cluster) 28.0 ms

Each container needs its own runtime footprint, logging buffer, connection pool to Postgres, and health check. A large part of the memory ends up hosting infrastructure overhead rather than application logic. These are figures from my projects, not a general benchmark.

Modularity Without Network Hops

In the cases I've seen, the real problem was rarely the monolith. It was missing boundaries inside it.

When code gets tangled, it is tempting to blame the single binary. But splitting tangled code across network sockets doesn't tidy it up; it just spreads the tangle over several services.

In Go, I enforce domain boundaries using the internal package directory:

cmd/api/main.go
internal/
├── auth/          // exports Service, hides password hashing internals
├── billing/       // exports Service, hides Stripe client internals
├── catalog/       // exports Service, hides inventory queries
└── platform/db/   // shared connection pool

Packages communicate via Go interfaces, and domain models stay encapsulated. If billing needs data from catalog, it calls an exported method. There are no HTTP headers to propagate and no distributed transactions. When an order completes, I wrap the payment and the inventory update in a single PostgreSQL BEGIN ... COMMIT block.

Splitting into services moves the boundaries onto the network; it doesn't make them cleaner on its own.

Microservices make sense when you have several teams that need to deploy independently or parts of the system with very different scaling needs. For a small team like the one above, keeping the domains in one repository and deploying one binary was the simpler option, and it was cheaper to run.

Tell me what you need built

Usually a reply within a day, by email or WhatsApp.