Real-Time Delivery Architecture at Twitter

  Переглядів 56,093

Parleys

8 років тому

With hundreds of millions of users, Twitter operates one of the world's largest real-time delivery systems, large enough and pervasive enough to exert noticeable "pressure" on the overall internet itself. At steady state, Twitter receives thousands of tweets a second that it needs to deliver to disks, in-memory timelines, email, and mobile devices. The name of the game for Twitter is "now", so those deliveries, which multiply according to the graph of who follows whom, need to occur in real-time. In this session, we will dive into both the "write path" and "read path" of Twitter to understand the architecture which supports those tweets, and also how Twitter serves them through one of the world's largest web sites.
Author:
Attila Szegedi
Attila Szegedi is a Principal Member of the Technical Staff at Oracle, working on dynamic language features on the Java platform and the Nashorn JavaScript runtime for the JVM. Before joining Oracle, Attila worked as a Staff Engineer in Twitter's Runtime Systems group. He is also known for his work on several Open Source projects, most notably he is a contributor to Mozilla Rhino, an earlier JavaScript runtime for the JVM, a contributor to Kiji, Twitter's server-optimized Ruby runtime, the author of Dynalink, the dynamic linker framework for languages on the JVM, as well as one of the principal developers of the FreeMarker templating language runtime.

КОМЕНТАРІ: 15
@aneeinaec
@aneeinaec 2 роки тому
The best article ever
@gokukakarot6323
@gokukakarot6323 3 роки тому
He has exactly my thoughts.
@ravitp
@ravitp 3 роки тому
It would be great if could share the presentation.
@johncenakiwi
@johncenakiwi 5 років тому
Gilfoyle?
@prarabdhjoshi9083
@prarabdhjoshi9083 6 років тому
I would really appreciate it if anyone can answer this question. When they say that the data from the write api comes in and it goes to army of redis instances and does a fan out write, how does it actually find where (in which redis instance) the user timeline for the followers is present? Does that also come from the social graph service? If so, how does social graph service keep track of which redis instance has which users timeline? Basically, I am trying to understand how do we know that we need to query a particular redis instance for this user's timeline.
@deepakkansl
@deepakkansl 6 років тому
I am not sure about this case but most of the databases use sharding (horizontal partitioning) where they partition the data based on some key using hashing (consistent hashing mostly). The social graph service must be returning user ids of the followers to the fan out nodes. The fan out nodes must then be determining the exact redis instance by applying the same hashing algo to the follower's user ids. Again, It's a guess.
@25pranjala
@25pranjala 5 років тому
As per my understanding, they use a hash lookup using the user ID to locate the redis instance that holds the particular timeline
@vinodc6541
@vinodc6541 3 роки тому
I believe they use consistent hashing. He also mentioned they have a replication factor, which means data would be present on at least replication factor number of instances. There are multiple strategies on how this replication is done within nodes in the ring. I guess that's a discussion for a different day.
@prarabdhjoshi9083
@prarabdhjoshi9083 3 роки тому
Thanks everyone! That cleared it up.
@yaroslav1811
@yaroslav1811 4 роки тому
One question! How it stores an element in a list with twitterid, userid and bits to get only 8+8+4 bytes? redis use string as data type...
@sthirumalai
@sthirumalai 3 роки тому
Redis stores integers in their integer representation, so for string values that actually hold an integer, there is no overhead for storing the string representation of the integer. redis.io/commands/incr#:~:text=Redis%20stores%20integers%20in%20their,string%20representation%20of%20the%20integer.
@domaincontroller
@domaincontroller 3 роки тому
09:07 Redis, memchache
@adammarek8822
@adammarek8822 6 років тому
How old is this talk?
@Quisl
@Quisl 6 років тому
The slides say its from 2013
@preguntoncojonerocabron1746
@preguntoncojonerocabron1746 5 років тому
code and code ?? REAL WORLD samples ? Demos are cool, but it is time to talk about the real world! The Succinctly series This frustration translated into a deep desire to produce a series of concise technical books that would be targeted at developers working on the Microsoft platform. We firmly believe, given the background knowledge such developers have, that most topics can be translated into books that are between 50 and 100 pages. This is exactly what we resolved to accomplish with the Succinctly series. Isn’t everything wonderful born out of a deep desire to change things for the better?
когда одна дома // EVA mash
00:51
EVA mash
Переглядів 9 млн
Эффект Карбонаро и пончики
01:01
История одного вокалиста
Переглядів 7 млн
Samsung or iPhone
0:19
rishton_vines😇
Переглядів 3,2 млн
Опасная флешка 🤯
0:22
FATA MORGANA
Переглядів 769 тис.