Databases are organised systems for storing, managing, retrieving, and modifying data through defined structures and controlled interfaces. A database is typically managed by a Database Management System, or DBMS, which provides mechanisms for storage, querying, transactions, concurrency, security, recovery, and administration. Databases range from small embedded stores used by individual applications to distributed systems supporting global services. The term does not refer to one specific data model: relational, document, key-value, graph, wide-column, time-series, and other database approaches exist because different workloads require different structures and access patterns. A database is therefore best understood as a managed data system rather than simply a collection of files.
Relational databases organise information through tables consisting of rows and columns and use a formal relational model based on relations, attributes, and tuples. SQL is the dominant language for querying and manipulating many relational databases, although implementations differ in syntax and capabilities. Relationships between tables can be represented through keys, and constraints can enforce requirements such as uniqueness, referential integrity, and permitted values. Normalisation can reduce redundant data and update anomalies by dividing information into logically related relations. Relational databases are particularly strong for structured data and transactional workloads, although modern relational systems also support JSON, spatial information, full-text search, analytical features, and other capabilities that extend beyond traditional tabular data.
Database transactions provide a controlled way to perform related operations as a logical unit. The ACID properties are commonly used to describe important transactional guarantees: atomicity means a transaction is treated as an indivisible unit of work, consistency means defined database constraints and invariants are maintained, isolation concerns how concurrent transactions interact, and durability means committed changes survive appropriate failures. Implementations differ in their isolation levels and mechanisms, so ACID should not be interpreted as one identical behaviour across all systems. Transactions are particularly important for systems such as banking, ordering, inventory, and account management where partial or conflicting updates can produce serious inconsistencies.
Database performance depends on workload characteristics, data structures, indexes, query plans, storage engines, caching, hardware, concurrency, and distribution. Indexes create additional structures that allow certain searches to be performed more efficiently, although they consume storage and can increase the cost of writes. Query optimisers analyse SQL statements and choose execution strategies based on statistics and available access paths. Partitioning can divide large datasets into manageable sections, while replication maintains additional copies for availability, read scaling, or disaster recovery. Sharding distributes data across multiple machines according to a partitioning strategy, but introduces complexity around routing, joins, transactions, rebalancing, and operational management.
NoSQL databases encompass several non-relational approaches developed to address particular scalability, flexibility, or access-pattern requirements. Document databases store records as document structures, key-value stores associate values with keys, wide-column systems organise data around flexible column families, and graph databases represent entities and relationships explicitly. These systems often relax or reinterpret some relational assumptions to support specific workloads. Some provide strong transactional guarantees, while others emphasise horizontal scalability or availability. The term NoSQL therefore does not describe one common technical architecture or one rejection of SQL; many NoSQL systems support query languages with SQL-like concepts, and some modern relational systems also scale horizontally or support flexible schemas.
Database security encompasses authentication, authorisation, encryption, auditing, access controls, secrets management, network restrictions, vulnerability management, backups, and monitoring. Privilege should generally be limited to what an application or user requires. SQL injection is a major application-level risk that occurs when untrusted input is incorporated unsafely into SQL statements, which is why parameterised queries and suitable input-handling practices are important. Backups protect against data loss but do not automatically provide complete disaster recovery; restoration procedures, recovery objectives, backup integrity, and geographic considerations also matter. Sensitive data may require additional controls for access, retention, masking, or deletion depending on the applicable requirements.
Databases can be deployed on a single server, replicated across multiple systems, embedded inside applications, hosted as managed cloud services, or distributed across regions. High availability commonly involves redundancy and automated or controlled failover, while disaster recovery concerns restoration after larger failures or loss events. Distributed databases must address challenges involving network partitions, consistency, coordination, replication, and latency. The CAP theorem is frequently discussed in this context, although it is often oversimplified; it concerns trade-offs involving consistency, availability, and partition tolerance under network partition conditions rather than stating that databases can permanently choose only two properties. Architectural decisions must therefore be based on specific workload and failure assumptions.
Databases underpin applications, websites, financial systems, healthcare systems, content platforms, inventory systems, operating systems, analytics infrastructure, and countless other services. They differ from Data Warehouses primarily in workload orientation: operational databases generally support application transactions, whereas warehouses are optimised for analytical workloads, although modern systems increasingly overlap. Data Lakes and Data Lakehouses provide alternative or complementary approaches for large-scale analytical storage. Data Engineering connects databases to other systems through ingestion and transformation pipelines, while Data Analytics and Data Science consume database data for analysis. Understanding database models, schemas, transactions, constraints, indexing, concurrency, security, and recovery is therefore fundamental to understanding how modern information systems store and use persistent data.