Skip to main content

3 posts tagged with "cost-optimization"

View All Tags

The Hidden Complexity of "Easy" Geo-Sharding in MongoDB

· 8 min read
Vladyslava Prykhodko
Engineering Technical Lead & Architect

Geo-sharding is one of the features that makes MongoDB attractive for a global product. You keep each user's data physically close to them, one logical collection still reads as a single dataset in Compass or Atlas, and the adoption cost looks tiny: add a shard key, and queries route to the right region.

The simplicity is real. So is the failure mode hiding inside it. This is a field story about how "easy" geo-sharding quietly doubled a database bill — and why that was never MongoDB's fault.

Externalized Authorization Across a Hundred Services: What OPA/OPAL Sidecars Actually Cost

· 11 min read
Vladyslava Prykhodko
Engineering Technical Lead & Architect

Part 2 of a series on ABAC in production. Part 1 covered in-process guards and why they're enough for most teams. This part is about what happens when they stop being enough, and what the bill looks like.

Everything below is illustrative and generalized — a reference model, not data or code from any specific system. Substitute your own. The method is what matters: measure your own numbers the same way, and the proportions will likely hold.

The setup​

Picture a typical modern platform: microservices on something like NestJS, a database, deployed to managed Kubernetes (EKS/GKE/AKS — doesn't matter), roughly a hundred to a hundred and fifty services, zero-trust model. Every user request fans out through 5–15 services, and every service-to-service call is authorized independently — no trust at the perimeter.

Authorization lives outside the applications: an ABAC policy engine (OPA) makes the decisions, and OPAL keeps policies and data in sync. User attributes sit in the database and are editable from a UI. A textbook externalized-authorization setup.

Sooner or later a simple question comes up that you usually have no number for: what does this cost? Not "is OPA expensive in principle," but concretely — how much CPU and how many dollars go into the authorization layer itself. This article is about how to measure that, and why the number turns out to be somewhere other than you'd expect.