Satori
Control over your data doesn’t have to be hard. Satori aims to give the developer superpowers without making it hard.Installing
-
First, download
Linux
Windows
-
Then run satori
Arguments
You can run Satori with multiple arguments, this areMigration
If you already have a database with Mongo, Surreal or any other you can import it into Satorimongo
surreal
or json
.
Mongo format takes objects like this
\n
. This is the standard Mongo export format. Object keys are infered from the default oid
property
Surreal exports are SurrealQL files. All object keys are inferred if there is a key or id property and object type is inferred from the table name.
JSON is a generic format. If you work with any other DB just export your data into this format. An array of json objects
key
or id
.
If key must be inferred from any other field specify it with the -k
arg
-k
is present it will be used as key, if not, a random uuid will be asigned. There is also a -t
parameter to set the class that works just the same as the -k
parameter
CLI
When you install satori you also install Satori’s CLI, runCLI quickstart
Objects
Objects are the only data type in Satori and these are polymorphic, these can be a node, a JSON object, a string entry or all at once. Satori allows interactions among objects without caring about their kind. All functions are avaible to all Objects. All objects have the following fields and they must be specified when an object is created (only if you’re working directly with websockets and not with the sdks)A key for accessing the object, if not provied, an uuid will be generated
This is the body that will be associated to your key, this can be anything you want
This array relates your object with other nodes, relations can be keys to object or just strings with any other meaning.
This is used to order your data by classes like users, posts, etc…
If the objects expires it must be set to true
The time in milliseconds that the object must live
Operations
Operations or commands are the querys you make to the database, these are simple commands such asSET, GET, PUT, DELETE
. Data operations modify the objects in the database and system operations modify the behavior of the system. To make a request you must
1
Connect to Satori via websocket
2
Send the request
The request must be a JSON object and have:and
The operation you want to execute
...request specific parameters such as (key, encryption_key, etc...)
field_array
field, objects must match all the criteria in the field_array, example:
[{field: "status", value: "unpaid"}]
will return all objects that in their data have the field status
as unpaid
Users
When authentication is enabled, users are the only ones who can access the database, they can have roles that limit their capacity to access and modify the data, all users must have:R || W || RW
References
References are strings that point to an specific object, an example of this is an email that points to an usertest@gmail.com -> Object(test_username)
Network Password
Is encouraged to set a network password in order to ensure a secure communication among all nodes without security flaws. All nodes in the same network must have the same network password, read all about descentralization belowDescentralization
Lear how you can scale satori horizontally without effort
Memory balancing
Satori can take up a lot of your computer’s RAM, so, to fix that, Satori has a built-in memory balancing system that frees up memory when it has reached a critical point, because of that, satori stores objects as separatejson
files inside the db
folder, this allows for faster reads whenever an object is not in memory because of memory saving matters.
HyperCache
HyperCache technollogy allows to make all of Satori’s querys inlogN
time even when you’re filtering by custom paramaters with field_array. This consumes more memory than a normal execution of Satori so use it with caution. To activate HyperCache just run