[ROOT] / doc / toc / ARCCore / Enum / ARConcepts / MemoryConsumption


A naïve implementation of key-value storages like AgoRapide may lead to excessive memory (RAM) consumption.

AgoRapide has been designed in order to be easy to start with, but still with inbuilt flexibility to reduce memory consumption as your database grows and your application matures.

CoreDB will mostly store data on disk and have little need for RAM. Sidenote: Although the PropertyStream-format is somewhat verbose it is well suited for on-disk compression.

ArmDB / Client using PRich is more sensitive to RAM but you have a great flexibility in how much data they actually have to subscribe to.

This is because the implementations of IP in ARCCore are chosen dynamically according to need.
See for instance use of the PValue<T> class, which will be dynamically replaced with a PRich instance if a need for storing meta-data like Cid, Created or similar arises.

Example: If the PropertyStream contains the following:

Customer/42/FirstName = John
Customer/42/FirstName.Cid = Agent/42 // Creator id (entity which created this property). See Cid
...
Customer/42/FirstName.Valid = 2021-02-10 // Timestamp when property was last known to be (still) valid. See Valid

then a full subscription to the customer-object like '+dt/Customer/*' would initially result in a PValue<T> object being created by TryStore, then it would be replaced with a PRich in order to also stored metadata Cid and Valid.

However, if a Subscription does not include any of this meta-data, like '+dt/Customer/*/FirstName', '+dt/Customer/*/LastNamethen only a PValue<T> instance will be created at the subscriber side, because the metadata will not be received.
This means that single nodes in the system can have reduced memory consumption just by judiciously chosing what data is subscribed to.

NOTE: You can use the memory efficient PExact<TEnumType> class
NOTE: as basis for your 'entity' classes when you know exactly what you want to store in them and
NOTE: when you do not need to store any meta-data like Cid and Created.

See ARCDoc, especially classes Apple, Orange and Banana for different compromises between memory usage and easy of development.

See also Indexing.


Details

Generated 2024-11-14 16:25:43.814 UTC