失效链接处理 |
Database_Internals_Alex_Petrov PDF 下载
本站整理下载:
相关截图:
主要内容:
The primary job of any database management system is reliably storing
data and making it available for users. We use databases as a primary
source of data, helping us to share it between the different parts of our
applications. Instead of finding a way to store and retrieve information
and inventing a new way to organize data every time we create a new
app, we use databases. This way we can concentrate on application logic
instead of infrastructure.
Since the term database management system (DBMS) is quite bulky,
throughout this book we use more compact terms, database system and
database, to refer to the same concept.
Databases are modular systems and consist of multiple parts: a transport
layer accepting requests, a query processor determining the most
efficient way to run queries, an execution engine carrying out the
operations, and a storage engine (see “DBMS Architecture”).
The storage engine (or database engine) is a software component of a
database management system responsible for storing, retrieving, and
managing data in memory and on disk, designed to capture a persistent,
long-term memory of each node [REED78]. While databases can
respond to complex queries, storage engines look at the data more
granularly and offer a simple data manipulation API, allowing users to
create, update, delete, and retrieve records. One way to look at this is that
database management systems are applications built on top of storage
engines, offering a schema, a query language, indexing, transactions, and
many other useful features.
For flexibility, both keys and values can be arbitrary sequences of bytes
with no prescribed form. Their sorting and representation semantics are
defined in higher-level subsystems. For example, you can use int32 (32-
bit integer) as a key in one of the tables, and ascii (ASCII string) in the
other; from the storage engine perspective both keys are just serialized
entries.
Storage engines such as BerkeleyDB, LevelDB and its descendant
RocksDB, LMDB and its descendant libmdbx, Sophia, HaloDB, and
many others were developed independently from the database
management systems they’re now embedded into. Using pluggable
storage engines has enabled database developers to bootstrap database
systems using existing storage engines, and concentrate on the other
subsystems.
At the same time, clear separation between database system components
opens up an opportunity to switch between different engines, potentially
better suited for particular use cases. For example, MySQL, a popular
database management system, has several storage engines, including
InnoDB, MyISAM, and RocksDB (in the MyRocks distribution).
MongoDB allows switching between WiredTiger, In-Memory, and the
(now-deprecated) MMAPv1 storage engines
|