07-sharding

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

Simulating Data Sharding and Routing from API Server

  1. Create a DB.
    Run: mysql -u root -p < <path to set_db.sql>
  2. Simulate Multiple Shards: Create 2 connections from our machine to the DB, simulating 2 different shards.
  3. API Server Routing: our API server is aware of th DB topolgy, r.GET("/user/:userID", getUser). The getUser function determines the appropiate shard based on the userID
  4. Alternative: Instead of handling routing at the application layer, we could be using a Proxy Database. A proxy DB handles the routing and scaling behind the scenes, and automatically distribute traffic across different shards.

alt text

Reference

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