In this lesson, you will learn how to distinguish between traditional client-server architectures and serverless embedded database files.
Moving Beyond the Server
Up until now, our journey has focused on managing database servers—installing services, monitoring buffer pools, and handling global flags. In these systems, the database is a persistent process running on a machine. When your application needs data, it acts as a client, sending a request over a network socket to the server process, which then manages the I/O and returns the result.
An embedded database flips this paradigm. Instead of being a separate process, the database engine is a library linked directly into your application code. There is no background "service" to connect to, no port to listen on, and no network overhead.
Serverless vs. Client-Server
In a client-server architecture (like MySQL), the server process owns the files. If you want to access the data, you must authenticate through the server. In an embedded architecture, the database is simply a file on the disk (e.g., data.db). Your application interacts with the data by invoking function calls within its own address space.
Consider the difference in how you might initialize a connection:
-- Client-Server: Connecting to a remote socket
-- mysql -h 127.0.0.1 -u admin -p
-- Embedded: Opening a local file library
-- db = open_database("my_local_app_data.db");
Because the database lives inside your application, the "Database User Privilege Scoping" we discussed previously works differently. You are not managing users in the database sense; instead, you rely on the file system permissions of the operating system to control who can access the database file. There is no "database administrator" role distinct from the user running the application process.
This paradigm is ideal for mobile apps, IoT devices, or local desktop tools where you need structured storage without the complexity of managing an external server process, open ports, or network latency. You lose the ability to have multiple distinct clients connecting over a network, but you gain extreme performance for local, single-process workloads.
Key Takeaway: While client-server databases manage data as a shared service, embedded databases exist as local library-managed files that run directly within the application's process.