JGabrielGruber / mesa

A simple Key Value storage written in Elixir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mesa

Simple Key Value registry built with Elixir

Introduction

Mesa is similar to Redis, but with lot less functionality, it stores buckets->keys->value, it communicates trough Telnet and supports a multi-node setup, where it'll manage the buckets trough different nodes.

Code Structure

The project is composed of a Umbrella project, where it have two apps, the mesa and mesa_server.

Mesa

Mesa App is responsible for managing the buckets, monitoring them and dispatching requests to the correct node. It's composed of four custom modules:

  • Mesa.Supervisor: Runs and monitors the modules:
    • Mesa.BucketSupervisor: A DynamicSupervisor used for each Bucket
    • Mesa.Registry: A GenServer responsible for managing Bucket's names
    • Mesa.Router: Dispatch requests to the appropriate node on the cluster, using the table provided to the Application env; it defaults to the current node only.

MesaServer

MesaServer App is responsible for listening for TCP connections, it's composed of two modules:

  • MesaServer.Application: A Application that runs the MesaServer.Supervisor and manages the modules:
    • MesaServer.TaskSupervisor: Used for running each received connection as a Task
    • Supervisor: Used to run the MesaServer module and listen for requests
  • MesaServer.Command: Parses received telnet lines into commands; running then on Mesa.Router, for creating; and Mesa.Bucket, for getting and modifying.

About

A simple Key Value storage written in Elixir


Languages

Language:Elixir 100.0%