Home›Technologies›Databases and cache

Data structured
around the process.

We design data storage, retrieval and access to suit the application's needs.

Two organised sets of records and three red cache layers — illustration of data models
PostgreSQLMongoDBRedis
Not all information needs the same model

Different data,
different needs.

We choose technology to match how the product stores and uses information. Relationships, documents and caches serve different purposes.

Relationships and transactions

Structure and consistencyPostgreSQL

Document model

Flexible structureMongoDB

Cache and short-lived state

Quick accessRedis
Data model example

The same record.
Three representations.

An example of a single order. This is not a recommendation to maintain the same data in all three databases.

Order #10293
Client
Anna Kowalska
Status
Paid
Total
399,00 PLN
Process owner
Sales team
Demo data

Relationships — PostgreSQL

zamówieniaid · 10293
klient_id · 15
status · paid
total · 399.00
customersid · 15
first name · Anna
surname · Kowalska
zamówienie_id → zamówienia.idpozycje_zamówieniazamówienie_id · 10293
produkt_id · p1
quantity · 1

Related records, consistency rules and transactions.

Document — MongoDB

{
  "_id": "10293",
  "klient": {
    "imie": "Anna",
    "nazwisko": "Kowalska"
  },
  "pozycje": [
    { "produkt": "p1", "ilosc": 1 }
  ],
  "status": "oplacone",
  "suma": 399.00
}

Information collected in a document designed for easy reading.

Cache — Redis

KEY order:10293:summary

VALUE
{
  "status": "oplacone",
  "suma": 399.00
}

TTL 3600 seconds

Example summary with an expiry time. It does not replace the source of truth.

One process.
Three uses.

We connect tools when their roles justify it. A simple project may need only one database.

Backups, permissions
and recovery.

Data needs more than a good model: it also needs access control and a tested recovery plan.

  • Roles and permissions
  • Regular backups
  • Disaster recovery test
Order #10293Owner · team · access · audit

Owner

Decisions and granting access

Team

Read or edit according to role

Systems

Only the required operations

Pre-migration model

We analyse the current model and dependencies. We plan the change, consistency checks and the ability to roll back safely.

Current model

  • Shared database
  • Current constraints
  • Existing integrations
  • Risks of the change

Target model

  • Agreed requirements
  • Tailored structure
  • Data transfer plan
  • Acceptance criteria

Questions about data

When should I choose PostgreSQL, and when MongoDB?

We analyse the information structure, relationships, transactions and how data is read and changed. Relational and document models address different needs; the choice requires product context.

Can a cache replace a database?

A cache usually stores selected information that can be recreated from the source. In this example, Redis speeds up summary reads; it does not take responsibility for saving the order.

What does the data migration process involve?

We start with an inventory, backups and a trial transfer. We check relationships and data completeness before planning the actual switchover and post-change checks.