In-Memory Region-wide Datastore
Nexii Malthus
What I want is a region-wide datastore, a very simple API like llLinksetData*. It is not required to be persistent -- scripters could reinitialise it on region restarts. It's ok if it's attached to an object (and therefore acts like a remote llLinksetData). It needs to support high read and high write usage and be synchronous.
The usecase is for sharing data between objects at a higher level of abstraction. For example large region projects like games, weather systems, procedural life like pedestrians and cars / NPCs, etc.
For example a game would often need to share a lot of data between scripted objects, such as vehicles, players, interactive objects, HUDs and temp attach objects. This often means the data also needs to shared across different objects of different ownership or active group settings securely. The security should be tied to a "project" (RSA keys, passwords and/or pins) or even experience compiled scripts.
If the datastore is tied to an object or an avatar maybe all you need to know is the objects or avatar key and a script compiled to an experience to access and read from that region-wide datastore tied to that object or avatar. (E.g. like having a "mana" resource on an avatar and being able to actively manipulate that resource for passive mana regeneration or active/maintained spells from rezzed objects, HUDs or across multiple attachments, e.g. a wand that casts spells which drains the mana and a hud that shows current mana and has passive mana regen)
Sometimes higher level of abstractions are needed for projects, such as a game manager that controls the overall state of a game and information such as who the players are and on what team they are / what teams there are, as well as objectives and resources.
You should be able to make many of these region-wide datastores as you need in a project. Maybe several game managers/directors. Maybe one per avatar. Maybe one per major game object. Same limit of 128KB of LSD per datastore would be fine.
Note that Experience Persistent Storage completely fails the above criteria:
- It's not high write / high read (I think it would be a bad idea to massively spam exp storage with fast timer reads to make sure to show an updated value on a HUD; What about small constantly changing updates like position, acceleration that may need to update at a very high frequency and be read immediately?)
- It is not fast / synchronous (how am I supposed to read/write a resource changing at milliseconds by multiple objects in a realtime game? Exp would keep accidentally overwriting values at critical moments as realtime games have action happen in bursts)
- It is an external server instead of in-memory (there is no reason for this complexity, latency and storage, I just wanted to share critical data (0.5-128KB) between objects in the same region or at least direct neighbouring regions/estate)
Nice to have:
- Datastore being able to optionally/opt-in work cross-region or Estate-level / direct neighbours or 1-2 regions away, e.g. 3 regions in a line or a 2x2 square, just like how some data can be shared across region borders like llGetObjectDetails. This also avoids users having to create overly complicated/engineered systems of scripts to synchronise data between regions if they are all part of the same game/experience
Log In