‫So essentially, before we jump into shouting, just the idea of traditionally how we do things is we
‫have one big database with a huge tables, right.
‫And we would you might have some indexes on those tables.
‫You query and then you get results is always a centralized one database.
‫Your pin point is one server and query becomes slower and slower the more data you have because what
‫gets what you get and have indexes and those indexes are going to grow.
‫Raj and as your tables grow or large and and that kind of slow down your queries.
‫Right.
‫And you need more memory.
‫You need more CPU.
‫So it's just data scourer.
‫It just makes sense.
‫So if I want to make a select YORO from this table where you are like, well, this let's say this is
‫like a U URL shortener website.
‫Right.
‫Which is like one huge table.
‫This is the orals and this is the code.
‫So essentially what you do is like, hey, give me the URL for this code so I can visit that page.
‫Right.
‫That's what the URL Shawano does.
‫Right.
‫And then you query that that's a huge table to say there are one million rows.
‫So that's that square is going to get slower and slower, slower the more rows you have, because even
‫with indexes, that still is going to get slow.
‫Right, because it's just then it's going to grow and grow and grow.
‫So you want how do we speed things up?
‫So people invented the idea of sharding less blubbed that table and put it on multiple databases.
‫It sounds very simple.
‫And that's that's what it is.
‫It's very simple.
‫It's not really rocket science.
‫You partition your table row based partition based on certain field, certain column called Partition
‫Key or Shati.
‫And we throw those rows on multiple tables uniquely.
‫Right.
‫So let's say 200 K UARS goes here, another two hundred Keiko's here, another 200 K goes here.
‫But the question is, how do you Shahd, how do you distribute like I mean if you have customer table,
‫that's easy, right.
‫You can and do like on the zip code like these are the zip code for the westcoast.
‫This is a zip code for the East goes.
‫Or if you have a bunch of users, maybe users from one to five hundred million goes to this database
‫and from five hundred and one to one million goes to this database, that's another kind of sharding.
‫Right.
‫And that's kind of easier.
‫But what if your key is a string like this.
‫Right.
‫Which database server is this 550 O.J. is on.
‫Right.
‫So it's like, how do you know that?
‫So that's where we're going to talk about consistent caching.
‫But there is just a function and you can always find out it's not really hard or I can build it on function
‫to determine how to consistently hash this input to a server and this case.
‫Hey, I got to server three.
‫So let's we're going to talk about a little bit that.
‫Right.
‫And then once you find out which server you want to connect to, you connect to only that server and
‫you send your query to only that server.
‫Sounds simple, right?
‫You do not want to send your query to all databases to get essentially a bunch of messages.
‫Right.
‫You want to connect to the rights over that.
‫You're sure that your database or your employees is actually there?
‫Right.
‫And how do you find out that need consistent caching?