Satori

Control over your data doesn’t have to be hard. Satori aims to give the developer superpowers without making it hard.

Installing

  1. First, download

    Linux

    bash -c "$(curl -fsSL https://satoridb.com/linux/setup.sh)"
    

    Windows

    powershell -ExecutionPolicy Bypass -NoProfile -Command "Invoke-WebRequest -Uri 'https://satoridb.com/win/setup.ps1' -OutFile 'setup.ps1'; .\setup.ps1"
    
  2. Then run satori
    satori -a root admin
    

Arguments

You can run Satori with multiple arguments, this are
-l <LICENSE_KEY> //license key for AICore
-port //set the port where satori will be executing (defaults to 2310)
-h //activate hyper cache
-m <host> <port> //connect to a network, example: -m 127.0.0.1 2311
-pwd //set network password
-ai //run satori with ai capabilities (a ~100mb model will be downloaded)
-a <username> <password> //enable authentication and set root user
-mem //use satori as a memory-only database
-t <threshold> //memory threshold at which MEMORY_BALANCE is activated, example: satori -t 80 (memory balancing will be activated at 80% memory consumption)

CLI

When you install satori you also install Satori’s CLI, run
satoridb -h
This way you’ll receive instructions on how to use it.

CLI quickstart

>satoridb connect ws://127.0.0.1 admin root
satori>set user:1 {"email": "test@test.com"}
satori>get user:1
#response

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)
key
string
A key for accessing the object, if not provied, an uuid will be generated
data
string, json, number, any[]
required
This is the body that will be associated to your key, this can be anything you want
vertices
string[]
This array relates your object with other nodes, relations can be keys to object or just strings with any other meaning.
type
string
This is used to order your data by classes like users, posts, etc…
expires
bool
If the objects expires it must be set to true
expiration_time
number
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 as SET, 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:
command
string
required
The operation you want to execute
and ...request specific parameters such as (key, encryption_key, etc...)
You can perform operations on multiple objects that meet certain conditions using the 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:
username
string
required
password
string
permissions
number
R || W || RW

References

References are strings that point to an specific object, an example of this is an email that points to an user test@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 below

Descentralization

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 separate json 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 in logN 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
satori -h

Learn more