SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Learning and Development                 Be part of the learning experience at Aditi.

              presents
                                               Join the talks. Its free.
                                               Free as in freedom at work, not free-beer.


                                               Its not training. Its mind-opener.

                                               Speak at these events. Or bring an
                                               expert/friend to talk.
    Open Talk Series
                                               Mail OpenTalk@aditi.com with topic and
      A series of illuminating talks and
  interactions that open our minds to new      availability.
ideas and concepts; that makes us look for
   newer or better ways of doing what we
 did; or point us to exciting things we have
  never done before. A range of topics on
     Technology, Business, Fun and Life.
HOW TO ENJOY AN                    TALK



Bring coffee & friends      Switch OFF mobile      Switch ON mind




Sign attendance sheet      SHARE your wisdom      QUESTION notions




              THANK the Talker       SPREAD the good word
architecture
                                        Sundararajan Subramanian
Image Copyright : facebook
facebook in 20 Minutes
                        • 2.7 M Photos
                        • 10.2M Comments
                        • 4.6 Messages

Statistics

What is Facebook
                        •   Shared links: 1,000,000
Technical challenges    •   Tagged photos: 1,323,000
Front End
                        •   Event invites sent out: 1,484,000
Data arch

Services architecture   •   Wall Posts: 1,587,000
                        •   Status updates: 1,851,000
                        •   Friend requests accepted: 1,972,000
                        •   Photos uploaded: 2,716,000
                        •   Comments: 10,208,000
                        •   Message: 4,632,000
facebook in 20 Minutes


                        Direct Friendship




Statistics

What is Facebook

Technical challenges

Front End

Data arch

Services architecture




                                            Friends of Friends
What is facebook

                        • A social graph
                        • Friends , Friends of friends, somewhere in the
                          network.
                        • Friends can comment, like, read your posts
                        • Friends of friends can just read
Statistics

What is Facebook

Technical challenges    • Facebook messages – chat/ email/ SMS
Front End
                        • Near real-time updates
Data arch

Services architecture
Technical Challenges


                          Challenges     Ok to Live with
Statistics

What is Facebook
                        • High           • Not Mission
Technical challenges

Front End
                          Concurrency      Critical
Data arch
                        • High Data      • Cached data is
Services architecture
                          Volumes          fine
                        • Multilevel     • Write Failures
                          Hierarchical     are tolerable
                          data
The Data – (Illustrational)
                                          Everything is a hash lookup
                        User        Friend User             Age    Bio          Intere
                        ID          s with Name                                 sts
Statistics              1           2,3,4       XYZ         ..     ..           ..
What is Facebook        2           1           ..          ..     ..           ..
Technical challenges



                            Challenges                              Solutions
Front End

Data arch

Services architecture



                               The Relational Nature of the data         No Constraints, No Joins in MySQL


                               Data Volumes                              Write Through cache implementation


                               Concurrency                               Hash Ring based architecture
facebook – Data Partition initial thoughts
        • Horizontal partitioning based on
          Networks.
                        – Harvard
Statistics              – Stanford
What is Facebook

Technical challenges
                        – Carnegie
Front End

Data arch

Services architecture
facebook –Photos - HayStack
        • Each File read required a minimum
          of 3 i/o in a typical file system
        • CDNs- Not a Solution
        • Haystack is a customized storage
Statistics



          system, which minimizes the
What is Facebook

Technical challenges

Front End
          amount of File metadata and
          involves only 1 i/o for each file
Data arch

Services architecture


          read.
        • Haystack caches extensive data in
          in its main memory
facebook – HayStack



Statistics              HayStack Interface
                                                     HayStack             HayStack
What is Facebook
                                                     Cache                Directory
Technical challenges

Front End

Data arch                      Logical Drives                        Logical Drives
Services architecture


                          PD        PD          PD              PD        PD          PD




                           http://CDN/Cache/Machine id/(Logical volume, Photo)
Facebook – Serving the Photo - Haystack




Statistics

What is Facebook

Technical challenges

Front End

Data arch

Services architecture
Facebook – Scribe - Logging

                        Nodes              Nodes               Nodes
                            Scribe             Scribe                 Scribe


Statistics

What is Facebook

Technical challenges

Front End                                                    $messages = array();
                                                             $entry = new LogEntry;
Data arch
                                     Central Scribe Server   $entry->category = "buckettest";
Services architecture                                        $entry->message = "something very”;
                                                             $messages []= $entry;
                                                             $result = $conn->Log($messages);


                        Dashboards
                                            HBase
facebook – Services– Thrift
                        • Lightweight Software framework for cross-
                          language development
                        • Dev need not worry about serialization ,
                          connection handling and threading
                        • Supported bindings:
Statistics

What is Facebook

Technical challenges       – C++, PHP, Python, java, ruby, erlang, perl,
Front End                    haskell
                        • Transports : Simple interface to i/o
Data arch

Services architecture


                        • Protocols : Serialization format
                           – TBinaryProtocol, TJsonProtocol
                        • Severs
                           – Non Blocking, Async, Single threaded, multi-
                             threaded
facebook – Memcache
                        • In-memory distributed hash table
                        • “hot” data from MySQL stored in cache

Statistics

What is Facebook

Technical challenges

Front End

Data arch

Services architecture
facebook – front end - PHP
                        • Op – Code Optimization
                        • APC improvements(alternate PHP cache)
                           – Lazy Loading
                           – Cache priming
Statistics
                        • Custom Extensions
What is Facebook

Technical challenges
                           – Memcache Client Extension
Front End                  – Serialization format
Data arch
                           – Logging, Stats Collection, Monitoring
Services architecture

                           – Asynchronous event-handling mechanism
facebook – front end – Hip Hop
                        • Source Code Transformer
                        • Static Analysis, type inference, Code
                          Generation
Statistics
                        • Easier to write extensions
What is Facebook

Technical challenges    • Significantly cuts down on CPU and
                          Memory usage
Front End

Data arch

Services architecture
facebook – front end – Hip Hop



Statistics

What is Facebook

Technical challenges

Front End

Data arch

Services architecture
facebook – front end – BigPipe
                        BigPipe first breaks web pages into multiple chunks called pagelets




Statistics

What is Facebook

Technical challenges

Front End

Data arch

Services architecture
facebook – front end – BigPipe
                        BigPipe first breaks web pages into multiple chunks called pagelets
                                                              Request Parsing

                                            Web Server parses and sanity checks the request


                                                               Data Fetching

                                               Web Server fetches data from storage tier
Statistics

What is Facebook                                            Markup Generation

                                                 Web server generates HTML Markup
Technical challenges

Front End                                                    Network Transport

                                                        Response is transferred
Data arch

Services architecture
                                                             CSS downloading




                                                           Dom Tree Construction




                                                           JavaScript downloading




                                                                JS Execution
facebook – Technology Stack

       Front End                          Big Pipe          Hip Hop

                             PHP - Custom compiler / Cache implementations

                                         Linux – Custom Kernel Extensions



                                                     Service Aggregators
       Scribe

                Thrift




                             Service 1          Service 2         Service 3     Service 4



       Data Store
                            MemCache – Write Through Cache implementation

                         Cassandra            MySQL             HBase         HayStack
facebook – Messages Infrastructure




Statistics

What is Facebook

Technical challenges

Front End

Data arch

Services architecture

Messages
facebook - Messages



Statistics

What is Facebook

Technical challenges

Front End

Data arch

Services architecture

Messages
facebook - Messages



Statistics

What is Facebook

Technical challenges

Front End

Data arch

Services architecture

Messages
facebook – Cells

                        Cell

                                          Node
                                           1
Statistics

What is Facebook
                          Node
Technical challenges                                    Node2
                           n            Zookeper
Front End                               Controller
Data arch                               Machines
Services architecture

Messages                         Node                Node
                                  4                   3


                               Application Server Cluster


                                        Metadata Store
facebook – Cells
                        • They help scale incrementally while
                          limiting failure scenarios
                        • Easy upgrades
Statistics

What is Facebook
                        • Metadata store failures affect only a few
Technical challenges
                          users
Front End

Data arch

Services architecture
                        • Easy rollout
Messages
                        • Flexibility to host cells in different data
                          centers with multi-homing for disaster
                          recovery
Take away – for our applications
          • Really parallel Asynchronous AJAX Pages
              – ASP.Net Update panels is a HOAX
          • Appropriate usage of client side technology
          • Cache – Cache – Cache
              – Write Through Caches are way better
              – App Fabric cache/ Memcache
          • High – Normalization is not needed
              – Store denormalized views – materialized views
          •   Parallel Services and Service aggregators
          •   Fault tolerant applications
          •   Asynchronous Processing
          •   1 Sec response time is too SLOW
References
             •   http://facebook.com/engineering
             •   www.infoq.com
             •   www.highscalability.com
             •   www.stackoverflow.com
             •   www.thrift.org
Keep Learning


For suggestions on topics/ feedbacks etc.,


      Contact OpenTalk@aditi.com

Weitere ähnliche Inhalte

Was ist angesagt?

Yahoo Cloud Serving Benchmark
Yahoo Cloud Serving BenchmarkYahoo Cloud Serving Benchmark
Yahoo Cloud Serving Benchmark
kevin han
 

Was ist angesagt? (20)

Data and AI summit: data pipelines observability with open lineage
Data and AI summit: data pipelines observability with open lineageData and AI summit: data pipelines observability with open lineage
Data and AI summit: data pipelines observability with open lineage
 
Facebook architecture presentation: scalability challenge
Facebook architecture presentation: scalability challengeFacebook architecture presentation: scalability challenge
Facebook architecture presentation: scalability challenge
 
Schemaless Databases
Schemaless DatabasesSchemaless Databases
Schemaless Databases
 
Why Microservice
Why Microservice Why Microservice
Why Microservice
 
Facebook Messages & HBase
Facebook Messages & HBaseFacebook Messages & HBase
Facebook Messages & HBase
 
Yahoo Cloud Serving Benchmark
Yahoo Cloud Serving BenchmarkYahoo Cloud Serving Benchmark
Yahoo Cloud Serving Benchmark
 
Front-end development for headless cms
Front-end development for headless cms Front-end development for headless cms
Front-end development for headless cms
 
Front end architecture
Front end architectureFront end architecture
Front end architecture
 
Cassandra in e-commerce
Cassandra in e-commerceCassandra in e-commerce
Cassandra in e-commerce
 
The evolution of Netflix's S3 data warehouse (Strata NY 2018)
The evolution of Netflix's S3 data warehouse (Strata NY 2018)The evolution of Netflix's S3 data warehouse (Strata NY 2018)
The evolution of Netflix's S3 data warehouse (Strata NY 2018)
 
Solutions Architect's Handbook 2nd Edition - Book Review
Solutions Architect's Handbook 2nd Edition - Book ReviewSolutions Architect's Handbook 2nd Edition - Book Review
Solutions Architect's Handbook 2nd Edition - Book Review
 
Caching
CachingCaching
Caching
 
Thousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OThousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/O
 
Introduction to hadoop
Introduction to hadoopIntroduction to hadoop
Introduction to hadoop
 
Azure functions
Azure functionsAzure functions
Azure functions
 
Google app engine
Google app engineGoogle app engine
Google app engine
 
Apache NiFi in the Hadoop Ecosystem
Apache NiFi in the Hadoop Ecosystem Apache NiFi in the Hadoop Ecosystem
Apache NiFi in the Hadoop Ecosystem
 
No SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageNo SQL- The Future Of Data Storage
No SQL- The Future Of Data Storage
 
Apache Phoenix and HBase: Past, Present and Future of SQL over HBase
Apache Phoenix and HBase: Past, Present and Future of SQL over HBaseApache Phoenix and HBase: Past, Present and Future of SQL over HBase
Apache Phoenix and HBase: Past, Present and Future of SQL over HBase
 
What Is a Cloud-first Headless CMS
What Is a Cloud-first Headless CMSWhat Is a Cloud-first Headless CMS
What Is a Cloud-first Headless CMS
 

Ähnlich wie Facebook Architecture - Breaking it Open

Sharing a Startup’s Big Data Lessons
Sharing a Startup’s Big Data LessonsSharing a Startup’s Big Data Lessons
Sharing a Startup’s Big Data Lessons
George Stathis
 
Five Ways To Do Data Analytics "The Wrong Way"
Five Ways To Do Data Analytics "The Wrong Way"Five Ways To Do Data Analytics "The Wrong Way"
Five Ways To Do Data Analytics "The Wrong Way"
Discover Pinterest
 

Ähnlich wie Facebook Architecture - Breaking it Open (20)

Big data berlin
Big data berlinBig data berlin
Big data berlin
 
Engineering patterns for implementing data science models on big data platforms
Engineering patterns for implementing data science models on big data platformsEngineering patterns for implementing data science models on big data platforms
Engineering patterns for implementing data science models on big data platforms
 
Introduction to Data Engineering
Introduction to Data EngineeringIntroduction to Data Engineering
Introduction to Data Engineering
 
E meyer lamp2012
E meyer lamp2012E meyer lamp2012
E meyer lamp2012
 
Software architecture & design patterns for MS CRM Developers
Software architecture & design patterns for MS CRM  Developers Software architecture & design patterns for MS CRM  Developers
Software architecture & design patterns for MS CRM Developers
 
Introduction to the Semantic Web
Introduction to the Semantic WebIntroduction to the Semantic Web
Introduction to the Semantic Web
 
Bertenthal
BertenthalBertenthal
Bertenthal
 
H2O Deep Water - Making Deep Learning Accessible to Everyone
H2O Deep Water - Making Deep Learning Accessible to EveryoneH2O Deep Water - Making Deep Learning Accessible to Everyone
H2O Deep Water - Making Deep Learning Accessible to Everyone
 
Sharing a Startup’s Big Data Lessons
Sharing a Startup’s Big Data LessonsSharing a Startup’s Big Data Lessons
Sharing a Startup’s Big Data Lessons
 
Uof memphis nosql mike king dell v1.5 feb18
Uof memphis nosql mike king dell v1.5 feb18Uof memphis nosql mike king dell v1.5 feb18
Uof memphis nosql mike king dell v1.5 feb18
 
SQLCAT: Tier-1 BI in the World of Big Data
SQLCAT: Tier-1 BI in the World of Big DataSQLCAT: Tier-1 BI in the World of Big Data
SQLCAT: Tier-1 BI in the World of Big Data
 
Simplifying Building Automation: Leveraging Semantic Tagging with a New Breed...
Simplifying Building Automation: Leveraging Semantic Tagging with a New Breed...Simplifying Building Automation: Leveraging Semantic Tagging with a New Breed...
Simplifying Building Automation: Leveraging Semantic Tagging with a New Breed...
 
State of Play. Data Science on Hadoop in 2015 by SEAN OWEN at Big Data Spain ...
State of Play. Data Science on Hadoop in 2015 by SEAN OWEN at Big Data Spain ...State of Play. Data Science on Hadoop in 2015 by SEAN OWEN at Big Data Spain ...
State of Play. Data Science on Hadoop in 2015 by SEAN OWEN at Big Data Spain ...
 
Software Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software EngineeringSoftware Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software Engineering
 
Big Data Introduction - Solix empower
Big Data Introduction - Solix empowerBig Data Introduction - Solix empower
Big Data Introduction - Solix empower
 
Five Ways To Do Data Analytics "The Wrong Way"
Five Ways To Do Data Analytics "The Wrong Way"Five Ways To Do Data Analytics "The Wrong Way"
Five Ways To Do Data Analytics "The Wrong Way"
 
Agile Data Rationalization for Operational Intelligence
Agile Data Rationalization for Operational IntelligenceAgile Data Rationalization for Operational Intelligence
Agile Data Rationalization for Operational Intelligence
 
DA_01_Intro.pptx
DA_01_Intro.pptxDA_01_Intro.pptx
DA_01_Intro.pptx
 
Insights through the use smart data
Insights through the use smart dataInsights through the use smart data
Insights through the use smart data
 
Data Management - Full Stack Deep Learning
Data Management - Full Stack Deep LearningData Management - Full Stack Deep Learning
Data Management - Full Stack Deep Learning
 

Mehr von HARMAN Services

Mehr von HARMAN Services (20)

3 Dimensions Of Transformation
3 Dimensions Of Transformation3 Dimensions Of Transformation
3 Dimensions Of Transformation
 
Testing Strategies to Deliver Consistent App Performance
Testing Strategies to Deliver Consistent App Performance Testing Strategies to Deliver Consistent App Performance
Testing Strategies to Deliver Consistent App Performance
 
How to Manage APIs in your Enterprise for Maximum Reusability and Governance
How to Manage APIs in your Enterprise for Maximum Reusability and GovernanceHow to Manage APIs in your Enterprise for Maximum Reusability and Governance
How to Manage APIs in your Enterprise for Maximum Reusability and Governance
 
Digital Transformation: Connected API Ecosystems
Digital Transformation: Connected API EcosystemsDigital Transformation: Connected API Ecosystems
Digital Transformation: Connected API Ecosystems
 
Webinar - Transforming Manufacturing with IoT
Webinar - Transforming Manufacturing with IoTWebinar - Transforming Manufacturing with IoT
Webinar - Transforming Manufacturing with IoT
 
Microsoft Azure Explained - Hitesh D Kesharia
Microsoft Azure Explained - Hitesh D KeshariaMicrosoft Azure Explained - Hitesh D Kesharia
Microsoft Azure Explained - Hitesh D Kesharia
 
15 Big Data Billionaires
15 Big Data Billionaires15 Big Data Billionaires
15 Big Data Billionaires
 
Digital Transformation in Travel
Digital Transformation in TravelDigital Transformation in Travel
Digital Transformation in Travel
 
Digital Transformation in Retail
Digital Transformation in RetailDigital Transformation in Retail
Digital Transformation in Retail
 
Digital Transformation in Media
Digital Transformation in MediaDigital Transformation in Media
Digital Transformation in Media
 
Digital Transformation in Hospitality
Digital Transformation in HospitalityDigital Transformation in Hospitality
Digital Transformation in Hospitality
 
Introduction to Microsoft Azure HD Insight by Dattatrey Sindhol
Introduction to Microsoft Azure HD Insight by Dattatrey Sindhol Introduction to Microsoft Azure HD Insight by Dattatrey Sindhol
Introduction to Microsoft Azure HD Insight by Dattatrey Sindhol
 
Top LinkedIn Influencers Every CIO Must Follow
Top LinkedIn Influencers Every CIO Must Follow Top LinkedIn Influencers Every CIO Must Follow
Top LinkedIn Influencers Every CIO Must Follow
 
Ladbrokes and Aditi - Digital Transformation Case study
Ladbrokes and Aditi - Digital Transformation Case study Ladbrokes and Aditi - Digital Transformation Case study
Ladbrokes and Aditi - Digital Transformation Case study
 
How Internet of Things (IoT) is Reshaping the Automotive Sector - Infographic
How Internet of Things (IoT) is Reshaping the Automotive Sector - InfographicHow Internet of Things (IoT) is Reshaping the Automotive Sector - Infographic
How Internet of Things (IoT) is Reshaping the Automotive Sector - Infographic
 
Finding the important bugs- A talk by John Scarborough, Director of Testing, ...
Finding the important bugs- A talk by John Scarborough, Director of Testing, ...Finding the important bugs- A talk by John Scarborough, Director of Testing, ...
Finding the important bugs- A talk by John Scarborough, Director of Testing, ...
 
Analyzing Gartner's CIO Study: Fliping to Digital Leadership
Analyzing Gartner's CIO Study: Fliping to Digital Leadership Analyzing Gartner's CIO Study: Fliping to Digital Leadership
Analyzing Gartner's CIO Study: Fliping to Digital Leadership
 
24 Connected Car features to look out for before the release of Bond 24
24 Connected Car features to look out for before the release of Bond 2424 Connected Car features to look out for before the release of Bond 24
24 Connected Car features to look out for before the release of Bond 24
 
Webinar: How I Met Your Connected Customer
Webinar: How I Met Your Connected CustomerWebinar: How I Met Your Connected Customer
Webinar: How I Met Your Connected Customer
 
5 Takeaways From The UX India Conference
5 Takeaways From The UX India Conference5 Takeaways From The UX India Conference
5 Takeaways From The UX India Conference
 

Kürzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 

Facebook Architecture - Breaking it Open

  • 1. Learning and Development Be part of the learning experience at Aditi. presents Join the talks. Its free. Free as in freedom at work, not free-beer. Its not training. Its mind-opener. Speak at these events. Or bring an expert/friend to talk. Open Talk Series Mail OpenTalk@aditi.com with topic and A series of illuminating talks and interactions that open our minds to new availability. ideas and concepts; that makes us look for newer or better ways of doing what we did; or point us to exciting things we have never done before. A range of topics on Technology, Business, Fun and Life.
  • 2. HOW TO ENJOY AN TALK Bring coffee & friends Switch OFF mobile Switch ON mind Sign attendance sheet SHARE your wisdom QUESTION notions THANK the Talker SPREAD the good word
  • 3. architecture Sundararajan Subramanian Image Copyright : facebook
  • 4. facebook in 20 Minutes • 2.7 M Photos • 10.2M Comments • 4.6 Messages Statistics What is Facebook • Shared links: 1,000,000 Technical challenges • Tagged photos: 1,323,000 Front End • Event invites sent out: 1,484,000 Data arch Services architecture • Wall Posts: 1,587,000 • Status updates: 1,851,000 • Friend requests accepted: 1,972,000 • Photos uploaded: 2,716,000 • Comments: 10,208,000 • Message: 4,632,000
  • 5. facebook in 20 Minutes Direct Friendship Statistics What is Facebook Technical challenges Front End Data arch Services architecture Friends of Friends
  • 6. What is facebook • A social graph • Friends , Friends of friends, somewhere in the network. • Friends can comment, like, read your posts • Friends of friends can just read Statistics What is Facebook Technical challenges • Facebook messages – chat/ email/ SMS Front End • Near real-time updates Data arch Services architecture
  • 7. Technical Challenges Challenges Ok to Live with Statistics What is Facebook • High • Not Mission Technical challenges Front End Concurrency Critical Data arch • High Data • Cached data is Services architecture Volumes fine • Multilevel • Write Failures Hierarchical are tolerable data
  • 8. The Data – (Illustrational) Everything is a hash lookup User Friend User Age Bio Intere ID s with Name sts Statistics 1 2,3,4 XYZ .. .. .. What is Facebook 2 1 .. .. .. .. Technical challenges Challenges Solutions Front End Data arch Services architecture The Relational Nature of the data No Constraints, No Joins in MySQL Data Volumes Write Through cache implementation Concurrency Hash Ring based architecture
  • 9. facebook – Data Partition initial thoughts • Horizontal partitioning based on Networks. – Harvard Statistics – Stanford What is Facebook Technical challenges – Carnegie Front End Data arch Services architecture
  • 10. facebook –Photos - HayStack • Each File read required a minimum of 3 i/o in a typical file system • CDNs- Not a Solution • Haystack is a customized storage Statistics system, which minimizes the What is Facebook Technical challenges Front End amount of File metadata and involves only 1 i/o for each file Data arch Services architecture read. • Haystack caches extensive data in in its main memory
  • 11. facebook – HayStack Statistics HayStack Interface HayStack HayStack What is Facebook Cache Directory Technical challenges Front End Data arch Logical Drives Logical Drives Services architecture PD PD PD PD PD PD http://CDN/Cache/Machine id/(Logical volume, Photo)
  • 12. Facebook – Serving the Photo - Haystack Statistics What is Facebook Technical challenges Front End Data arch Services architecture
  • 13. Facebook – Scribe - Logging Nodes Nodes Nodes Scribe Scribe Scribe Statistics What is Facebook Technical challenges Front End $messages = array(); $entry = new LogEntry; Data arch Central Scribe Server $entry->category = "buckettest"; Services architecture $entry->message = "something very”; $messages []= $entry; $result = $conn->Log($messages); Dashboards HBase
  • 14. facebook – Services– Thrift • Lightweight Software framework for cross- language development • Dev need not worry about serialization , connection handling and threading • Supported bindings: Statistics What is Facebook Technical challenges – C++, PHP, Python, java, ruby, erlang, perl, Front End haskell • Transports : Simple interface to i/o Data arch Services architecture • Protocols : Serialization format – TBinaryProtocol, TJsonProtocol • Severs – Non Blocking, Async, Single threaded, multi- threaded
  • 15. facebook – Memcache • In-memory distributed hash table • “hot” data from MySQL stored in cache Statistics What is Facebook Technical challenges Front End Data arch Services architecture
  • 16. facebook – front end - PHP • Op – Code Optimization • APC improvements(alternate PHP cache) – Lazy Loading – Cache priming Statistics • Custom Extensions What is Facebook Technical challenges – Memcache Client Extension Front End – Serialization format Data arch – Logging, Stats Collection, Monitoring Services architecture – Asynchronous event-handling mechanism
  • 17. facebook – front end – Hip Hop • Source Code Transformer • Static Analysis, type inference, Code Generation Statistics • Easier to write extensions What is Facebook Technical challenges • Significantly cuts down on CPU and Memory usage Front End Data arch Services architecture
  • 18. facebook – front end – Hip Hop Statistics What is Facebook Technical challenges Front End Data arch Services architecture
  • 19. facebook – front end – BigPipe BigPipe first breaks web pages into multiple chunks called pagelets Statistics What is Facebook Technical challenges Front End Data arch Services architecture
  • 20. facebook – front end – BigPipe BigPipe first breaks web pages into multiple chunks called pagelets Request Parsing Web Server parses and sanity checks the request Data Fetching Web Server fetches data from storage tier Statistics What is Facebook Markup Generation Web server generates HTML Markup Technical challenges Front End Network Transport Response is transferred Data arch Services architecture CSS downloading Dom Tree Construction JavaScript downloading JS Execution
  • 21. facebook – Technology Stack Front End Big Pipe Hip Hop PHP - Custom compiler / Cache implementations Linux – Custom Kernel Extensions Service Aggregators Scribe Thrift Service 1 Service 2 Service 3 Service 4 Data Store MemCache – Write Through Cache implementation Cassandra MySQL HBase HayStack
  • 22. facebook – Messages Infrastructure Statistics What is Facebook Technical challenges Front End Data arch Services architecture Messages
  • 23. facebook - Messages Statistics What is Facebook Technical challenges Front End Data arch Services architecture Messages
  • 24. facebook - Messages Statistics What is Facebook Technical challenges Front End Data arch Services architecture Messages
  • 25. facebook – Cells Cell Node 1 Statistics What is Facebook Node Technical challenges Node2 n Zookeper Front End Controller Data arch Machines Services architecture Messages Node Node 4 3 Application Server Cluster Metadata Store
  • 26. facebook – Cells • They help scale incrementally while limiting failure scenarios • Easy upgrades Statistics What is Facebook • Metadata store failures affect only a few Technical challenges users Front End Data arch Services architecture • Easy rollout Messages • Flexibility to host cells in different data centers with multi-homing for disaster recovery
  • 27. Take away – for our applications • Really parallel Asynchronous AJAX Pages – ASP.Net Update panels is a HOAX • Appropriate usage of client side technology • Cache – Cache – Cache – Write Through Caches are way better – App Fabric cache/ Memcache • High – Normalization is not needed – Store denormalized views – materialized views • Parallel Services and Service aggregators • Fault tolerant applications • Asynchronous Processing • 1 Sec response time is too SLOW
  • 28. References • http://facebook.com/engineering • www.infoq.com • www.highscalability.com • www.stackoverflow.com • www.thrift.org
  • 29.
  • 30. Keep Learning For suggestions on topics/ feedbacks etc., Contact OpenTalk@aditi.com