Skip to content

RelayKV - A Distributed Key Value Store on top of SQL Database.

Notifications You must be signed in to change notification settings

laststylebender14/RelayKV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Problem Statement

Design a Key Value Store on top of a SQL database. Exposes APIs to GET, PUT, DEL keys. Along with these core functionalities, there should be an API to set TTL to an existing key, post which the key is auto-deleted from the store.

How to setup project?

  • make sure you have docker installed.
  • database setup add postgres username and password in file present inside src/main/resources folder.
    complete path: src/main/resources/.env
    have provided example in src/main/resources/example.env
    # .env file for PostgreSQL containers
    POSTGRES_PASSWORD=user@123
    POSTGRES_USER=user
    POSTGRES_DB=kv  # do not change db name, else application won't work.
    
  • now just run docker compose up -d to run all required containers.

Learnings

  • SQL Transactions.
  • Pessimistic Locking.
  • SQL DB horizontally Scaling by Manually Sharding Database (range based sharding).

About

RelayKV - A Distributed Key Value Store on top of SQL Database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published