15B-kvstore-hash-mysql

command
v0.0.0-...-2e19e05 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 8 Imported by: 0

README

Implementing Routing Strategy in KV Store on top of MySQL

  • Implementing put, get, del, ttl operations all in sync.

  • We create 2 tables and 2 connections simulating DB Partitions kv_store_shard1 and kv_store_shard2.
    NOTE: Naming of the tables wrong - should be partition not shard

  • Run the set_db.sql file to create DB, and partitions. Run: mysql -u root -p < <path to set_db.sql>

  • Implementing Routing technique, using a consistent hashing mechanism.

hash := sha256.Sum256([]byte(key))
idx := int(hash[0]) % shardCount
  • Randomly get, put, del values.

Implementation of simple KV Store

Logs to the kvstore

alt text

Before cleanup

alt text

After cleanup

alt text

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL