Skip to content
/ go-aris Public

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.

License

Notifications You must be signed in to change notification settings

ODudek/go-aris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aris

Go License: MIT Go Report Card

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

git clone https://github.com/ODudek/go-aris.git
cd go-aris
go build .

Running the Server

With gnet (high performance - default)

go run .
# or explicitly
go run . -gnet=true -port=:8089

With standard Go net (fallback)

go run . -gnet=false -port=:8089

The server will start on port 8089 and accept Redis-compatible commands.

Testing with Redis CLI

redis-cli -p 8089

Development

Prerequisites

  • Go 1.20 or higher

Running Tests

go test ./...

Building

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 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 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

  • Implement handlers for SET, GET, PING, HSET, HGET, HGETALL commands
  • Implement thread-safe in-memory storage
  • Support concurrent client connections
  • 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 file for details.

About

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.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages