With shared memory access (SMA), multiple applications can be linked to a dynamic driver library that contains the full database server functionality. This means that the applications ODBC or JDBC requests are processed almost fully in the application process space, without a need for a context switch amongprocesses. To facilitate the processing of a common database, the driver has access to a shared memory segment initialized by the server.
The application that is linked to the solidDB® server using the SMA driver is called an SMA application; the server is called SMA server.
SMA server
Before the first application is started with SMA, the solidDB® server is initialized in a SMA mode by starting a small application (solidsma) that loads the SMA driver library dynamically. This SMA server application starts the server code internally and allocates and initializes a shared memory segment that the applications use to access the database.
The SMA server has the full functionality of the network server:
▪The SMA server process takes care of all client-independent tasks: startup and recovery, checkpointing and logging, making backups, and so on.
▪The solidDB® configuration parameters, admin commands, and command-line parameters can be used.
▪Both in-memory and disk-based tables can be accessed equally.
▪The SMA server can be used also with High Availability, and Advanced Replication configurations.
▪The SMA server can also be used as a regular network-connection-based server.
When the server is started in the SMA mode, it accepts connection requests from the SMA driver at the normal listening port. By assigning different port numbers to different SMA servers, it is possible to run several SMA servers on a single system simultaneously.
When the server is shut down, or all the users are thrown out, the applications receive the error Connection lost on the next request. If the application is waiting for a response during a forceful shutdown, it receives a shutdown notification.
The SMA server can be disk-based or diskless. Diskless server can be useful in embedded systems that do not have hard disks, such as line cards in a network router or switch.
The solidDB® data management tools can be used with network-based connections to the SMA server.
SMA application
An existing ODBC or JDBC application does not need to be modified in order to use SMA, with the exception of a data source name or a connect string. For example, in an ODBC application, the connection is requested with the regular ODBC SQLConnect() call.
An existing LLA application can be changed into an SMA application or vice versa. An application can also be changed from a SMA application to a network-based application.
SMA driver
The SMA driver is a dynamic library that contains a complete copy of the solidDB® server in library format. The applications can link to the SMA driver directly or using a driver manager.
The footprint of the driver’s binary file corresponds to the full solidDB® server, which is 3-6 MB, depending on the platform. However, because all applications link to the same driver, the in-memory footprint is not multiplied when additional applications are added. The total memory footprint of the whole application system (applications, drivers, and the server) is comparable to the one of the client-server model.
SMA connection
Once the SMA server is running, applications can establish either SMA or network connections. For SMA connections, the applications have to be located on the same node as the server. The connection type is defined within the connect string. In the case of ODBC applications, if a driver manager is used, the SMA data source can be configured in the same way as an ODBC driver.
The connection request is sent over a network connection (handshake connection) using any locally available protocol (tcpip, named pipes, unix pipes). During the connect handshake, the shared-memory segment handle is passed to the driver so that it can access the server’s shared memory segment.