Blogs/Database Storage Explained: B-Trees, LSM Trees & How Your Data Gets Saved
aiagentictechMarch 2, 2026

Database Storage Explained: B-Trees, LSM Trees & How Your Data Gets Saved

Database Storage Explained: B-Trees, LSM Trees & How Your Data Gets Saved

You send a message. You place an order. You upload a photo. But what actually happens after you hit save? Where does your data go and how does the computer find it again?

There's a real system working behind the scenes. And how that system is set up can make apps super fast or really slow.

The Problem

Your computer has two ways to hold data.

Short-term memory is super fast, but forgets everything when the power goes off like a whiteboard.

Long-term storage (your hard drive or SSD) holds data forever but it's much slower. Up to 100,000 times slower than memory.

So the challenge is: how do we save data permanently and keep things fast? Engineers came up with two clever solutions.

Solution 1 - The Organized Bookshelf

Think of a library where every book has a perfect spot. When you want something, you go straight to it. Fast and easy.

This is how most traditional databases work. Everything is sorted and neatly stored. Finding data is very fast. But adding new data takes more effort the system has to find the right spot and carefully fit it in. When millions of new records arrive every second, that slows things down.

Best for: Banks, online stores, websites apps where people read data more than they write.

Solution 2 - The Running Journal

Imagine a journalist covering a live event. They don't stop to organize their notes they just write as fast as possible and sort it out later.

This is how modern databases like Cassandra work. Writing new data is incredibly fast because the system just keeps adding without stopping to reorganize. Reading is slightly slower, but smart tricks keep it fast enough that users never notice.

Best for: Chat apps, streaming platforms, social media apps where new data is coming in non-stop.

Quick Comparison

Organized Bookshelf

Running Journal

Fast at

Reading data

Writing data

Used by

Banks, e-commerce

Chat apps, streaming

Real Example

Discord started with the bookshelf approach. It worked great until they hit billions of messages. Adding new ones got slow. They switched to the journal approach, and writes became 10x faster overnight.

Most big companies use both one for reading, one for writing depending on what each part of their app needs.


You might also like

The Most Dangerous AI Agent on the Internet  And Why 200,000 People Still Use It
aiMarch 2, 2026

The Most Dangerous AI Agent on the Internet And Why 200,000 People Still Use It

An AI tool that connects to your WhatsApp, email, and files is taking over the internet. But security experts just found something alarming inside it.

What is RAG? How OpenRAG Gives AI the Right Answers
aiMarch 2, 2026

What is RAG? How OpenRAG Gives AI the Right Answers

AI can't answer business questions it was never trained on. RAG fixes that. See how OpenRAG uses your own data to give accurate, real answers free and easy to set up.

Google Opens New AI Engineering Centre in Taiwan
aiFebruary 25, 2026

Google Opens New AI Engineering Centre in Taiwan

Google opens a new AI engineering centre in Taiwan, its largest AI hardware hub outside the U.S. Discover why Google chose Taiwan, how the centre will speed up AI development, and what this means for the future of artificial intelligence worldwide.

Enjoy this article?

Subscribe to our newsletter to get more insights on technology, design, and the future of digital innovation.

CRTVAI

Unlock AI's full potential with expert insights from leading software innovators. Subscribe for exclusive content on ChatGPT integration, custom development solutions, and transformative technologies that deliver measurable business results.

Explore Topics

Newsletter

Stay updated with our latest articles, tips, and industry insights delivered directly to your inbox.

By subscribing, you agree to our Privacy Policy and to receive our emails.