Skip to content

StreamDB is a Redis-inspired database server in Node.js, achieving 95% uptime with replication, and real-time stream processing for high-performance applications.

Notifications You must be signed in to change notification settings

archief2910/StreamDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 StreamDB – A Custom Redis Server in Node.js

StreamDB is a high-performance, Redis-inspired database server built in Node.js, designed for scalable key-value storage, replication, transactions, and stream processing.

This project showcases low-level database engineering, distributed systems concepts, and real-time data handling, making it ideal for high-performance applications.


⚡ Key Features

Core Redis-Like Commands

  • Implements essential commands: SET, GET, INCR, KEYS, PING, ECHO.
  • Optimized key location management, reducing lookup time by 48%.

🔄 Replication for High Availability

  • Supports Master-Replica synchronization using the --replicaof flag.
  • Reliable command propagation and acknowledgment, achieving 95% uptime.

📌 Transactions & Atomicity

  • Implements Redis-style atomic operations: MULTI, EXEC, and DISCARD.
  • Ensures data integrity across multiple concurrent clients.

📊 Real-Time Stream Processing

  • Supports Redis Streams with commands like XADD, XRANGE, and XREAD.
  • Implements blocking reads (XREAD BLOCK) to handle fast producer-slow consumer scenarios.

💾 Persistence & Data Durability

  • Reads and writes RDB files for on-disk storage.
  • Ensures consistent state across server restarts.

⚙️ Highly Configurable

  • Customizable ports, directories, and filenames via CLI arguments.
  • Lightweight, modular, and easy to extend.

🛠 Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/archief2910/StreamDB.git
cd StreamDB

2️⃣ Install Dependencies

npm install

3️⃣ Start the StreamDB Server

node main.js

📡 Sending Commands to StreamDB via CLI

1️⃣ Using Telnet

telnet <SERVER_IP> <PORT>

Example:

telnet 192.168.1.100 6379

Once connected, type and send commands manually.

2️⃣ Using Netcat (nc)

To connect and manually send commands:

nc <SERVER_IP> <PORT>

Then type commands interactively.


🤝 Contributing

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature/your-feature.
  3. Commit your changes: git commit -m 'Add new feature'.
  4. Push to your branch: git push origin feature/your-feature.
  5. Open a pull request.

📜 License

StreamDB is open-source under the MIT License. See the LICENSE file for details.


💡 Looking for a backend/database engineer? Feel free to connect! 🚀

About

StreamDB is a Redis-inspired database server in Node.js, achieving 95% uptime with replication, and real-time stream processing for high-performance applications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •