
Just a guy who loves to write code and watch anime.
Search for a command to run...

Just a guy who loves to write code and watch anime.
Nice and concise article. I would like to add a few points:
Before sharding, we should definitely consider vertical partitioning.
Sharding fits nicely for key-value stores, but what if you're not a key-value store?
Actually, it doesn't matter. We just need to generate a hash from the given key(s) to a range [0,numberOfShards-1]. For example, you can have a table with a composite Primary Key as (employeeId (int), department (string)).
Even in the above scenario, we can hash it to an integer and then take modulo with numberOfShards.
Important ⚠️: We need to think a bit about the hash function and numberOfShards value and ensure that data gets evenly spread.
Qualities that make outstanding builders.

Bipedal vs quadrupedal: how many legs This is about the number of legs the creature walks on. Bipedal. Two legs. Humans, ostriches, T-rex, kangaroos, most fantasy humanoids. Quadrupedal. Four legs. Do

Intro You hear "lerp" and "smoothstep" everywhere in game dev. They sound like math jargon. They're not. Both are small tools that do the same job: smoothly move from one value to another. The problem

What is Kinematics Kinematics is the math field. It's the study of how things move without worrying about forces (which would be dynamics). FK and IK are the two branches: forward kinematics and inver

Intro Textures are usually the biggest cost in a 3D scene. Memory, bandwidth, and load time all get eaten by them. Resizing them is the obvious lever. There's more. This post is about the less obvious

This is the second article of my Distributed Systems series. If you haven't read the previous one, here: Read Replication.
What if things get too tough for the leader database (referring back to read replication)?
Writing and distributing the data to all the follower databases, here we've to come up with a different solution.
Sharding is splitting up the workload into multiple read replicas. For an instance, if we have users with names that begin with the letters A to Z, we want to have 4 different replicas, responsible for a different set of users. One replica for example would be responsible for users whose names begin with A to D.
Sharding fits nicely for key-value stores, but what if you're not a key-value store?
If you don't luck out on being able to shard every single query, life can get a little hard, to the point Sharding just won't work for you (then you'd have to look for something else).
