Accessing external databases
The predominant architecture for storing an application’s data and state is the client/server model. In this model, a database engine server/cluster handles all the data storage, connectivity and query capabilities, and multiple clients use a protocol to communicate with the server and wait for the results of their operations. Database servers usually have several techniques for minimizing wait times, but with large datasets or with untuned queries the waiting or data transfer times can be long. This is a perfect scenario in which to develop database drivers (connectors) that optimize the client’s resources by not blocking the execution process/thread/coroutine over those time windows. Figure 8.2 illustrates this model:

Figure 8.2: Client/Server database engines
The diagram shows two types of application, one that directly opens connections to the database engine, just as in the previous section where we worked directly with...