Astra is a lightweight, tabular database for fast and effective caching of structured data.
(Currently) requires .NET 8 for both client and server.
The motivation behind Astra stems from my need for a cache server that can not only stores and aggregates data but also allows for the conditional deletion of multiple "unit of data". First, I chose Redis for its speed; however, it fell short in fulfilling the latter condition as it could only delete pairs that exactly matched the supplied key.
I then attempted to create a Redis clone that also support regular expressions (which works well for a while), but as the predicates became more complex, it became apparent that a dedicated solution for this very niche problem was needed. The result is Astra, a caching database that supports the insertion, aggregation, and deletion of structured data.
To use Astra in TCP server mode, clone this repo and build Astra.Server
Run the server using the following command
ASTRA_CONFIG_PATH=/path/to/your/config.json ./Astra.Server
Replace the path after ASTRA_CONFIG_PATH
with an appropriate path to the application configs.
Here is an example configuration file:
{
"logLevel": "debug",
"authenticationMethod": "no_authentication",
"timeout": 100000,
"schema": {
"columns": [
{
"name": "col1",
"dataType" : "dword",
"indexer": "btree"
},
{
"name": "col2",
"dataType" : "string",
"indexer": "fuzzy",
"shouldBeHashed": false
},
{
"name": "col3",
"dataType" : "string",
"indexer": "none"
}
]
}
}
logLevel
: The desired level of detail for log messages. Options includetrace
,debug
,info
,warn
,error
andcritical
, indicating the verbosity of log output.timeout
: The maximum time, in milliseconds, that the server will wait for a client to respond during connection setup. If a client doesn't respond within this time, the connection attempt will time out.schema
: The primary definition of the database schema, specifying the structure and characteristics of the stored data. This includes details like column names, data types, and indexing settings.
Astra.Server supports 3 authentication methods:
no_authentication
: No authenticationpassword
: Password authentication using SHA-256public_key
: Public-private key authentication using RSA-1024
There are currently 3 supported data types, with more on the way:
dword
: signed 32-bit integerqword
: signed 64-bit integersingle
: single precision floating point numberdouble
: double precision floating point numberstring
: Variable-length string with a maximum length of2147483647
characters.bytes
: Variable-length byte array with a maximum length of2147483647
bytes.
- Embeddable engine
- TCP server
- Working client
- Client handshaking and authentication (SHA256, RSA)
- Aggregation
- Insertion/Bulk insertion
- Conditional deletion
- Objects mapping via Code Generation
- IQueryable compatible API
- Fuzzy string search supports
- Supports for qword, single and double
- Ranged query
- Strict schema check
- Stream compression
- TLS support
See the benchmark folder
See LICENSE.txt
See Astra.Example