I optimized S3. I raised Atlas without noticing
Published on November 19, 2026
𝗜 𝗼𝗽𝘁𝗶𝗺𝗶𝘇𝗲𝗱 𝗦𝟯. 𝗜 𝗿𝗮𝗶𝘀𝗲𝗱 𝗔𝘁𝗹𝗮𝘀 𝘄𝗶𝘁𝗵𝗼𝘂𝘁 𝗻𝗼𝘁𝗶𝗰𝗶𝗻𝗴
I designed the feature to bring down the 𝗦𝟯 bill… and ended up raising the 𝗔𝘁𝗹𝗮𝘀 one without noticing 😅
The SDK from a sensor we integrated sent diagnostic logs with no limit at all — some users go over 6,000 logs in 4 hours. My focus when designing was lowering S3 cost, which charges per write: I built a buffer in Mongo that consolidates everything into one object per batch before uploading, and deletes it after 60 days. The logic seemed solid: if I don't leave the data living permanently in Mongo, Atlas's bill shouldn't go up much either.
I checked, step by step:
→ The plan worked for S3: one object per batch, not per log, brought the write cost down as expected
→ What I didn't account for was 𝗔𝘁𝗹𝗮𝘀: I thought that by not leaving the data permanently in Mongo, its bill would stay the same
→ I didn't know the 𝗼𝗽𝗹𝗼𝗴 records every write, not the final state — it doesn't matter if the data gets deleted afterward
→ With 𝗖𝗼𝗻𝘁𝗶𝗻𝘂𝗼𝘂𝘀 𝗕𝗮𝗰𝗸𝘂𝗽 enabled, Atlas retains that oplog to be able to restore to any point in time — and that gets billed
→ And the 𝗶𝗻𝗰𝗿𝗲𝗺𝗲𝗻𝘁𝗮𝗹 𝘀𝗻𝗮𝗽𝘀𝗵𝗼𝘁𝘀 remember what I had already deleted, until they expire
What I learned 💻
→ Optimizing one service's cost (S3) guarantees nothing about another's (Atlas) — each one bills differently
→ Deleting data in Mongo doesn't delete its history: it stays alive in the backup until it expires
→ The bill is part of the design, not a separate piece of paper — you have to understand how each piece bills before building the architecture 🔥
We adjusted the backup retention and the bill came down a bit 📉, but the code implementation still needs work to bring costs down further — that's the next step.
Has it happened to you — optimizing one cost and ending up raising another without realizing it? Tell me 👇
Keep flying, Champions! ✈️