Live data from Hacker News

On Sharding

tbray.org

41–44 of 44 posts

Re: On Sharding

#41

Is it just me, or is this article talking about load balancing, not sharding. My understanding of "sharding" is to split up a database into groups, either by time or by some index key (e.g., A-C on one shard, D-G on another, etc.). This article seems to be about splitting up web traffic, not sharding.

Sharding is about splitting up the data in groups; in this case, the idea is that the web nodes have some local state, reducing the need to hit the databases so much:

"If all the clickstream clicks from the same user or state-change events from the same workflow or whatever go to the same host, you can hold the relevant state in that host’s memory, which means you can respond faster and hit your database less hard."

Re: On Sharding

#42
post #29

Earlier quoted context omitted.

I worked for a major cloud service a few years back, and got a wonderful introduction in to how loadbalancers are, for the most part, somewhat awful. They work better when it's just one in front of a fleet of servers, and so have the total picture of what is going on, but of course that's quite the bottleneck. So you get two LBs, or more, and they each only have their notion of what the back end fleet is doing. There…

I have similar experience. I once worked with a pretty big site which used a load-balancer configured to route all traffic to the server based on average response-time. The intention was that if a server was returning results "quickly" that meant it was least-loaded, and could handle the newest requests. What it actually meant though was that the server disk filled up, and it started returning "500, Internal Server E…

I had almost the same thing happen once - but the server was serving requests 'very quickly' because it was caching everything based on the LB requesting it.

Re: On Sharding

#43
post #7

> Load-sensitivity is one “smart” approach. The idea is that you keep track of the load on each shard, and selectively route traffic to the lightly-loaded ones and away from the busy ones. Simplest thing is, if you have some sort of load metric, always pick the shard with the lowest value. Gotta be super careful with this one. We did this at reddit and it bit us bad. The problem was as soon as the load on a machine w…

Obligatory racelbythebay post: https://rachelbythebay.com/w/2018/04/21/lb/

Re: On Sharding

#44
post #39
post #7

> Load-sensitivity is one “smart” approach. The idea is that you keep track of the load on each shard, and selectively route traffic to the lightly-loaded ones and away from the busy ones. Simplest thing is, if you have some sort of load metric, always pick the shard with the lowest value. Gotta be super careful with this one. We did this at reddit and it bit us bad. The problem was as soon as the load on a machine w…

We had the same problem at Justin.tv with the video servers, with the added wrinkle that every choice had the potential to meaningly affect load for an hour or more. We eventually ended up putting extremely detailed information into a central database for the load balancer so that it could consider not only server load, but also the load on all of our internal and external network links. We also had to keep track of…

Sounds fun.
Post reply on HN