A database server is a computer system or software service that stores, organises, manages and provides controlled access to structured or otherwise managed data for client applications and users over a network or local interface. The term can refer either to the physical or virtual machine running the database management system or, more precisely, to the database-management software providing the service.
Examples of database-management systems include relational systems such as PostgreSQL, MySQL, MariaDB, Microsoft SQL Server and Oracle Database, as well as non-relational systems designed around document, key-value, column-family or graph models. The database server accepts queries and data-manipulation requests, executes them according to the database engine's rules, returns results and manages persistent storage, concurrency, transactions, indexing, recovery and security. Its purpose is substantially more specialised than merely storing files containing data.
Relational database servers organise information primarily into tables consisting of rows and columns and commonly use SQL, the Structured Query Language, for querying and modifying data. A relational database can define schemas, primary keys, foreign keys, constraints, indexes and relationships between tables. For example, an online shop might maintain customers, products, orders and order items as related tables, with foreign keys establishing relationships between them. SQL queries can join those tables, filter records, aggregate values and sort results.
Other database models use different structures and query mechanisms. Document databases commonly store JSON-like documents, key-value databases associate keys with values, graph databases represent entities and relationships as nodes and edges, and column-family systems organise data for particular large-scale access patterns. The choice of database model depends on data structure, consistency requirements, query patterns and operational needs.
A database server is responsible for much more than retrieving stored records. A database-management system maintains indexes to accelerate queries, parses and plans queries, manages memory buffers, controls concurrent access and writes changes to durable storage. Query optimisation can select different execution strategies depending on available indexes, statistics and estimated costs. Transactions provide controlled units of work, commonly associated with the ACID properties of atomicity, consistency, isolation and durability in relational systems.
Atomicity means a transaction is treated as a unit; consistency concerns preservation of defined data rules; isolation controls interactions among concurrent transactions; durability means committed changes survive appropriate failures. Implementations vary, and not every database provides identical guarantees, but transaction semantics are central to understanding why a database server is fundamentally different from a basic file store.
Concurrency management allows many users and applications to work with the same database simultaneously. Without appropriate controls, two operations could overwrite each other's changes, read inconsistent intermediate states or produce incorrect results. Database engines use techniques such as locking, multiversion concurrency control, timestamps and transaction isolation levels to regulate these interactions. Isolation levels define how much one transaction can observe the effects of other concurrent transactions, with stronger isolation generally providing stronger consistency at potential performance cost. Deadlocks can occur when transactions wait for resources held by each other, requiring the database engine to detect and resolve them. The database server therefore acts as a coordinated data-management system rather than simply exposing files to clients.
Indexing is another fundamental database-server function. An index is a data structure that allows the database engine to locate records more efficiently for particular query patterns without scanning every row. B-tree indexes are common in relational systems, while hash, bitmap, spatial, full-text and other index types are useful for different workloads. Indexes can dramatically improve read performance but consume storage and impose additional work when records are inserted, updated or deleted.
Database administrators therefore design indexes according to actual queries rather than indiscriminately indexing every column. Query performance also depends on schema design, statistics, execution plans, memory, storage latency, concurrency and application behaviour. A database that is technically powerful can still perform poorly if queries are inefficient or the schema is unsuitable for the workload.
Security mechanisms protect database contents and control what clients can do. Authentication establishes the identity of a connecting user or service, while authorisation determines which databases, tables, rows, columns or operations that identity may access. Database systems can use roles, privileges, encryption in transit, encryption at rest, auditing and other controls. Applications should generally use accounts with only the privileges they require rather than unrestricted administrative credentials.
Parameterised queries and appropriate input handling also reduce the risk of SQL injection when applications construct database queries. Network isolation can prevent direct Internet access to databases, with application servers acting as controlled intermediaries. Security therefore involves the database engine, application, operating system, network and administrative processes rather than one database setting alone.
Availability and recovery are major concerns because databases often contain authoritative business data. Database systems can use backups, write-ahead logging, replication, clustering, point-in-time recovery and failover mechanisms to reduce the impact of hardware failure, software faults or operational mistakes. Replication can provide additional copies of data, but different replication models have different consistency and failover characteristics.
A read replica may handle read workloads while a primary instance accepts writes, although replication lag can mean that recently committed information is temporarily unavailable on the replica. Backups remain important even when replication exists because accidental deletion or corruption can otherwise be propagated to replicas. Recovery procedures should be tested rather than assumed to work merely because backup jobs report success.
A database server differs from a file server because applications normally interact with a database through a database-management protocol and query language rather than directly manipulating arbitrary data files. It differs from an application server because its primary responsibility is persistent data management rather than execution of business logic, although the two commonly work together.
It differs from a cache because databases are generally intended to provide authoritative or durable data, while caches prioritise fast access to data that can often be regenerated or retrieved elsewhere. Modern systems may distribute database functionality across clusters and cloud services, so the database server may no longer correspond to one physical machine. The essential concept remains a managed service that provides structured data storage, querying, concurrency control, durability and controlled access.