Database Management · Advanced level

Advanced level · Module 5: NoSQL and Choosing a Data Store · Lesson 4 of 4

Choosing a Data Store

Make and justify data store decisions from requirements rather than trends.

In this lesson you will

  • Evaluate data store options against requirements
  • Write an architecture decision record

Key concepts

requirements-based choiceoperational costteam skillsarchitecture decision record

The lesson

Start from requirements: data shape, relationships, integrity needs, volume, read/write patterns, consistency, offline needs and reporting. Then consider the team's skills, operational effort and cost.

A single well-run PostgreSQL database meets the needs of most organisations, often with JSONB for flexible parts. Add another store only when a clear requirement — such as a fast cache — justifies its extra operational work.

Record the decision in an architecture decision record (ADR): context, options considered, decision and consequences. Future staff will understand why, not just what.

Step by step

  1. Collect requirements for three scenarios.
  2. Evaluate two or three options for each.
  3. Make a decision for each.
  4. Write an ADR for one of them.
Troubleshooting tree

Which data store does this feature need?

A requirement-led path from 'we need to store this' to a sensible choice — usually PostgreSQL.

Does the data have relationships, rules or transactions that must always be correct (people, payments, stock)?
  • Yes
    Use a relational database such as PostgreSQL with constraints and transactions. Most organisational records belong here.
  • No
    Is it a temporary copy used to make reads faster (sessions, cached reports)?
    • Yes
      Use an in-memory key-value store such as Redis with expiry times, and keep the source of truth in the main database.
    • No
      Is it flexible, varying data such as survey responses whose questions change?
      • Yes
        Start with a JSONB column in PostgreSQL alongside normal columns for IDs and reported fields; consider a document database only at very large scale or for specific needs.
      • No
        Write down the access patterns, volumes and consistency needs, then compare options in an architecture decision record before adding a new system.

Notes

Every additional database type means more servers, backups, monitoring and skills. Add one only when a requirement clearly needs it.

Practice activity

Write data store recommendations and one ADR for the provided scenarios.

Expected result: Justified recommendations tied to requirements, and a complete ADR.

Check your understanding

  1. Why not add a new database type just because it is popular?

    Show answer

    Each store adds operational work and cost; it must be justified by a requirement.

  2. What does an architecture decision record contain?

    Show answer

    Context, options, the decision and its consequences.

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.