Grsaiago / miniredis

This is my miniature version of redis in C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Miniredis

🚨This is a WIP, some sections may describe what I'll do instead of what's already implemented🚨

✨ A miniature version of Redis in C++ ✨
"Why?" you may ask!
Why not? This project aims to improve my understanding of sockets, communication protocols, and OOP concepts.

Socket

Well, let's start from the beginning, shall we?
The sockets used in this project are all TCP/IPV4 SO_NONBLOCK Sockets with SO_REUSEADDR. The main server socket is the Type ATcpIpSocket.
This ensures that:

  • A) Using TCP, we have reliability on the protocol's handshake/ack features.
  • B) By using SO_NONBLOCK, we ensure we can handle multiple connections with poll/epoll.
  • C) By using SO_REUSEADDR we ensure that the same port can be reassigned to another process after the redis turns off, or it can be restarted on the same port if for some reason it closes.
  • D) I'm able to practice OOP concepts in creating the classes for the connections xD

Protocol

Miniredis doesn't implement every type in the Redis Serialization Protocol (RESP), but it supports the following:

  • +: Simple strings.
  • -: Error values.
  • :: Base 10 ints.
  • *: Arrays.
  • $: Bulk Strings.

+: Simple strings

WIP

-: Error values

WIP

:: Base 10 ints

WIP

*: Arrays

WIP

$: Bulk Strings

WIP

About

This is my miniature version of redis in C++

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:C++ 97.9%Language:Makefile 1.5%Language:C 0.6%