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.
- Implements essential commands:
SET
,GET
,INCR
,KEYS
,PING
,ECHO
. - Optimized key location management, reducing lookup time by 48%.
- Supports Master-Replica synchronization using the
--replicaof
flag. - Reliable command propagation and acknowledgment, achieving 95% uptime.
- Implements Redis-style atomic operations:
MULTI
,EXEC
, andDISCARD
. - Ensures data integrity across multiple concurrent clients.
- Supports Redis Streams with commands like
XADD
,XRANGE
, andXREAD
. - Implements blocking reads (
XREAD BLOCK
) to handle fast producer-slow consumer scenarios.
- Reads and writes RDB files for on-disk storage.
- Ensures consistent state across server restarts.
- Customizable ports, directories, and filenames via CLI arguments.
- Lightweight, modular, and easy to extend.
git clone https://github.com/archief2910/StreamDB.git
cd StreamDB
npm install
node main.js
telnet <SERVER_IP> <PORT>
Example:
telnet 192.168.1.100 6379
Once connected, type and send commands manually.
To connect and manually send commands:
nc <SERVER_IP> <PORT>
Then type commands interactively.
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature
. - Commit your changes:
git commit -m 'Add new feature'
. - Push to your branch:
git push origin feature/your-feature
. - Open a pull request.
StreamDB is open-source under the MIT License. See the LICENSE file for details.
💡 Looking for a backend/database engineer? Feel free to connect! 🚀