A data-intensive application is shaped by how information is stored, changed, moved, and recovered. Its hardest problems are often about correctness and coordination rather than the language handling an HTTP request. This independent overview maps the major decisions from a single database to derived views and distributed processing. The aim is to connect the concepts to practical questions, while resisting the temptation to adopt distributed infrastructure before a measured need exists.

Key takeaways

  • Data invariants and real access patterns should determine architecture before infrastructure choices do.
  • Transactions, replication, partitioning, and message delivery each make different guarantees under concurrency and failure.
  • Derived views and distributed processing are useful only when ownership, replay, and recovery remain understandable.

Start with invariants and access patterns

Write down the facts that must remain true: a reservation cannot consume the same unit twice, a payment operation needs a stable identity, or a user must only see records from an authorized tenant. These invariants guide transaction boundaries and ownership. Then describe the important reads and writes, including their expected size, frequency, and latency. A technology comparison is much more useful once the workload and correctness requirements have concrete names.

Choose a data model that supports those operations clearly. Relational tables, documents, and other models make different relationships easy to express, but none removes the need to understand constraints. Start with a well-operated database when it covers the workload. Keeping authoritative data in one coherent system can be a substantial advantage while the product is changing, especially when an alternative introduces coordination across several independent stores.

Make storage costs visible

An index trades storage and write work for faster access to particular query patterns. Inspect real execution plans and representative data before adding indexes indiscriminately. Composite indexes depend on how the query constrains and orders values; a list of individually indexed columns does not automatically solve a complex access pattern. Remember that EXPLAIN ANALYZE executes the statement, so use care with modifying queries and production workloads.

Distinguish a query problem from a capacity problem. Retrieving fewer columns, eliminating repeated queries, or correcting a missing index may be more effective than distributing the database. Test data growth, skewed values, and realistic concurrency rather than benchmarking only a small uniform dataset. The useful measurement is the behavior of the complete operation, including application processing and network transfer, rather than one attractive database timing in isolation.

Understand the transaction promise

A transaction groups changes, but the isolation level determines what concurrent operations can observe and which anomalies remain possible. A read followed by a write can be unsafe when another transaction changes the same underlying fact between them. Use constraints, appropriate locking, or a stronger isolation strategy according to the invariant. Treat database-reported conflicts and serialization failures as expected outcomes that may require a deliberate retry policy.

Retries must preserve the identity of the business operation. A network timeout does not establish that the database failed to commit. Give consequential requests stable idempotency keys and store their outcomes under an appropriate uniqueness rule. Keep the deduplication decision and the protected write in a consistency boundary that actually holds. Retrying an entire operation blindly can turn a transient failure into a duplicated charge, notification, or inventory adjustment.

Separate replication from partitioning

Replication keeps additional copies of data for availability or read workloads. With asynchronous replication, a replica can lag behind a recent write, so route freshness-sensitive reads deliberately. Failover needs a plan for leadership, connection changes, and potential data loss under the selected configuration. A replica is not a complete backup because a destructive change may be replicated just as successfully as a legitimate one.

Partitioning divides data across ownership boundaries or storage units. A useful partition key spreads work without making common operations unnecessarily expensive. Hot tenants, time-based bursts, and a popular individual key can defeat an apparently even design. Consider cross-partition queries and transactions before choosing the boundary. Adding partitions does not make an inherently sequential operation parallel, and moving data between owners becomes an operational problem of its own.

Treat logs and views as coordinated systems

A durable event log can decouple producers from consumers and support rebuilding derived views. That flexibility introduces explicit questions about event meaning, schema evolution, retention, ordering, and replay. Ordering guarantees often apply within a particular partition or stream rather than across the entire system. A consumer that updates a search index and one that sends email also have different replay requirements, even when both read the same business events.

Avoid an uncoordinated database write followed by an assumed-successful message publication. An outbox stored with the business change is one way to record publication work durably, but the relay and consumers still need to handle repetition and failures. Describe delivery guarantees end to end. A broker's processing guarantee does not automatically make an external HTTP call or another independent database transaction occur exactly once.

Design recovery before adding more pieces

For each component, identify its authoritative input, recovery procedure, and backlog limit. A derived view should be rebuildable within an acceptable time, with enough retained source data to perform that rebuild. Measure replication delay, consumer lag, error rates, storage growth, and the time needed to restore service. Backpressure should make overload explicit rather than allowing queues to grow until the next failure becomes impossible to recover from quickly.

Keep architecture decisions tied to observed constraints. Add a cache, replica, queue, or partition because it resolves a named bottleneck or reliability need, and record the new failure modes it introduces. Data-intensive engineering becomes manageable when ownership and promises are visible. A smaller system with well-defined invariants and tested recovery is often a stronger foundation than a distributed diagram whose correctness depends on several undocumented assumptions.

Action notes

  1. Write the invariants for one consequential operation and test them under retries and concurrent requests.
  2. Inspect representative query plans before adding another cache, replica, queue, or partition.
  3. Rehearse an ambiguous commit, repeated message delivery, and a derived-view rebuild; measure the recovery limits.

References & further reading