NoSQL · Data models beyond tables
How do you control NoSQL costs in production?
Short answer
Reduce data volume and request volume first: TTL old data, compress, avoid scans, right-size indexes and choose the right capacity mode. Then tune storage tier, reservations and cross-region traffic.
Cost usually comes from provisioned throughput, storage, backups and data transfer. The cheapest request is the one you do not make, so caching, pagination and projection often save more than a pricing negotiation.
Where the money goes
- Over-provisioned capacity that sits idle most of the day
- Scans and unbounded queries that consume capacity without serving a user need
- Secondary indexes that multiply write and storage cost
- Data kept forever because no TTL or retention policy exists
- Cross-region replication and egress
- Oversized documents that increase every read and write unit
ALTER TABLE events WITH default_time_to_live = 7776000;
SELECT table_name, disk_space_used
FROM system_schema.tables;
ALTER TABLE events DROP default_time_to_live;Match capacity mode to traffic. Provisioned plus autoscaling or reserved capacity is cheaper for steady predictable load; on-demand is better for spiky or unknown traffic. Revisit the choice after several months of real data, because the crossover point changes with scale.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1How would you find the most expensive queries in a NoSQL system?
- 2When does on-demand pricing become more expensive than provisioned?
- 3What is the cost of an unnecessary secondary index?
- 4How do TTLs reduce both storage and read cost?
Say it in the interview
I look at data volume and request volume before pricing tricks. TTL and retention policies remove data nobody needs, projection and pagination reduce bytes read, and caching removes repeated requests. I also audit secondary indexes, because they add write and storage cost, and I match capacity mode to the traffic pattern. I never cut backups or redundancy to save money, since that trades a small saving for a large recovery risk.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live NoSQL mock interview and get scored feedback on depth, clarity and confidence.