Anatomy Twitter "1" everything starts easy

Source: Internet
Author: User
Keywords SMS Http follower
Tags blogs business business logic content different environment home page homepage
Often hear "impetuous" the word, criticize modern superficial, lack of rigorous down-to-earth style. Such criticism is narrowly suspected. Each generation's environment is different, the problem is different, so gradually develop a culture, to adapt to the new environment, to solve new problems.





hundreds of years ago, people read novels, watch operas and listen to symphonies. By 20th century, we read magazines and newspapers, watched movie and television, and listened to pop songs. In the information age, people surf the internet, read blogs and watch videos. Behind these appearances, the evolution of these tendencies is the proliferation of information output and transmission. In the face of massive and rapidly updated information, everyone read a dream of Red mansions, a three chant of the situation is unimaginable. Instead, it requires a brief and focused message.





with the explosion of information, micro-blogging website Twitter was born. It is no exaggeration to describe Twitter's growth with the word "born". Twitter has grown from 0 to 66,000 since May 2006, when the number of Twitter users rose to 1.5 in December 2007. Another year, December 2008, Twitter's number of users reached 5 million. [1]





The sharp rise in the number of Twitter users, related to several major events, the March 2007 U.S. SXSW Music Festival, the November 2008 Mumbai, India, the terrorist events in January 2009, President Obama's inauguration, the June 2009 Iranian election crisis and so on. Major events are reported, characterized by a large number of readers, updated quickly. Therefore, the success of the Twitter site, the prerequisite is to be able to provide services to millions of users, and provide services faster. [2,3,4]





has a view that Twitter's business logic is simple, so the competition threshold is low. The first half of the sentence is correct, but the second half is open to discussion. The competitiveness of Twitter is inseparable from rigorous system architecture design.








"1" Everything starts easy





Twitter's core business logic is following and be followed. [5]





Go to the Twitter Personal homepage and you'll see the authors, the recently published microblogging following. The so-called micro-blog, is a text message, Twitter stipulates that the length of text messages should not exceed 140 words. Text messages can include not only plain text information, but also URLs, points to a Web page, photos and videos, and so on. This is the following process.





when you write a text message and post it, your followers will immediately see the latest text you've written on their personal homepage. This is the process of being followed.





it seems easy to implement this business process.





1. A be-followed table is customized for each registered user, and the main content is the ID of each follower. At the same time, also custom-made a following table, the main content is the ID of each following author.





2. When a user opens his or her own personal space, Twitter first looks up the following table and finds the ID of all following authors. Then go to the database to read the recent text written by each author. The totals are displayed in chronological order on the user's personal home page.





3. When a user writes a text message, Twitter first looks up the be-followed table and finds all followers IDs. Then update the followers's home page one by one.





If follower is reading his Twitter homepage, the JavaScript implied in the homepage will automatically visit the Twitter server every dozens of seconds to check for updates to the personal homepage that is being viewed. If there is an update, download the new home page content immediately. So follower can read the latest text.





from author to reader, the middle delay depends on the interval between JavaScript updates and the time the Twitter server updates each follower's home page.





from a system architecture, it seems that the traditional three-segment theory (three-tier architecture [6]) is sufficient to satisfy this business logic. In fact, the original structure of the Twitter system is really three paragraphs.








Reference,





[1] fixing Twitter. (http://www.bookfm.com/courseware/coursewaredetail.html?cid=100777)


[2] Twitter blows up at SXSW conference. (http://gawker.com/tech/next-big-thing/twitter-blows-up-at-sxsw-conference-243634.php)


[3] Hand Accounts of terrorist attacks in India on Twitter and Flickr. (http://www.techcrunch.com/2008/11/26/first-hand-accounts-of-terrorist-attacks-in-india-on-twitter/)


[4] Social Media takes Center Stage in Iran. (http://www.findingdulcinea.com/news/technology/2009/June/Twitter-on-Iran-a-Go-to-Source-or-Almost-Useless.html)


[5] these Twitter ones. (http://www.ccthere.com/article/2363334) (http://www.ccthere.com/article/2369092)


[6] Three tier architecture. Http://en.wikipedia.org/wiki/Multitier_architecture


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.