What Is a Database
Time to read: 14 minutes

A database (sometimes abbreviated as DB) is a software system that organizes, stores, and manages data according to a specific data model. It provides applications with efficient data read/write, query, and transaction processing capabilities. Databases are a core component of modern information infrastructure, and almost all business applications rely on them to persistently store and access data.

Why Databases Matter

In day-to-day enterprise operations, service systems need to record and process large amounts of information, such as customer profiles, transaction records, and inventory data. In the early days of computing, this data was typically stored in file systems, with applications responsible for managing data reads, writes, and formats.

As data volumes and concurrent access increased, however, the limitations of file systems became increasingly apparent. Multiple programs writing to the same file simultaneously could easily cause data conflicts or corruption. Queries often required files to be scanned line by line, resulting in poor efficiency. The lack of centralized security controls and backup mechanisms also increased the risk of data loss. More importantly, when business requirements changed, modifications to data formats often required extensive changes to application code, resulting in high maintenance costs.

Databases were developed to address these challenges. They provide unified data storage and access interfaces, along with built-in mechanisms for concurrency control, transaction management, security, and failure recovery. These capabilities allow multiple users and applications to work safely and efficiently within the same data environment. Databases also significantly reduce the coupling between data storage and applications, allowing applications to focus on business logic without having to handle the complexities of underlying data management.

Advantages
  • Structured storage: Data is organized and stored according to predefined data models, such as tables, documents, and key-value pairs. This provides clear structures and semantics for efficient data retrieval and management.

  • Standardized query interfaces: Databases provide data definition, manipulation, and query capabilities through Structured Query Language (SQL), SQL-like languages, custom query languages, or APIs. Standard SQL is widely supported by relational databases, improving application portability across different database systems and reducing dependence on a specific vendor.

  • Transaction guarantees: Databases provide atomicity, consistency, isolation, and durability (ACID) transaction mechanisms to ensure that a multi-step operation either completes successfully or is rolled back entirely, thereby maintaining data consistency and integrity.

  • Concurrency control: Mechanisms such as locking and multi-version concurrency control (MVCC) allow multiple users to read and write data concurrently while maintaining data correctness under high-concurrency workloads.

  • Security control: Authentication, access control, data encryption, and audit logging help ensure that data can be accessed only by authorized users within their granted permissions.

  • High availability and disaster recovery: Primary/Standby replication, automatic failover, and cross-region disaster recovery help prevent data loss and minimize service interruptions caused by hardware failures or natural disasters.

  • Data integrity assurance: Primary key, foreign key, unique, and check constraints ensure that data complies with predefined rules when it is written. These rules are enforced by the database engine instead of relying solely on application code.

Use Cases
  • Use case 1: online transaction processing (OLTP)

    Core transaction systems in industries such as banking, e-commerce, and ticketing need to process large volumes of online transaction requests. In these scenarios, databases handle highly concurrent transactional operations such as creating orders, deducting inventory, and transferring funds. The database engine uses ACID transaction properties to ensure the atomicity and consistency of each transaction: either all operations succeed or all operations are rolled back. With appropriate index design and query optimization, OLTP databases can support tens of thousands of transaction requests per second under concurrent workloads, helping ensure stable transaction processing.

  • Use case 2: data analysis and reporting

    Enterprises need to extract business insights from transaction data for operational analysis. Data analysts use SQL to perform multidimensional aggregation queries and generate analytical outputs such as sales reports, user behavior analyses, and inventory turnover rates. For large data volumes, massively parallel processing (MPP) databases divide a query across multiple compute nodes for parallel execution, significantly reducing the response time of complex queries.

  • Use case 3: content management and enterprise applications

    Enterprise applications such as content management systems (CMSs), enterprise resource planning (ERP) systems, and customer relationship management (CRM) systems rely on databases to store structured business data. Database schema design reflects the entity-relationship model of the business. Core entities, such as customers, orders, and products, are represented as tables, while relationships between these entities can be defined using foreign keys. Applications interact with databases through standardized interfaces such as ODBC and JDBC, enabling data persistence and integration with application logic.

  • Use case 4: IoT and time-series data storage

    IoT devices continuously generate large volumes of time-series data, such as sensor readings, device status information, and environmental parameters. Time-series databases are specifically optimized for these workloads. They use technologies such as column-oriented storage, data compression, and automatic downsampling to reduce storage costs while maintaining efficient data ingestion and range query performance. Continuously collecting and archiving device data provides a foundation for applications such as predictive maintenance and device anomaly detection.

  • Use case 5: caching and high-concurrency acceleration

    In high-concurrency web applications, relational databases can become performance bottlenecks under heavy read and write workloads. In-memory databases store data in memory and use data structures such as hash indexes and skip lists to provide microsecond-level read and write latency. They are commonly deployed as a cache layer in front of relational databases to cache frequently accessed data and reduce query pressure on backend databases.

History

Database technology has evolved from file systems to relational databases and, subsequently, to a diverse range of specialized database technologies.

 

 

The history of databases can be traced back to the 1960s. Initially, data storage relied on file systems, where data structures were tightly coupled with applications, making data sharing and reuse difficult. In 1968, IBM introduced the Information Management System (IMS), a hierarchical database that organized data in a tree structure and was one of the earliest commercial database management systems (DBMSs). Network databases, such as IDS and IDMS, soon followed, offering more flexible network structures. Databases during this period primarily used navigational access, requiring users to manually traverse data structures to retrieve data and resulting in a relatively high barrier to use.

In 1970, IBM researcher E. F. Codd published a landmark paper introducing the relational model, in which data is organized into relations, commonly represented as two-dimensional tables. A key contribution of the relational model was the concept of declarative querying, as exemplified by SQL: Users specify what data they want without specifying how the database should retrieve it. This concept fundamentally changed the direction of database technology. In 1979, Relational Software, later renamed Oracle, released the world's first commercial relational database. Relational database products such as DB2, Sybase, Ingres, and Informix subsequently emerged. In 1986, SQL became an ANSI standard, further accelerating the adoption of relational databases.

From the 1990s through the 2000s, the rapid growth of Internet applications introduced new database requirements. In 1995, MySQL and PostgreSQL were released as open-source databases, significantly lowering the barrier to database adoption and promoting widespread use of the Linux, Apache, MySQL, and PHP/Perl/Python (LAMP) stack. During the same period, specialized database categories such as object-oriented databases and purpose-built data warehouse databases, including Teradata, began to emerge. Relational databases nevertheless remained dominant. Both commercial products such as Oracle and DB2 and open-source products such as MySQL and PostgreSQL continued to expand their functionality and improve performance.

Since the 2010s, the rapid growth of Internet social networks and mobile applications has introduced challenges involving massive data volumes and highly concurrent reads and writes. Traditional relational databases can face challenges with horizontal scaling (scale-out) because ACID consistency requirements can constrain distributed deployments. These requirements contributed to the growth of NoSQL databases. Document databases such as MongoDB, key-value databases such as Redis, graph databases such as Neo4j, and wide-column databases such as Cassandra and HBase are each optimized for specific scenarios. NoSQL is not intended to replace relational databases. Instead, it follows the principle of selecting the appropriate database technology for each workload and has expanded the range of available database categories. At the same time, NewSQL databases such as Google Spanner and TiDB seek to provide horizontal scalability while retaining SQL support and ACID transactions.

Today, database technology has entered a mature era characterized by a diverse ecosystem. Cloud-native databases, such as Huawei Cloud GaussDB, use architectures that decouple storage from compute to support elastic scaling and pay-per-use billing. Hybrid transactional/analytical processing (HTAP) databases reduce the traditional boundary between OLTP and online analytical processing (OLAP) by supporting both transactional and analytical workloads within the same engine. Serverless databases further reduce O&M costs by automatically scaling resources based on workload requirements without requiring users to manage the underlying infrastructure. As database categories continue to expand and technology stacks mature, enterprises can select database technologies more precisely based on factors such as data models, workload patterns, consistency requirements, and scalability requirements.

Key Components

A database system can be divided into four key functional modules: the connection manager, query processor, transaction manager, and storage engine. The connection manager manages client connections and access control. The query processor parses and optimizes SQL statements. The transaction manager ensures the ACID properties of transactions. The storage engine is responsible for persistent data storage and retrieval.

  • Connection manager: manages network connections between clients and the database, including connection establishment, authentication, reuse, and release. It also enforces access control by validating user identities and permissions, ensuring that only authorized users can access the corresponding data.

  • Query processor: receives SQL statements and other requests submitted by clients and performs syntactic parsing, semantic analysis, query optimization, and execution plan generation. The query optimizer is a core component. It selects a lower-cost execution path from multiple alternatives and therefore directly affects query performance.

  • Transaction manager: coordinates transaction commits and rollbacks to ensure transaction atomicity and consistency. It uses write-ahead logging (WAL) to record transaction operations and ensure recoverability after failures. Locking and MVCC provide transaction isolation and help maintain data correctness under concurrent workloads.

  • Storage engine: organizes, stores, and retrieves data on disks and in memory. The storage engine determines physical data storage formats and structures, such as B+ trees and LSM trees, as well as index structures and caching strategies. These mechanisms directly affect read/write performance and storage efficiency.

The four modules work together throughout request processing. The connection manager receives requests and enforces access security. The query processor parses requests and optimizes execution paths. The transaction manager ensures transaction correctness and recoverability, while the storage engine performs data operations. With clearly defined responsibilities and boundaries, these modules interact through standardized interfaces to improve overall system maintainability and scalability.

 

How a Database Works

A database receives SQL statements or API requests submitted by clients. Requests can be initiated through database drivers such as JDBC and ODBC or triggered by scheduled tasks or application events.

A typical request goes through the following key stages:

  1. Connection and authentication: The connection manager receives a client connection request, verifies the user's identity using credentials such as a username, password, or certificate, checks access permissions, and establishes a secure connection.

  2. Request parsing: The query processor performs lexical and syntactic analysis of SQL statements or other requests to generate a syntax tree. It also performs semantic validation, such as checking whether referenced tables and columns exist.

  3. Query optimization: Based on statistics and a cost model, the query optimizer selects a lower-cost execution plan from multiple alternatives. This process may include selecting indexes, determining join order, and choosing parallel execution strategies.

  4. Transaction scheduling: If the operation involves a transaction, the transaction manager assigns a transaction ID, acquires the required locks, and writes a transaction-start record to the WAL.

  5. Data reads and writes: The storage engine performs data reads or writes according to the execution plan. Data pages are first processed in a memory buffer and are subsequently flushed to disk asynchronously by background threads for persistence.

  6. Transaction commit: The transaction manager flushes WAL records to disk to ensure durability, releases locks, and returns the operation result to the client.

These stages follow a logical sequence: authentication for security, parsing for correctness, optimization for efficiency, and execution for results. Authentication ensures secure access. Parsing and optimization ensure that requests are valid and can be executed efficiently. Transaction scheduling and data reads and writes help ensure consistency and recoverability, while the commit phase ensures transaction durability. With write-ahead logging, WAL records are flushed to persistent storage before the corresponding modified data pages, providing a core mechanism for failure recovery. Through this process, SQL statements and other client requests are correctly parsed and efficiently executed, and the resulting data changes are safely persisted. The database returns a result set or operation status indicating success or failure while maintaining data consistency and reliability under concurrent workloads and failure conditions.

 

 

Databases vs. Data Warehouses

Databases and data warehouses are closely related concepts in data analytics. A data warehouse can be regarded as a special-purpose relational database. They have similar architectures, use relational models to manage and store data, support SQL for data manipulation, and include core components such as storage engines and query processors. However, databases and data warehouses differ significantly in their design goals and technical characteristics. A data warehouse relies on database technologies for data storage and querying but is specifically optimized for analytical workloads.

The following table compares databases and data warehouses. In this comparison, the term database primarily refers to a relational database. Non-relational (NoSQL) databases are not directly comparable to data warehouses.

 

Dimension

Database

Data Warehouse

Main Purpose

Transaction processing (OLTP): supports online services

Analytical processing (OLAP): supports business intelligence (BI) and decision-making

Data model

Highly normalized schemas, often using third normal form (3NF), to reduce redundancy

Dimensional modeling, such as star and snowflake schemas, to optimize queries

Read/Write characteristics

Frequent reads and writes, small batches, and low latency

Batch writes, large-scale queries, and throughput-oriented processing

Storage optimization

Row-oriented storage, suitable for frequent row-level operations

Column-oriented storage, suitable for column-based aggregation queries

Historical data

Typically retains only recent data

Retains multiple years of historical data

Data source

Written directly by applications

Integrated from multiple source systems through the extract, transform, and load (ETL) process

 

The differences between databases and data warehouses stem from their different design goals.

  • The primary design goal of a database is to support high-frequency transactional workloads (OLTP), which require low-latency writes, high transaction concurrency, and strong consistency guarantees. As a result, databases typically use row-oriented storage, in which data is organized by row, and highly normalized schemas to reduce update anomalies.

  • The primary design goal of a data warehouse is to support analytical workloads (OLAP), which require efficient scans of large datasets and high-performance aggregation. As a result, data warehouses typically use column-oriented storage, in which data is organized by column, and dimensional models that introduce intentional redundancy to improve analytical query performance.

In production environments, databases typically serve as source systems for online business data, while data warehouses operate as independent analytics platforms. Data warehouses periodically extract data from multiple databases through ETL processes, clean and transform the data, and load it into the warehouse. Together, databases and data warehouses form a source-to-warehouse architecture: databases support stable business operations, while data warehouses provide efficient analytical capabilities. Enterprises typically deploy both to meet different workload requirements.

 

Types of Databases

Databases can be classified by dimensions such as data model, workload type, and deployment model.

 

Dimension

Type

Description

By data model

Relational database (RDBMS)

Data is organized into two-dimensional tables, or relations, and SQL is used for data operations. Relational databases are widely used in scenarios ranging from enterprise core transaction systems to web applications. Typical examples include MySQL, GaussDB, and PostgreSQL.

Non-relational database (NoSQL)

NoSQL databases do not rely on a fixed two-dimensional table structure. Different types of NoSQL databases are optimized for different use cases. For example, key-value databases are suitable for caching, document databases for content management, and graph databases for social networking and recommendation scenarios. Major categories include document databases such as MongoDB, key-value databases such as Redis, wide-column databases such as Cassandra, and graph databases such as Neo4j.

Multi-model database

Multiple data models, such as relational, document, and graph models, are supported within the same database engine. Users can select an appropriate representation based on data characteristics without maintaining multiple database systems.

By workload type

OLTP (transactional) database

OLTP databases are designed for high-frequency online transaction processing, with an emphasis on concurrency and data consistency. Typical examples include MySQL, GaussDB, and PostgreSQL.

OLAP (analytical) database

OLAP databases are designed for large-scale data analytics and complex queries, with an emphasis on query throughput and aggregation performance. A typical example is Data Warehouse Service (DWS).

HTAP (hybrid) database

Both OLTP and OLAP workloads are supported within the same engine. Technologies such as hybrid row/column storage and intelligent routing provide analytical query capabilities while maintaining transaction processing performance.

By deployment model

On-premises deployment

An on-premises database is deployed on servers in an enterprise's own data center. The enterprise has full control over the underlying hardware and software. This deployment model is suitable for industries with stringent data sovereignty requirements, such as finance and government.

Cloud database

A cloud database is delivered as a cloud service, eliminating the need for users to manage the underlying hardware. Cloud databases typically provide capabilities such as elastic scaling (through decoupled storage and compute), automated backups, and one-click disaster recovery.

Hybrid deployment

Some databases are deployed on-premises, typically for core services, while others are deployed in the cloud for innovative services or data analytics. Data synchronization tools enable connectivity and data exchange between on-premises and cloud environments.

How Huawei Cloud Supports Your Database Needs

Huawei Cloud provides a comprehensive portfolio of database products covering relational, NoSQL, cloud-native, and other database architectures. These products address data management requirements across a wide range of business scenarios.

 

  • Relational Databases

    Relational databases organize data into rows and columns and use relationships between tables to support data processing and analysis. The Huawei Cloud relational database portfolio includes GaussDB, TaurusDB, and RDS.

    • GaussDB is Huawei's proprietary, enterprise-grade database that supports centralized and distributed deployments. It delivers high availability with a recovery point objective (RPO) of zero and a recovery time objective (RTO) of less than 10 seconds. A distributed deployment can scale to as many as 1,000 nodes. GaussDB is designed for mission-critical systems in financial services, telecommunications, government, and enterprise sectors. It is highly compatible with Oracle SQL syntax and the broader Oracle application ecosystem.
    • TaurusDB is Huawei's proprietary, enterprise-grade, cloud-native database that delivers high performance and elastic scalability while providing full compatibility with MySQL. It is available in Enterprise Edition.
    • RDS is a cloud-based database service that is reliable, scalable, easy to manage, and immediately ready for use. It supports four database engines: MySQL, PostgreSQL, SQL Server, and MariaDB.
      • RDS for MySQL is fully compatible with native MySQL. It provides reliable operation, high performance, intelligent O&M, advanced security protection, rapid deployment, and elastic scaling.

      • RDS for PostgreSQL is fully compatible with native PostgreSQL and is secure, reliable, and easy to use and manage.

      • RDS for SQL Server is reliable, secure, scalable, cost-effective, and easy to manage. Its high-availability architecture supports recovery within seconds, data protection, and flexible backup options.

      • RDS for MariaDB is highly compatible with MySQL. It is a powerful, high-performance, secure, and reliable database management system suitable for a wide range of applications.

  • NoSQL Databases

    NoSQL databases use a range of data models to store, access, and manage data, including key-value, document, cache, in-memory, time-series, and wide-column models. By relaxing certain consistency constraints, some NoSQL databases can be optimized for applications that require massive data capacity, low latency, or flexible data models. The Huawei Cloud NoSQL database portfolio includes GeminiDB, Document Database Service (DDS), and Distributed Cache Service (DCS).

    • GeminiDB is a distributed, multi-model NoSQL database service built on a decoupled storage and compute architecture. It combines high performance, availability, reliability, security, and elastic scalability with one-click deployment, backup and restoration, monitoring, and alarm reporting. GeminiDB supports mainstream NoSQL database engines, including Redis, DynamoDB, Cassandra, HBase, InfluxDB, and MongoDB. It delivers high I/O performance at low cost and is suitable for use cases in IoT, meteorology, internet services, and gaming.
    • Document Database Service (DDS) is a distributed NoSQL database service compatible with the MongoDB protocol. DDS provides robust security, high availability, high reliability, elastic scaling, and ease of use. It supports one-click deployment, online scaling, disaster recovery, backup and restoration, monitoring, and alarm reporting. DDS can also integrate with third-party components that support the MongoDB protocol, including business intelligence (BI) tools and Spark.
    • Distributed Cache Service (DCS) is a Redis-compatible managed service for cloud caching scenarios. DCS provides a high-speed in-memory data engine and a reliable, scalable, ready-to-use, and easy-to-manage caching service. It is designed for highly concurrent workloads that require rapid data access.
  • Database Tools & Middleware

    Huawei Cloud also provides database tools and middleware, including Data Replication Service (DRS), Data Admin Service (DAS), Database and Application Migration UGO (UGO), and Distributed Database Middleware (DDM).

    • Data Replication Service (DRS) is a cloud service used for online database migration and real-time synchronization. Designed for cloud environments, DRS applies least-privilege access controls and uses an architecture focused on reliability to reduce the complexity and cost of data migration between databases. It supports database migration and synchronization across a wide range of scenarios.
    • Data Admin Service (DAS) is a web-based service for connecting to and managing databases on Huawei Cloud.
      • The Intelligent O&M module provides a one-stop management platform for cloud database development, O&M, and intelligent diagnosis.
      • The Development Tool module makes database management user-friendly, secure, and intelligent. It allows you to perform basic SQL operations, advanced database management, and intelligent O&M through the web console.
    • Database and Application Migration UGO (UGO) is a managed service for heterogeneous database schema migration. UGO automatically converts source-database DDL, DML, and DCL statements, as well as SQL in business applications, into syntax supported by GaussDB or RDS. With pre-migration evaluation, schema migration, and automated syntax conversion, UGO identifies adaptation work early, improves conversion rates, and reduces migration costs.

      For heterogeneous migrations, UGO converts and migrates database schemas, while DRS migrates data online. Together, they provide an end-to-end migration solution. The combined solution automates migration from mainstream commercial databases to Huawei Cloud, simplifying cloud adoption and database platform migration.

    • Distributed Database Middleware (DDM) is a MySQL-compatible, distributed middleware service designed for relational databases. Built on RDS for MySQL instances, DDM provides database and table sharding, read/write splitting, and elastic scaling to overcome the capacity and performance limits of standalone MySQL databases.

Related Products

Related Products