shikhar1est/Redis-Scratch ? reverse-engineered prompt
Reverse engineered prompt
Build me a tiny Redis like key value store in C++ that runs as a TCP server and a simple command line client to talk to it.
The server should handle many clients on one thread using a nonblocking event loop, and it should read and write raw socket data carefully since TCP is just a byte stream. Please use a simple custom length prefixed binary protocol so the client can send commands like set, get, and del, and the server can parse multiple requests in a row if they arrive together. Keep the data in memory with a custom hashtable instead of using unordered_map, and make the whole thing feel like a small Redis clone built from scratch.
I want it to be easy to build and run on Linux or Unix, with clear example commands in the README. If you need to look up current docs for socket or poll behavior, go ahead and do that.
Are you gonna build this?
make sure you review the code using coderabbit