This is a follow-up post from Building redis with CodeCrafters.
When I first started the redis challenge, I did the quick and dirty way of bypassing the redis serialisation protocol in order to make things work.
Redis serialisation protocol implementation
It was a great exercise that puts recursion into practice. Working with raw bytes is much more performant than converting them to string every time.
Integrate redis serialisation protocol
Next up is to integrate the parser with the codebase. There was quite a bit of code because the older method of parsing input is totally different from this new implementation.
This shows the importance of having a clean interface before writing code. The underlying implementation may change, but a big rewrite will be avoided as long as the interface is robust. However, in this case the interface of these two methods are completely different, resulting in a breaking change in the parser.
Finally, examples of usage are updated to be clearer and user friendly
Check it out here.