A MongoDB question about splitting data for many customers
A Reddit user asked how to run MongoDB for a multi-tenant service. The choice is one 12-shard cluster or 12 replica sets with app-level routing.
This item is not a product launch or a benchmark. It is a community question about database design. The practical issue is how to store and separate data for many customers in one service. One option is a single MongoDB cluster split into shard parts. The other is 12 separate replica sets, with the app choosing where each request goes through app-level routing.
For AI agents, this does not directly reduce token costs. It can still matter if you store chats, files, customer workspaces, or agent logs for many users. One large cluster may be simpler to manage in one place, but can make failures and scaling decisions more complex. Separate replica sets can make customer separation clearer, but add more routing and operations work.
Key points
- The post asks about MongoDB multi-tenant design.
- The two options are one 12-shard cluster or 12 replica sets.
- app-level routing means the app chooses which database target to use.
- This is more about storage cost and operations than token savings.
- The provided item does not include a final answer or measured results.
Quick term guide
- multi-tenant
- A setup where one service serves many customers while keeping their data separated.
- replica sets
- Groups of MongoDB servers that keep copies of the same data.
- benchmark
- A test used to compare speed, quality, or cost.
- database
- A large collection of organized data used for search and analysis.
- AI agents
- AI agents are AI tools that can carry out steps toward a goal, not just answer once.
- AI agent
- An AI program that can inspect information and suggest what to do next.
- token costs
- Token costs are the fees paid for the text an AI model reads and writes.
- token cost
- The money or usage spent when sending text to an AI model and getting text back.