ElixirCache is a high-performance, in-memory data store implemented in Elixir. It's designed to provide fast data access and storage capabilities, similar to Redis, with additional features for replication and WebSocket-based interaction.
- In-memory key-value storage
- Support for basic Redis-like commands (SET, GET, INCR, etc.)
- Master-Slave replication
- Stream data structure support (XADD, XRANGE, XREAD)
- WebSocket interface for real-time interaction
- Transaction support (MULTI, EXEC, DISCARD)
- Elixir 1.12 or later
- Erlang/OTP 23 or later
-
Clone the repository:
git clone https://github.com/ProgMastermind/Elixir_Backend.git cd Elixir_Backend -
Build and run the Docker container:
docker-compose up --build
This will start the ElixirCache server, accessible on port 3001.
If you prefer to run ElixirCache without Docker:
-
Clone the repository:
git clone https://github.com/ProgMastermind/Elixir_Backend.git cd Elixir_Backend -
Install dependencies:
mix deps.get -
Compile the project:
mix compile
To start the ElixirCache server:
mix run --no-halt
By default, the server will start on port 6379 for Redis protocol connections and port 3001 for WebSocket connections.
ElixirCache provides a WebSocket interface for real-time interactions. You can connect to:
ws://localhost:3001/ws/masterfor master connectionws://localhost:3001/ws/slavefor slave connection
Send JSON messages in the format:
{
"type": "COMMAND",
"command": "SET mykey myvalue"
}ElixirCache supports master-slave replication. To start a slave instance:
- The server will automatically start a slave when a WebSocket connection is made to the slave endpoint.
- The slave will connect to the master (default: localhost:6379) and sync data.
ElixirCache implements Redis-like streams with commands such as XADD, XRANGE, and XREAD.
Use MULTI to start a transaction, EXEC to execute it, and DISCARD to cancel.
Contributions are welcome! Please feel free to submit a Pull Request.
- Inspired by Redis
- Built with Elixir and love for high-performance data stores
- GitHub: ProgMastermind
- LinkedIn: Prakash Collymorey
- Twitter: @PrakashCollymo1