Database

Database is a structured system for storing, organising and retrieving data so applications can access it reliably and at scale. Managed by a database management system (DBMS), it enforces consistency, supports concurrent access, and lets software query, update and persist information far beyond what flat files allow.

How a database works inside an application

In any non-trivial application, the database is the layer that holds state once a request ends. The application code never touches raw storage directly: it talks to a database management system (DBMS) such as PostgreSQL, MySQL, MariaDB, SQL Server, MongoDB or Redis, which handles persistence, indexing and concurrent access.

The database typically sits behind the application server and is reached through a connection, a query language and a data access layer (an ORM like Eloquent, Hibernate or Prisma, or raw queries). Its core responsibilities are:

  • Persistence — data survives restarts, deployments and crashes.
  • Integrity — constraints, types and relationships prevent invalid data from being stored.
  • Concurrency — multiple users can read and write at the same time without corrupting state, usually through transactions and locking.
  • Querying — data is retrieved by criteria rather than read sequentially, often accelerated by indexes.
  • Security — access control, authentication and isolation from the public network.

For most business software (CRM, ERP, internal platforms), the database is the single source of truth. Its schema design directly shapes performance, maintainability and the cost of future changes.

Relational vs NoSQL: choosing the right model

The main architectural decision is between a relational database (SQL) and a NoSQL database. Relational systems store data in tables with fixed columns and enforce relationships and a schema; NoSQL covers several models (document, key-value, wide-column, graph) that trade strict structure for flexibility or horizontal scale.

CriterionRelational (SQL)NoSQL
Data modelTables, rows, columns with relationshipsDocuments, key-value pairs, graphs or wide columns
SchemaFixed, defined upfront, enforcedFlexible or schema-less
Query languageSQL (standardised)Varies by engine and model
TransactionsStrong ACID guaranteesOften eventual consistency; ACID varies
ScalingPrimarily vertical; horizontal is harderDesigned for horizontal scaling
Typical examplesPostgreSQL, MySQL, MariaDB, SQL ServerMongoDB, Redis, Cassandra, Neo4j
Best fitStructured data, complex relations, reportingHigh volume, variable structure, caching, real-time

For most B2B business applications with well-defined entities, invoicing rules and reporting needs, a relational database remains the default: ACID transactions and referential integrity protect business-critical data. NoSQL is chosen for specific workloads — caching, event streams, document storage, or massive horizontal scale. Many production systems combine both (polyglot persistence).

Questions fréquentes

A database is the organised collection of data itself, while a database management system (DBMS) is the software that creates, reads, updates and manages that data. PostgreSQL, MySQL and MongoDB are DBMSs; the actual tables or documents they hold are the database. In everyday speech the two terms are often used interchangeably.

Choose a relational database when your data has clear, stable relationships, requires strong consistency, and feeds reporting or transactional logic such as orders, invoices or accounting. Its ACID guarantees and referential integrity protect business-critical data. NoSQL fits variable structures, very high write volumes, caching or horizontal scale where strict schema and joins are less important.

No. SQL (Structured Query Language) is the standard language used to query and manipulate relational databases, not a database itself. People often say "SQL database" to mean a relational database that uses SQL, as opposed to NoSQL systems. The database engine is the software, while SQL is how you communicate with it.

Yes. This is called polyglot persistence and is common in production systems. An application might use a relational database for core business data, an in-memory store like Redis for caching and sessions, and a document or search engine for specific workloads. Each engine is selected for the job it handles best, at the cost of added operational complexity.

Building a custom software project? We design bespoke software aligned with your roadmap.

See our custom software expertise