Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sumanjitsg/redistil
A minimalist Redis re-implementation in Elm, bringing the power of functional programming to Redis interactions.
https://github.com/sumanjitsg/redistil
database elm functional-programming redis
Last synced: about 1 month ago
JSON representation
A minimalist Redis re-implementation in Elm, bringing the power of functional programming to Redis interactions.
- Host: GitHub
- URL: https://github.com/sumanjitsg/redistil
- Owner: sumanjitsg
- License: gpl-3.0
- Created: 2024-02-11T10:26:34.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-04-29T16:05:05.000Z (7 months ago)
- Last Synced: 2024-09-30T05:07:10.464Z (about 2 months ago)
- Topics: database, elm, functional-programming, redis
- Language: Elm
- Homepage: https://www.npmjs.com/package/@sumanjitsg/redistil
- Size: 151 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Redistil
A minimalist Redis re-implementation in Elm, bringing the power of functional programming to Redis interactions.
## Why Redistil with Elm?
- **Functional Purity**: Elm's guarantees of immutable data and no side effects promote predictable code, making it easier to reason about Redis interactions and maintain the database's state.
- **Type Safety**: Elm's robust type system helps catch potential Redis protocol errors at compile time, preventing a range of runtime issues.
- **Elegant Command Handling**: Elm functions naturally model Redis commands, enhancing code readability and composability.
- **Learning Experience**: This project offers a unique way to understand the synergy between functional programming and database design principles.## Features
- **RESP Parsing**: Accurate decoding and encoding of the Redis Serialization Protocol.
- **Command Processing**: Handles Redis commands, currently supporting PING with more to come.
- **Error Handling**: Handles RESP protocol errors returned by Redis (e.g., responses for unknown commands or invalid arguments).
- **Concurrent Connections**: Supports managing multiple Redis connections simultaneously.## Quick Start
### Prerequisites
- Linux based environment
- Node.js v20 or later
- [Redis CLI](https://redis.io/docs/latest/develop/connect/cli/) (`sudo apt install redis-tools`)### Install and Run
Install from npm:
```bash
npm install @sumanjitsg/redistil
```Run server:
```bash
redistil-server
```Connect to the server from another terminal and run supported commands (currently `PING`):
```bash
redis-cli -p 5379
127.0.0.1:5379> ping
PONG
127.0.0.1:5379> png hello
(error) ERR unknown command 'png', with args beginning with: 'hello'
127.0.0.1:5379> ping hello
"hello"
127.0.0.1:5379> ping hello redistil
(error) ERR wrong number of arguments for 'ping' command
127.0.0.1:5379> ping 'hello redistil'
"hello redistil"
```