{"id":21393644,"url":"https://github.com/exprays/orion","last_synced_at":"2026-05-21T07:43:50.192Z","repository":{"id":244618625,"uuid":"815468661","full_name":"exprays/orion","owner":"exprays","description":"An insanely-fast, in-memory KV database supporting persistence built form scratch","archived":false,"fork":false,"pushed_at":"2024-08-31T18:41:28.000Z","size":6752,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T01:41:35.650Z","etag":null,"topics":["database","golang","goroutines","in-memory-database","vector-database"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exprays.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-15T08:49:31.000Z","updated_at":"2024-08-31T18:41:31.000Z","dependencies_parsed_at":"2024-07-06T17:48:29.616Z","dependency_job_id":"d6e9640d-3518-4aa7-8edf-1d1fdbb08248","html_url":"https://github.com/exprays/orion","commit_stats":null,"previous_names":["exprays/orion"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exprays%2Forion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exprays%2Forion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exprays%2Forion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exprays%2Forion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exprays","download_url":"https://codeload.github.com/exprays/orion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243878491,"owners_count":20362433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","golang","goroutines","in-memory-database","vector-database"],"created_at":"2024-11-22T14:12:48.790Z","updated_at":"2026-05-21T07:43:50.185Z","avatar_url":"https://github.com/exprays.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Orion ![Orion Logo](https://img.shields.io/badge/Orion-Database-blue?style=for-the-badge\u0026logo=database)\n\n\u003e An open-source, insanely-fast, in-memory database built with Go\n\n![Go Version](https://img.shields.io/badge/go-%2300ADD8.svg?style=for-the-badge\u0026logo=go\u0026logoColor=white)\n![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge\u0026logo=docker\u0026logoColor=white)\n![License](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)\n![Build Status](https://img.shields.io/github/actions/workflow/status/exprays/orion/build.yml?branch=main\u0026style=for-the-badge)\n\n---\n\nOrion 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.\n\n\u003e ⚠️ **Note**: Orion is currently in active development as part of Buildspace S5. Expect frequent updates, rapid improvements, and exciting new features.\n\n---\n\n## 📖 Table of Contents\n- [Features](#-features)\n- [Quick Start](#-quick-start)\n- [Usage Examples](#-usage-examples)\n- [Benchmarks](#-benchmarks)\n- [Architecture](#-architecture)\n- [ORSP Protocol](#-orsp-protocol)\n- [Tech Stack](#-tech-stack)\n\n---\n\n## ✨ Features\n\n### 🔥 Core Features\n\n| Feature              | Status | Description                              |\n|----------------------|--------|------------------------------------------|\n| In-memory KV Store   | ✅     | Lightning-fast key-value operations      |\n| Strings              | ✅     | Full string manipulation support         |\n| Sets                 | ✅     | Efficient set operations and manipulations |\n| Persistence (AOF)    | ✅     | Append-only file for data durability     |\n| TTL Support          | ✅     | Automatic key expiration                 |\n| CLI Client (Hunter)  | ✅     | Interactive command-line interface       |\n| Custom Protocol (ORSP)| ✅    | Optimized binary/text serialization      |\n| Enhanced Logging     | ✅     | Error, Command logging for Server        |\n\n### 🎯 Advanced Features\n\n| Feature              | Status | Description                              |\n|----------------------|--------|------------------------------------------|\n| Command Autocomplete | ✅     | Tab completion with case-insensitive match |\n| Command History      | ✅     | Persistent history navigation            |\n| Background Saves     | ✅     | Non-blocking snapshots                   |\n| AOF Rewriting        | ✅     | Log compaction with background safety    |\n| Server Monitoring    | ❌    | Real-time statistics and metrics         |\n\n### 🚧 Coming Soon\n\n| Feature              | Status | ETA      | Priority |\n|----------------------|--------|----------|----------|\n| Sorted Sets          | 🔄     | Q1 2025  | High     |\n| Hash Maps            | 🔄     | Q1 2025  | High     |\n| Pub/Sub              | 📋     | Q2 2025  | Medium   |\n| Transactions         | 📋     | Q2 2025  | Medium   |\n| Streams              | 📋     | Q2 2025  | Medium   |\n| Clustering           | 📋     | Q2 2025  | High     |\n| Authentication       | 📋     | Q2 2025  | Medium   |\n| LRU Eviction         | 📋     | Q2 2025  | Medium   |\n| HyperLogLogs         | 📋     | Q3 2025  | Low      |\n| Bitmaps              | 📋     | Q3 2025  | Low      |\n| Vector Support       | 📋     | Q4 2025  | Low      |\n| Geo-spatial Data     | 📋     | Q4 2025  | Low      |\n\n---\n\n## 🚀 Quick Start\n\n### 🧰 Prerequisites\n- Go 1.22 or higher installed\n- Basic familiarity with terminal/CLI\n\n### 🔧 Installation\n\n#### Option 1: Clone from Source\n\n```bash\ngit clone https://github.com/exprays/orion.git\ncd orion\ngo mod tidy\n```\n\n#### Option 2: Use Prebuilt Binary\n\nDownload the latest binary from the [GitHub Releases](https://github.com/exprays/orion/releases).\n\n---\n\n### 🖥 Running Orion\n\n#### Start the Server\n\n```bash\ncd cmd/server\ngo run orion.go --port=6379\n\n# Or just go run orion.go which starts the server in default port 6379\n```\n\n\n#### Launch the Hunter CLI\n\n```bash\ncd cmd/hunter\ngo run hunter.go\n\n# Select dev for default port \n# Select custom for custom port\n```\n\n\u003e Press `CTRL+C` to exit the client.\n\n---\n\n## 🎮 Usage Examples\n\n### Basic Operations\n\n```bash\n# String Operations\n\norion\u003e SET user:1 \"John Doe\"\nOK\n\norion\u003e GET user:1\n\"John Doe\"\n\norion\u003e APPEND user:1 \" - Engineer\"\n(integer) 19\n\n# Set Operations\n\norion\u003e SADD languages go python rust\n(integer) 3\n\norion\u003e SMEMBERS languages\n1) \"go\"\n2) \"python\"\n3) \"rust\"\n\n# TTL Operations\n\norion\u003e SET session:abc123 \"active\" EX 3600\nOK\n\norion\u003e TTL session:abc123\n(integer) 3599\n\n```\n\n### Advanced Features\n\n```bash\n# Command autocomplete (press TAB)\norion\u003e s\u003cTAB\u003e\nSADD  SCARD  SDIFF  SDIFFSTORE  SET  SISMEMBER  SMEMBERS  SMOVE  SPOP  SRANDMEMBER  SREM  SUNION  SUNIONSTORE\n\n# Command history (use ↑/↓ arrows)\norion\u003e \u003cUP ARROW\u003e  # Shows previous command\n\n# Server information\norion\u003e INFO\n# Server\nuptime_in_seconds:120\nuptime_in_days:0\n# Memory\nused_memory:1048576\nused_memory_human:1.0 MB\n# Keyspace\ndb0:keys=5\n```\n\n### Autocomplete \u0026 History\n\n- Use `\u003cTAB\u003e` for suggestions\n- Use `↑ / ↓` arrows to navigate command history\n\n---\n\n## 📊 Benchmarks\n\n| Operation | Ops/sec | Avg Latency | P99 Latency |\n|----------:|--------:|-------------|-------------|\n| SET       | 180,000 | 0.05ms      | 0.2ms       |\n| GET       | 220,000 | 0.04ms      | 0.15ms      |\n| SADD      | 150,000 | 0.06ms      | 0.25ms      |\n| SMEMBERS  | 90,000  | 0.1ms       | 0.4ms       |\n\n**Memory Usage**:\n- Startup: ~8MB\n- Per Key: ~64 bytes\n- Per Set Member: ~32 bytes\n- AOF File: ~40% of total data size\n\n### Throughput Comparison\n\n**SET Operation (10M)**\n\n| Database | Ops/sec | Memory Usage |\n|----------|---------|--------------|\n| Orion    | 180,000 | 245MB        |\n| Redis    | 165,000 | 280MB        |\n| KeyDB    | 170,000 | 260MB        |\n\n---\n\n## 🧠 Architecture\n\n```text\n┌──────────────┐     ┌──────────────┐     ┌──────────────┐\n│  Hunter CLI  │───▶ │ ORSP Protocol│───▶│ Orion Server │\n│ (Client App) │     │ (Serializer) │     │ (Database)   │\n└──────────────┘     └──────────────┘     └──────────────┘\n                                               │\n                                  ┌────────────────────┐\n                                  │     Data Store     │\n                                  │ ┌───────────────┐  │\n                                  │ │ KV Store      │  |\n                                  | | Set Store     |  |\n                                  | | TTL Store     |  |\n                                  │ └───────────────┘  │\n                                  └────────────────────┘\n                                               │\n                                  ┌────────────────────┐\n                                  │   Persistence      │\n                                  │ ┌───────────────┐  │\n                                  │ │ AOF Writer    │  │\n                                  | | Snapshots     |  |\n                                  │ └───────────────┘  │\n                                  └────────────────────┘\n```\n\n---\n\n# 📦 ORSP Protocol\n\n## 🔄 ORSP Type Symbols and Mappings\n\n The ORSP (Orion Serialization Protocol) types and their corresponding Go type representations.\n\n\n| ORSP Type Symbol | ORSP Name             | Go Type                | Description                                                                 |\n|------------------|-----------------------|------------------------|-----------------------------------------------------------------------------|\n| `+`              | Simple String         | `SimpleStringValue`    | Represents simple text response (e.g., `+OK\\r\\n`)                         |\n| `-`              | Error                 | `ErrorValue`           | Represents an error message (e.g., `-ERR something went wrong\\r\\n`)      |\n| `:`              | Integer               | `IntegerValue`         | Represents integer values (e.g., `:123\\r\\n`)                              |\n| `$`              | Bulk String           | `BulkStringValue`      | Represents strings with length prefix (e.g., `$6\\r\\nfoobar\\r\\n`)       |\n| `*`              | Array                 | `ArrayValue`           | Represents an array of ORSP values                                          |\n| `_`              | Null                  | `NullValue`            | Represents a null value                                                     |\n| `#`              | Boolean               | `BooleanValue`         | Represents a boolean (`#t\\r\\n` or `#f\\r\\n`)                             |\n| `,`              | Double                | `DoubleValue`          | Represents a double-precision float                                         |\n| `(`              | Big Number            | `BigNumberValue`       | Represents large integers using `math/big.Int`                             |\n| `!`              | Bulk Error            | `BulkErrorValue`       | Contains structured error with code and message                            |\n| `=`              | Verbatim String       | `VerbatimStringValue`  | Format-qualified string (e.g., `=txt:Hello World\\r\\n`)                    |\n| `%`              | Map                   | `MapValue`             | Key-value mapping, keys must be simple strings                             |\n| `~`              | Set                   | `SetValue`             | Unordered collection of unique elements                                     |\n| `\u003e`              | Push                  | `PushValue`            | Push-type message with kind and data array                                 |\n\n---\n\nEach type supports a `Marshal()` method to serialize the value to ORSP-compliant wire format, and a corresponding unmarshal function to deserialize from a stream.\n\n                               |\n\n---\n\n\n## 💻 Tech Stack\n\n- ![Go](https://img.shields.io/badge/go-%2300ADD8.svg?style=for-the-badge\u0026logo=go\u0026logoColor=white)\n- ![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge\u0026logo=docker\u0026logoColor=white)\n\n---\n\n## 📜 License\nThis project is licensed under the MIT License - see the LICENSE file for details.\nMIT © [exprays](https://github.com/exprays/orion)\n\n---\n\n## 🙏 Acknowledgments\n- Built with ❤️ by Surya A.K.A exprays\n- Part of Buildspace S5 cohort\n- Inspired by Redis and modern in-memory databases\n- Special thanks to the Go community\n\n## 📞 Support \u0026 Community\n- Documentation: orion.thestarsociety.tech\n- Issues: GitHub Issues\n- Discussions: GitHub Discussions\n- Instagram: @suryakantsubudhi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexprays%2Forion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexprays%2Forion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexprays%2Forion/lists"}