Skip to content

nicholasamorim/redlin

Repository files navigation

Redlin

A very simple Redis implementation.

Logo

Overview

I'm learning Kotlin and after reading Kotlin: An Illustrated Guide and Kotlin Design Patterns and Best Practices, I decided to give this a go taking advantage of the structure in the CodeCrafters challenge.

So take this for what it is: a learning project.

At the moment it is essentially a wrapper for a ConcurrentHashMap.

This code is heavily inspired by Rust Projects - Write a Redis Clone and resp-kotlin.

Run

Run it with ./gradlew run then you can just use a normal redis-cli to communicate with the Redlin server.

Supported Commands

  • GET
  • SET
    • Expiration supported with EX (seconds) and PX (milliseconds)
    • Set only if it does not exist with NX
    • Set only if it exists with XX
  • ECHO
  • PING

To Do

  • Add periodic eviction, currently only lazy eviction is supported.
  • Implement basic transaction to support INCR.
  • Implement support for lists
  • Aim to use the coroutines properly and stop using ConcurrentHashMap by potentially implementing an Actor pattern.
  • RDB Persistence
  • Replication
  • Proper logging
  • Tests

About

Simple Redis implementation in Kotlin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages