https://github.com/odudek/go-aris
Simple in-memory database developed in Go, compatible with the Redis protocol. It offers similar functionalities to Redis, allowing easy integration into applications requiring efficient in-memory data handling.
https://github.com/odudek/go-aris
database db golang in-memory inmemory
Last synced: 3 months ago
JSON representation
Simple in-memory database developed in Go, compatible with the Redis protocol. It offers similar functionalities to Redis, allowing easy integration into applications requiring efficient in-memory data handling.
- Host: GitHub
- URL: https://github.com/odudek/go-aris
- Owner: ODudek
- License: mit
- Created: 2023-12-13T14:30:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-08-27T10:16:53.000Z (3 months ago)
- Last Synced: 2025-09-06T13:56:18.500Z (3 months ago)
- Topics: database, db, golang, in-memory, inmemory
- Language: Go
- Homepage:
- Size: 56.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Aris

[](https://opensource.org/licenses/MIT)
[](https://goreportcard.com/report/github.com/ODudek/go-aris)
Aris is a simple in-memory database fully compatible with the Redis protocol, written in Go. It implements the Redis Serialization Protocol (RESP) for client-server communication.
## Features
- ✅ RESP (Redis Serialization Protocol) parsing
- ✅ High-performance gnet-based server
- ✅ Standard Go net server fallback
- ✅ Redis commands: SET, GET, PING, HSET, HGET, HGETALL
- ✅ Thread-safe in-memory storage
- ✅ Concurrent client connections
- 🔲 Data persistence
- 🔲 Additional Redis commands
- 🔲 Pub/Sub support
## Quick Start
### Installation
```bash
git clone https://github.com/ODudek/go-aris.git
cd go-aris
go build .
```
### Running the Server
#### With gnet (high performance - default)
```bash
go run .
# or explicitly
go run . -gnet=true -port=:8089
```
#### With standard Go net (fallback)
```bash
go run . -gnet=false -port=:8089
```
The server will start on port `8089` and accept Redis-compatible commands.
### Testing with Redis CLI
```bash
redis-cli -p 8089
```
## Development
### Prerequisites
- Go 1.20 or higher
### Running Tests
```bash
go test ./...
```
### Building
```bash
go build .
```
## Project Structure
```
.
├── main.go # Application entry point
├── server/ # Server implementations
│ ├── handler.go # Server interface and config
│ ├── gnet_server.go # High-performance gnet server
│ └── standard_server.go # Standard Go net server
├── commands/ # Redis command handlers
│ ├── command.go # Command interface
│ ├── parser.go # Command parsing logic
│ ├── ping.go # PING command
│ ├── set.go # SET command
│ ├── get.go # GET command
│ ├── hset.go # HSET command
│ ├── hget.go # HGET command
│ └── hgetall.go # HGETALL command
├── storage/ # In-memory storage
│ └── storage.go # Thread-safe storage implementation
└── resp/ # Redis Serialization Protocol
├── reader.go # RESP message parsing
├── writer.go # RESP message formatting
└── *.go # RESP data types (str, int, bulk, array, null, err)
```
## Contributing
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## Performance
Aris uses [gnet](https://github.com/panjf2000/gnet) by default for exceptional performance:
- **Event-driven architecture** - No goroutines per connection overhead
- **Multi-core support** - Scales across CPU cores
- **Memory efficient** - Lower memory footprint than standard net
- **High throughput** - Handles thousands of concurrent connections
You can switch to standard Go net server using `-gnet=false` for compatibility.
## Roadmap
- [x] Implement handlers for SET, GET, PING, HSET, HGET, HGETALL commands
- [x] Implement thread-safe in-memory storage
- [x] Support concurrent client connections
- [x] High-performance server with gnet
- [ ] Add data persistence to file
- [ ] Add more Redis commands (DEL, EXISTS, EXPIRE, etc.)
- [ ] Add comprehensive test coverage
- [ ] Add Docker support
- [ ] Performance benchmarking vs Redis
- [ ] Pub/Sub support
- [ ] Clustering support
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.