Client Server mode (CS Mode) allows multiple remote connections to a single database.
Client Server Mode is implemented in a different way than local mode.
In CS Mode, the server work only on Layer 2 and Layer 3 while the client works on Layer 1 and Layer 2.
For storing objects
1- The client transforms objects (Layer1) to meta representations (Layer 2) and sends data (in Layer 2 format) to the server.
2- The server transforms data from Layer 2 to Layer 3 (file storage) and returns a response to the client (Ok or Exception)
For retrieving objects
1- The client sends the query to the server.
2- The server loads objects : Layer 3(reads objects) and converts data to Layer 2 (Meta - representation) and sends the data (in Layer 2 format) to the client
3- The client receives data and transforms them into objects (Layer 2 to Layer 1 transformation).
Implementation
Server
- Server implementation :
- org.neodatis.odb.core.serverODBServer ,
- org.neodatis.odb.core.server.ODBServerImpl
- org.neodatis.odb.main.ODBMultiServer,
- Messages between server and clients : package org.neodatis.odb.core.server.message
- Client Connection Manager : org.neodatis.odb.core.server.ConnectionThread
Client
- org.neodatis.odb.main.ClientODB
- org.neodatis.odb.core.server.ClientStorageEngine
Client Server communication
The communication is done by socket.
On the client the org.neodatis.odb.core.server.ClientStorageEngine.sendMessage(Message msg) sends the data to the server.
On the server, org.neodatis.odb.core.server.ODBServerImpl has socket server to manage client connections.
Layer 2 Object Serialization
the class org.neodatis.odb.core.server.MessageStreamer is responsible for Layer 2 object serialization. It is, for instance, implemented using Native Object Serialization.
Layer conversion
Check odb-layers to learn more about layers and conversion.





