Hacker News new | past | comments | ask | show | jobs | submit login

Close; For the most part, to the application the Posts appear to be from one table since the lookup interface is the same (externally), but in reality at this massive scale, it just wouldn't be possible in a single MySQL table and database, even if you had a huge number of replicas. Tumblr's posts are spread across MANY "shards" which are actually different servers, each running a chunk of posts, shared by the blog owner. e.g. Blogs 1 - 10,000,000 on Shard 1, 10,000,001 to 20,000,000 on Shard 2, etc. More in depth talk here http://highscalability.com/blog/2012/2/13/tumblr-architectur... and http://assets.en.oreilly.com/1/event/74/Massively%20Sharded%... though it's from 2011/2012, but the overall ideas still hold. At the time of that post (7 years ago) there were already 200 Database servers.

Thankfully nothing is 32-bit so no worries about integer overflows. That would cause huge headaches everywhere on the PHP side. In MySQL, a regular unsigned INT column does have that limitation (roughly max 4.5 billion for unsigned, 2.2 signed), so BIGINT must be used there (Twitter had to do the same). Where it gets interesting is PHP doesn't support unsigned integers, so with 64 bit your max integer in PHP is 9,223,372,036,854,775,807, whereas in MySQL an unsigned 64 bit int is double that. I think it's safe to say though that neither Tumblr nor WordPress, even combined, would ever have more posts than atoms on Earth =)




> I think it's safe to say though that neither Tumblr nor WordPress, even combined, would ever have more posts than atoms on Earth =)

If my math is correct, you're a wee bit off.

9,223,372,036,854,775,807 is 2^63, which is roughly 10^19. The Avogadro constant, which is about 6 * 10^23, is the number of particles (atoms / molecules) in a mole of substance, which for atoms amounts to (atom number of element) grams of mass (so e.g. 12g of C12 is a mole).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: