Skip to main content
Basics

Database

Organised collection of data that can be stored and queried electronically. Relational databases use tables; NoSQL uses flexible models.

Databases are the memory of every application. Customer data, orders, sensor readings or chat history – everything is stored, organised and queried in databases. Choosing the right database is one of the most important architecture decisions and affects performance, scalability and cost for the life of the application.

What is Database?

A database is an organised system for storing, managing and querying data electronically. A DBMS (Database Management System) is the software that runs database operations. Relational databases (RDBMS) like PostgreSQL, MySQL and SQL Server store data in tables with rows and columns linked by relationships (foreign keys). SQL is the standard query language. NoSQL databases like MongoDB (document), Redis (key-value), Cassandra (wide-column) and Neo4j (graph) use flexible models for specific use cases. NewSQL (e.g. CockroachDB) combines SQL with horizontal scaling.

How does Database work?

A relational database stores data in normalised tables (e.g. customers, orders, products) linked by foreign keys. SQL (SELECT, INSERT, UPDATE, DELETE) reads and changes data. Transactions (ACID) ensure consistency. Indexes speed up queries. ORMs (Prisma, TypeORM, SQLAlchemy) abstract SQL in code. Replication distributes data across servers for resilience and read performance.

Practical Examples

1

PostgreSQL for SaaS: Multi-tenant with row-level security, JSON for flexible structures and full-text search.

2

MongoDB for content: Flexible documents for different content types (articles, videos, podcasts) without a fixed schema.

3

Redis for caching: Cache for frequently read data (sessions, API responses) – response time from milliseconds to microseconds.

4

Neo4j for recommendations: Graph database for relationships between users, products and purchases – basis for recommendation engines.

Typical Use Cases

Web apps: PostgreSQL or MySQL for users, content and business data

E-commerce: Catalogue, orders, customers and inventory

Analytics: Data warehouses (BigQuery, Redshift) for BI and reporting

Real-time: Redis and MongoDB for chat, scores and IoT data

Search: Elasticsearch or Meilisearch for full-text and faceted search

Advantages and Disadvantages

Advantages

  • Integrity: ACID in relational DBs keeps data consistent
  • SQL: Universal query language with decades of use
  • Scaling: Replication, sharding and managed services enable horizontal scale
  • Flexibility: NoSQL fits varied structures and access patterns
  • Managed: Cloud (AWS RDS, Supabase, PlanetScale) handles operations and backup

Disadvantages

  • Schema: Relational DBs need migrations when structure changes
  • Scaling limits: Vertical scaling hits hardware limits; horizontal is complex
  • ORM overhead: Abstractions can lead to inefficient queries (e.g. N+1)
  • Operations: Self-hosted DBs need backup, monitoring, updates and tuning

Frequently Asked Questions about Database

PostgreSQL or MySQL?

PostgreSQL: better SQL compliance, JSON, arrays, full-text search and advanced features (CTEs, window functions). MySQL: easier to set up, fast for simple read workloads, widely used (WordPress, Laravel). For new projects PostgreSQL is often recommended for flexibility and features. Both are available as managed services.

When SQL and when NoSQL?

SQL when: data is structured and relational, transactions matter (finance, e-commerce), you need complex JOINs. NoSQL when: schema must be flexible (CMS, IoT), you need horizontal scale, or simple access patterns with real-time performance. Many systems use both: SQL for business data, Redis for cache, Elasticsearch for search.

What does a database cost?

Self-hosted: free (PostgreSQL, MySQL are open source) plus server cost. Managed: Supabase from €0 (free tier), AWS RDS from ~€15/month, PlanetScale from ~$29/month. Enterprise (MongoDB Atlas, Aurora, etc.) €50–500/month depending on size. For many startups a free tier or small managed instance is enough.

Related Terms

Want to use Database in your project?

We are happy to advise you on Database and find the optimal solution for your requirements. Benefit from our experience across over 200 projects.

Next Step

Questions about the topic? We're happy to help.

Our experts are available for in-depth conversations – no strings attached.

30 min strategy call – 100% free & non-binding

What is a Database? SQL, NoSQL & Types Explained