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
- Collect requirements for three scenarios.
- Evaluate two or three options for each.
- Make a decision for each.
- Write an ADR for one of them.
Which data store does this feature need?
A requirement-led path from 'we need to store this' to a sensible choice — usually PostgreSQL.
- YesUse a relational database such as PostgreSQL with constraints and transactions. Most organisational records belong here.
- NoIs it a temporary copy used to make reads faster (sessions, cached reports)?
- YesUse an in-memory key-value store such as Redis with expiry times, and keep the source of truth in the main database.
- NoIs it flexible, varying data such as survey responses whose questions change?
- YesStart 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.
- NoWrite down the access patterns, volumes and consistency needs, then compare options in an architecture decision record before adding a new system.
- Yes
- Yes
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
-
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.
-
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.