What Is a Data-Intensive Application?
Why most applications are limited by data rather than CPU, and how databases, caches, search indexes and logs fit together into one system that your code has to keep consistent.
Overview
An application is data-intensive when its hard problems are about data: how much there is, how complex it is, and how fast it changes. It is compute-intensive when the hard problem is raw CPU work, such as encoding video or training a model. Most business software (shops, social apps, banking, SaaS) is data-intensive. The CPU is rarely the limit; storing, finding and moving data correctly is.
Such an application is almost never one database. It is several specialized tools wired together, and your code is the wiring. That wiring is where most of the difficult bugs live, because each tool keeps its own promises and none of them promises anything about the others.
The building blocks
Each tool is good at one access pattern and gives something up to be good at it. Knowing what each one gives up is the skill interviewers look for, more than knowing product names. Six blocks cover most designs.
- Database (PostgreSQL, MySQL): stores data durably, answers queries and runs transactions. It gives up speed, since it is slower than memory, and full-text relevance ranking is not its strength.
- Cache (Redis, Memcached): answers hot reads from memory. It can serve old data and may lose recent writes on a crash.
- Search index (Elasticsearch, OpenSearch): finds records by words and ranks them. New writes show up after a short delay, and it is not a system of record.
- Log or message broker (Kafka): carries events between services, in order, and keeps them for replay. It is not a query engine, so consumers must process events themselves.
- Stream or batch processor (Flink, Spark): computes new data from old data. Its results lag behind the input.
- Analytics warehouse (BigQuery, Snowflake): scans and aggregates huge tables. It is not built for many small, fast writes.
Two of these are worth making concrete. By default, Elasticsearch makes a new document searchable within about one second, because it refreshes an index once a second rather than on every write (and only while the index is being searched). Redis with snapshot persistence can lose the last few minutes of writes if it stops without a clean shutdown; with its append-only log at the default setting of one flush per second, it can lose about one second of writes.
Key concepts
- Data-intensive application
- System of record
- Derived data
- Dual write
- Change data capture
- Access pattern
Interview questions
- Why do real applications use several data stores instead of one?
- How would you keep a search index in sync with the primary database?
- What is derived data, and why does the distinction matter in a design?
- Is it ever right to use a single database for everything?
Sign up free to read the full topic
More DDIA topics
Start free on Cariara · Coding problems · System design studio