An open-source, insanely-fast, in-memory database built with Go
Orion is a high-performance, in-memory key-value database designed for ultra-fast data access and manipulation. Whether you're building real-time applications, caching layers, or need rapid data processing, Orion is engineered to handle it with elegance and speed.
โ ๏ธ Note: Orion is currently in active development as part of Buildspace S5. Expect frequent updates, rapid improvements, and exciting new features.
Feature | Status | Description |
---|---|---|
In-memory KV Store | โ | Lightning-fast key-value operations |
Strings | โ | Full string manipulation support |
Sets | โ | Efficient set operations and manipulations |
Persistence (AOF) | โ | Append-only file for data durability |
TTL Support | โ | Automatic key expiration |
CLI Client (Hunter) | โ | Interactive command-line interface |
Custom Protocol (ORSP) | โ | Optimized binary/text serialization |
Enhanced Logging | โ | Error, Command logging for Server |
Feature | Status | Description |
---|---|---|
Command Autocomplete | โ | Tab completion with case-insensitive match |
Command History | โ | Persistent history navigation |
Background Saves | โ | Non-blocking snapshots |
AOF Rewriting | โ | Log compaction with background safety |
Server Monitoring | โ | Real-time statistics and metrics |
Feature | Status | ETA | Priority |
---|---|---|---|
Sorted Sets | ๐ | Q1 2025 | High |
Hash Maps | ๐ | Q1 2025 | High |
Pub/Sub | ๐ | Q2 2025 | Medium |
Transactions | ๐ | Q2 2025 | Medium |
Streams | ๐ | Q2 2025 | Medium |
Clustering | ๐ | Q2 2025 | High |
Authentication | ๐ | Q2 2025 | Medium |
LRU Eviction | ๐ | Q2 2025 | Medium |
HyperLogLogs | ๐ | Q3 2025 | Low |
Bitmaps | ๐ | Q3 2025 | Low |
Vector Support | ๐ | Q4 2025 | Low |
Geo-spatial Data | ๐ | Q4 2025 | Low |
- Go 1.22 or higher installed
- Basic familiarity with terminal/CLI
git clone https://github.com/exprays/orion.git
cd orion
go mod tidy
Download the latest binary from the GitHub Releases.
cd cmd/server
go run orion.go --port=6379
# Or just go run orion.go which starts the server in default port 6379
cd cmd/hunter
go run hunter.go
# Select dev for default port
# Select custom for custom port
Press
CTRL+C
to exit the client.
# String Operations
orion> SET user:1 "John Doe"
OK
orion> GET user:1
"John Doe"
orion> APPEND user:1 " - Engineer"
(integer) 19
# Set Operations
orion> SADD languages go python rust
(integer) 3
orion> SMEMBERS languages
1) "go"
2) "python"
3) "rust"
# TTL Operations
orion> SET session:abc123 "active" EX 3600
OK
orion> TTL session:abc123
(integer) 3599
# Command autocomplete (press TAB)
orion> s<TAB>
SADD SCARD SDIFF SDIFFSTORE SET SISMEMBER SMEMBERS SMOVE SPOP SRANDMEMBER SREM SUNION SUNIONSTORE
# Command history (use โ/โ arrows)
orion> <UP ARROW> # Shows previous command
# Server information
orion> INFO
# Server
uptime_in_seconds:120
uptime_in_days:0
# Memory
used_memory:1048576
used_memory_human:1.0 MB
# Keyspace
db0:keys=5
- Use
<TAB>
for suggestions - Use
โ / โ
arrows to navigate command history
Operation | Ops/sec | Avg Latency | P99 Latency |
---|---|---|---|
SET | 180,000 | 0.05ms | 0.2ms |
GET | 220,000 | 0.04ms | 0.15ms |
SADD | 150,000 | 0.06ms | 0.25ms |
SMEMBERS | 90,000 | 0.1ms | 0.4ms |
Memory Usage:
- Startup: ~8MB
- Per Key: ~64 bytes
- Per Set Member: ~32 bytes
- AOF File: ~40% of total data size
SET Operation (10M)
Database | Ops/sec | Memory Usage |
---|---|---|
Orion | 180,000 | 245MB |
Redis | 165,000 | 280MB |
KeyDB | 170,000 | 260MB |
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Hunter CLI โโโโโถ โ ORSP Protocolโโโโโถโ Orion Server โ
โ (Client App) โ โ (Serializer) โ โ (Database) โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโ
โ Data Store โ
โ โโโโโโโโโโโโโโโโโ โ
โ โ KV Store โ |
| | Set Store | |
| | TTL Store | |
โ โโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโ
โ Persistence โ
โ โโโโโโโโโโโโโโโโโ โ
โ โ AOF Writer โ โ
| | Snapshots | |
โ โโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโ
The ORSP (Orion Serialization Protocol) types and their corresponding Go type representations.
ORSP Type Symbol | ORSP Name | Go Type | Description |
---|---|---|---|
+ |
Simple String | SimpleStringValue |
Represents simple text response (e.g., +OK\r\n ) |
- |
Error | ErrorValue |
Represents an error message (e.g., -ERR something went wrong\r\n ) |
: |
Integer | IntegerValue |
Represents integer values (e.g., :123\r\n ) |
$ |
Bulk String | BulkStringValue |
Represents strings with length prefix (e.g., $6\r\nfoobar\r\n ) |
* |
Array | ArrayValue |
Represents an array of ORSP values |
_ |
Null | NullValue |
Represents a null value |
# |
Boolean | BooleanValue |
Represents a boolean (#t\r\n or #f\r\n ) |
, |
Double | DoubleValue |
Represents a double-precision float |
( |
Big Number | BigNumberValue |
Represents large integers using math/big.Int |
! |
Bulk Error | BulkErrorValue |
Contains structured error with code and message |
= |
Verbatim String | VerbatimStringValue |
Format-qualified string (e.g., =txt:Hello World\r\n ) |
% |
Map | MapValue |
Key-value mapping, keys must be simple strings |
~ |
Set | SetValue |
Unordered collection of unique elements |
> |
Push | PushValue |
Push-type message with kind and data array |
Each type supports a Marshal()
method to serialize the value to ORSP-compliant wire format, and a corresponding unmarshal function to deserialize from a stream.
|
This project is licensed under the MIT License - see the LICENSE file for details. MIT ยฉ exprays
- Built with โค๏ธ by Surya A.K.A exprays
- Part of Buildspace S5 cohort
- Inspired by Redis and modern in-memory databases
- Special thanks to the Go community
- Documentation: orion.thestarsociety.tech
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Instagram: @suryakantsubudhi