Object Managers
This documentation page is heavily under construction. Various information may be missing. Please report any feedback here.
Cognibase operates on a core framework of object managers, which serve as the hubs where DataItems are hosted and maintained. These managers can be categorized into two principal types: Server Object Manager (SOM) and Client Object Manager (COM).
One characteristic of an Object Manager is that they keep a consistent state of the Data Items that are cached in them and there is a single instance of each DataItem that is represented by one Data Item Key cached in an Object Manager.
Server Object Manager (SOM)
The SOM acts as the central component in Cognibase's transactional architecture. It is responsible for orchestrating object transactions—first in an in-memory environment, followed by a persistent data store. The primary responsibilities of the SOM are:
-
Reception of Changesets: It collects changesets forwarded by connected clients, readying them for transaction processing.
-
In-Memory Transactions: Before persisting any changes, SOM validates each changeset against the existing object state. After validation, it integrates these changes into the server's in-memory cache.
-
Data Persistence: Once changes are approved and integrated, SOM ensures they are written to a designated data store.
-
Transaction Broadcast: After successfully processing and storing a transaction, the SOM disseminates this transactional information to all connected clients to keep them updated.
To bridge the gap between object-oriented designs and relational databases, SOM is equipped with an integrated Object-Relation Mapping (ORM) engine. This allows it to utilize conventional RDBMS systems, among other storage options, as its primary data repositories.
Client Object Manager (COM)
Residing typically within client applications, the COM is an instrumental component that interfaces directly with the SOM, ensuring smooth data flow and management. The main duties of the COM encompass:
-
Data Retrieval: The COM fetches data items from the SOM through direct read calls, executing queries, or even navigating via associated properties.
-
Change Detection: Any modifications made to the data items or the addition of new items are meticulously tracked by the COM.
-
Sending Transactions: The COM sends these transactions or changesets to the SOM for processing.
-
Transaction Synchronization: The COM actively listens for transaction updates from the SOM, ensuring its internal cache remains in a consistent and synchronized state.
-
Change Validation: It oversees changes to ascertain that all tracked Live Collections and References are correctly updated, including addressing any deletions.
-
Event Notification: For comprehensive tracking, the COM dispatches change events at multiple levels, such as at the instance, type, collection, and client levels, ensuring stakeholders remain informed about every data shift.