SlideShare a Scribd company logo
1 of 24
Scalable Social Architectures Think Early, Think Often, Think Through birengandhi http://unhub.com/biren
Scalability by the numbers source: developeranalytics.com (as of Dec 1, 2010) Scalable Social Architectures
Scalability by the numbers 500M active users, 50% log-in  EVERY DAY source: hitwise.com Scalable Social Architectures
Isn’t that great? Exponential Growth  is  AWESOME  or PAINFUL   Scalable Social Architectures
Scaling Challenges Scalable Social Architectures Think Early Think Often Think Through
Scaling Challenges And the biggest challenge is … One Size Does NOT Fit All Scalable Social Architectures
Social Web Architectures Scalable Social Architectures Firewall Caching Web and App Tier Public Network LB/Proxy DB Tier Platform API Calls “Social” Part
Social Game Architectures Scalable Social Architectures Not  “nice to have”, but  “must have” CDN Upload/Miss Firewall Caching Web and App Tier Public Network LB/Proxy DB Tier Platform API Calls
Gaming Stack Summary Scalable Social Architectures
Obvious Challenges  Persistence Caching Web Server Client Perception Data Scalable Social Architectures
Persistence RDBMS (mysql) Data modeling De-normalization is your friend  Slaving Sharding NoSQL Hbase, Cassandra, MongoDB, Redis, … Membase Graph Databases Neo4j, InfiniteGraph, … Traffic Patterns Read/Write Mix Consistency Models Scalable Social Architectures
MysqlSharding Example App Tier App Tier M0 M1 M0 M1 Master S0 S1 S0 S1 S2 S3 Slave S’0 S’1 S’2 S’3
Caching In-process (MMO) Java vs. Scripting Languages APC Mostly read-only global data Priming after releases Serialization  Memcache Functional (vertical) Sharding Statistical (horizontal) Sharding Granularity & Compression of Stored Objects Scalable Social Architectures
Memcached Example Key Format: <function>:<version>:value (e.g. user:1:123 or better u:1:123) Scalable Social Architectures Horizontal Sharding Vertical Sharding
Memcached Example Key Format: <function>:<version>:value (e.g. user:1:123 or better u:1:123) Scalable Social Architectures Horizontal Sharding Vertical Sharding uid % n feature?
Web Tier Easy to Scale (Stateless) Cloud-friendly auto-grow policies Sticky sessions? H/W or S/W Load Balancers HAProxy, Zeus for Cloud environments DNS could be a bottleneck Round Robin DNS Tech Choices Apache, Nginx + FastCGI Node.js on the server side Scalable Social Architectures
Client Tier CDN Static assets (images, JS, CSS etc.) Invalidation/update schemes (versioning) UGC might be little challenging Flash (or Graphic Engines) Watch out for frame rates Users’ machines are not as powerful JavaScript Frameworks (jQuery, Prototype, etc.) Tons of great advice on minifying, compressing, obfuscating Scalable Social Architectures
Data Versioning Coexistence of old and new data Rollback during catastrophic events Integrity Checksum (costly) Field-level Validation (not cheap either) Gaming Content Lightweight CMS (integrated in art pipeline) Scalable Social Architectures
Not-so-obvious Challenges Data Center vs. Cloud Network Port Saturation CPU Utilization Connection Bloat Runtime Configuration Programming Models Deployment Discipline Scalable Social Architectures
Not-so-obvious Challenges Data Center vs. Cloud Virtualization is good, but slow Little control over optimization  High failure rates Network Saturation Traffic going across (DB/Memcache boxes) CPU Utilization One core is overworked  Scalable Social Architectures Cloud Perf.  1/5 to 1/8 of Data Center
Not-so-obvious Challenges Connection Bloat Database/Memcached Persistent Connections Proxies (mysql-proxy, moxi, memagent etc.) Runtime Configuration Controlled rollout of features Fire-fighting defense Home-grown, Apache ZooKeeper, …  Scalable Social Architectures
Not-so-obvious Challenges Programming Models External platform APIs Failure semantics Make async, as much as possible Graceful subsystem failures Organize all users data into same shards Things WILL fail when you least expect them to Constant Performance Evaluation Profiling Tools (xhprof, xdebug etc. for PHP) HipHop Compiler PHP Extensions for Common Code Heterogeneous languages for subcomponents  Scalable Social Architectures
Deployment Disciplines Tools  Hudson/Bamboo (deployment) Munin/Nagios (monitoring) Staging environment As close to production as possible User Downtime 404 Pages Transparent Handling Cache Priming DB failures after every deployment Deployment Time 1000+ servers P2P solutions Scalable Social Architectures
Summary Metrics-driven Optimizations You can’t improve something you can’t measure Every smart person has an ‘opinion’ Leverage automated monitoring tools Let machines work while humans rest Any system is only as robust as its weakest link It’s an ONGOING process – a journey … better get used to it  Think Early, Think Often, Think Through Scalable Social Architectures

More Related Content

Similar to Scalable Social Architectures by Biren Gandhi

DevOps and the cloud: all hail the (developer) king - Daniel Bryant, Steve Poole
DevOps and the cloud: all hail the (developer) king - Daniel Bryant, Steve PooleDevOps and the cloud: all hail the (developer) king - Daniel Bryant, Steve Poole
DevOps and the cloud: all hail the (developer) king - Daniel Bryant, Steve Poole
JAXLondon_Conference
 
Strata SC 2014: Apache Mesos as an SDK for Building Distributed Frameworks
Strata SC 2014: Apache Mesos as an SDK for Building Distributed FrameworksStrata SC 2014: Apache Mesos as an SDK for Building Distributed Frameworks
Strata SC 2014: Apache Mesos as an SDK for Building Distributed Frameworks
Paco Nathan
 
Cloud Computing:An Economic Solution for Libraries
Cloud Computing:An Economic Solution for LibrariesCloud Computing:An Economic Solution for Libraries
Cloud Computing:An Economic Solution for Libraries
Amit Shaw
 

Similar to Scalable Social Architectures by Biren Gandhi (20)

Enterprise-Ready Private and Hybrid Cloud Computing Today
Enterprise-Ready Private and Hybrid Cloud Computing TodayEnterprise-Ready Private and Hybrid Cloud Computing Today
Enterprise-Ready Private and Hybrid Cloud Computing Today
 
2015 06-wso2 coneu-closingkeynote-asanka
2015 06-wso2 coneu-closingkeynote-asanka2015 06-wso2 coneu-closingkeynote-asanka
2015 06-wso2 coneu-closingkeynote-asanka
 
JAXLondon 2015 "DevOps and the Cloud: All Hail the (Developer) King"
JAXLondon 2015 "DevOps and the Cloud: All Hail the (Developer) King"JAXLondon 2015 "DevOps and the Cloud: All Hail the (Developer) King"
JAXLondon 2015 "DevOps and the Cloud: All Hail the (Developer) King"
 
DevOps and the cloud: all hail the (developer) king - Daniel Bryant, Steve Poole
DevOps and the cloud: all hail the (developer) king - Daniel Bryant, Steve PooleDevOps and the cloud: all hail the (developer) king - Daniel Bryant, Steve Poole
DevOps and the cloud: all hail the (developer) king - Daniel Bryant, Steve Poole
 
Web 2.0 and LiveQuotes Presentation
Web 2.0 and LiveQuotes PresentationWeb 2.0 and LiveQuotes Presentation
Web 2.0 and LiveQuotes Presentation
 
Choosing technologies for a big data solution in the cloud
Choosing technologies for a big data solution in the cloudChoosing technologies for a big data solution in the cloud
Choosing technologies for a big data solution in the cloud
 
RavenDB overview
RavenDB overviewRavenDB overview
RavenDB overview
 
Building the Joomla Platform
Building the Joomla PlatformBuilding the Joomla Platform
Building the Joomla Platform
 
Internet Scale Architecture
Internet Scale ArchitectureInternet Scale Architecture
Internet Scale Architecture
 
Strata SC 2014: Apache Mesos as an SDK for Building Distributed Frameworks
Strata SC 2014: Apache Mesos as an SDK for Building Distributed FrameworksStrata SC 2014: Apache Mesos as an SDK for Building Distributed Frameworks
Strata SC 2014: Apache Mesos as an SDK for Building Distributed Frameworks
 
Above the cloud joarder kamal
Above the cloud   joarder kamalAbove the cloud   joarder kamal
Above the cloud joarder kamal
 
Virtualization 2011 v1
Virtualization 2011 v1Virtualization 2011 v1
Virtualization 2011 v1
 
Real World Azure - Dev
Real World Azure - DevReal World Azure - Dev
Real World Azure - Dev
 
NoSQL Basics - a quick tour
NoSQL Basics - a quick tourNoSQL Basics - a quick tour
NoSQL Basics - a quick tour
 
You Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing It
You Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing ItYou Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing It
You Too Can Be a Radio Host Or How We Scaled a .NET Startup And Had Fun Doing It
 
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web ApplicationsWhat Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
 
Building Social Enterprise with Ruby and Salesforce
Building Social Enterprise with Ruby and SalesforceBuilding Social Enterprise with Ruby and Salesforce
Building Social Enterprise with Ruby and Salesforce
 
Cloud Computing:An Economic Solution for Libraries
Cloud Computing:An Economic Solution for LibrariesCloud Computing:An Economic Solution for Libraries
Cloud Computing:An Economic Solution for Libraries
 
Cloud Architecture Patterns for Mere Mortals - Bill Wilder - Vermont Code Cam...
Cloud Architecture Patterns for Mere Mortals - Bill Wilder - Vermont Code Cam...Cloud Architecture Patterns for Mere Mortals - Bill Wilder - Vermont Code Cam...
Cloud Architecture Patterns for Mere Mortals - Bill Wilder - Vermont Code Cam...
 
Java EE microservices architecture - evolving the monolith
Java EE microservices architecture - evolving the monolithJava EE microservices architecture - evolving the monolith
Java EE microservices architecture - evolving the monolith
 

More from Biren Gandhi

MongoDB In Enterprise 2.0
MongoDB In Enterprise 2.0MongoDB In Enterprise 2.0
MongoDB In Enterprise 2.0
Biren Gandhi
 

More from Biren Gandhi (10)

Speak to IoT
Speak to IoTSpeak to IoT
Speak to IoT
 
InterDrone 2017 Las Vegas - Keynote Address
InterDrone 2017 Las Vegas - Keynote AddressInterDrone 2017 Las Vegas - Keynote Address
InterDrone 2017 Las Vegas - Keynote Address
 
Tamaso Ma Jyotirgamaya - From Darkness to Light
Tamaso Ma Jyotirgamaya - From Darkness to LightTamaso Ma Jyotirgamaya - From Darkness to Light
Tamaso Ma Jyotirgamaya - From Darkness to Light
 
Winning the Digital Disruption Game by Biren Gandhi
Winning the Digital Disruption Game by Biren GandhiWinning the Digital Disruption Game by Biren Gandhi
Winning the Digital Disruption Game by Biren Gandhi
 
Drones and Fog Computing - New Frontiers of IoT and Digital Transformation -...
Drones and Fog Computing  - New Frontiers of IoT and Digital Transformation -...Drones and Fog Computing  - New Frontiers of IoT and Digital Transformation -...
Drones and Fog Computing - New Frontiers of IoT and Digital Transformation -...
 
UAVs (drones) for Humanitarian Efforts
UAVs (drones) for Humanitarian EffortsUAVs (drones) for Humanitarian Efforts
UAVs (drones) for Humanitarian Efforts
 
Get Cloud Resources to the IoT Edge with Fog Computing
Get Cloud Resources to the IoT Edge with Fog ComputingGet Cloud Resources to the IoT Edge with Fog Computing
Get Cloud Resources to the IoT Edge with Fog Computing
 
Fog Computing Reality Check: Real World Applications and Architectures
Fog Computing Reality Check: Real World Applications and ArchitecturesFog Computing Reality Check: Real World Applications and Architectures
Fog Computing Reality Check: Real World Applications and Architectures
 
MongoDB In Enterprise 2.0
MongoDB In Enterprise 2.0MongoDB In Enterprise 2.0
MongoDB In Enterprise 2.0
 
Unforgettable Lessons from Facebook & Zynga
Unforgettable Lessons from Facebook & ZyngaUnforgettable Lessons from Facebook & Zynga
Unforgettable Lessons from Facebook & Zynga
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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...
 
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
 
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
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Scalable Social Architectures by Biren Gandhi

  • 1. Scalable Social Architectures Think Early, Think Often, Think Through birengandhi http://unhub.com/biren
  • 2. Scalability by the numbers source: developeranalytics.com (as of Dec 1, 2010) Scalable Social Architectures
  • 3. Scalability by the numbers 500M active users, 50% log-in EVERY DAY source: hitwise.com Scalable Social Architectures
  • 4. Isn’t that great? Exponential Growth is AWESOME  or PAINFUL  Scalable Social Architectures
  • 5. Scaling Challenges Scalable Social Architectures Think Early Think Often Think Through
  • 6. Scaling Challenges And the biggest challenge is … One Size Does NOT Fit All Scalable Social Architectures
  • 7. Social Web Architectures Scalable Social Architectures Firewall Caching Web and App Tier Public Network LB/Proxy DB Tier Platform API Calls “Social” Part
  • 8. Social Game Architectures Scalable Social Architectures Not “nice to have”, but “must have” CDN Upload/Miss Firewall Caching Web and App Tier Public Network LB/Proxy DB Tier Platform API Calls
  • 9. Gaming Stack Summary Scalable Social Architectures
  • 10. Obvious Challenges Persistence Caching Web Server Client Perception Data Scalable Social Architectures
  • 11. Persistence RDBMS (mysql) Data modeling De-normalization is your friend Slaving Sharding NoSQL Hbase, Cassandra, MongoDB, Redis, … Membase Graph Databases Neo4j, InfiniteGraph, … Traffic Patterns Read/Write Mix Consistency Models Scalable Social Architectures
  • 12. MysqlSharding Example App Tier App Tier M0 M1 M0 M1 Master S0 S1 S0 S1 S2 S3 Slave S’0 S’1 S’2 S’3
  • 13. Caching In-process (MMO) Java vs. Scripting Languages APC Mostly read-only global data Priming after releases Serialization Memcache Functional (vertical) Sharding Statistical (horizontal) Sharding Granularity & Compression of Stored Objects Scalable Social Architectures
  • 14. Memcached Example Key Format: <function>:<version>:value (e.g. user:1:123 or better u:1:123) Scalable Social Architectures Horizontal Sharding Vertical Sharding
  • 15. Memcached Example Key Format: <function>:<version>:value (e.g. user:1:123 or better u:1:123) Scalable Social Architectures Horizontal Sharding Vertical Sharding uid % n feature?
  • 16. Web Tier Easy to Scale (Stateless) Cloud-friendly auto-grow policies Sticky sessions? H/W or S/W Load Balancers HAProxy, Zeus for Cloud environments DNS could be a bottleneck Round Robin DNS Tech Choices Apache, Nginx + FastCGI Node.js on the server side Scalable Social Architectures
  • 17. Client Tier CDN Static assets (images, JS, CSS etc.) Invalidation/update schemes (versioning) UGC might be little challenging Flash (or Graphic Engines) Watch out for frame rates Users’ machines are not as powerful JavaScript Frameworks (jQuery, Prototype, etc.) Tons of great advice on minifying, compressing, obfuscating Scalable Social Architectures
  • 18. Data Versioning Coexistence of old and new data Rollback during catastrophic events Integrity Checksum (costly) Field-level Validation (not cheap either) Gaming Content Lightweight CMS (integrated in art pipeline) Scalable Social Architectures
  • 19. Not-so-obvious Challenges Data Center vs. Cloud Network Port Saturation CPU Utilization Connection Bloat Runtime Configuration Programming Models Deployment Discipline Scalable Social Architectures
  • 20. Not-so-obvious Challenges Data Center vs. Cloud Virtualization is good, but slow Little control over optimization High failure rates Network Saturation Traffic going across (DB/Memcache boxes) CPU Utilization One core is overworked Scalable Social Architectures Cloud Perf. 1/5 to 1/8 of Data Center
  • 21. Not-so-obvious Challenges Connection Bloat Database/Memcached Persistent Connections Proxies (mysql-proxy, moxi, memagent etc.) Runtime Configuration Controlled rollout of features Fire-fighting defense Home-grown, Apache ZooKeeper, … Scalable Social Architectures
  • 22. Not-so-obvious Challenges Programming Models External platform APIs Failure semantics Make async, as much as possible Graceful subsystem failures Organize all users data into same shards Things WILL fail when you least expect them to Constant Performance Evaluation Profiling Tools (xhprof, xdebug etc. for PHP) HipHop Compiler PHP Extensions for Common Code Heterogeneous languages for subcomponents Scalable Social Architectures
  • 23. Deployment Disciplines Tools Hudson/Bamboo (deployment) Munin/Nagios (monitoring) Staging environment As close to production as possible User Downtime 404 Pages Transparent Handling Cache Priming DB failures after every deployment Deployment Time 1000+ servers P2P solutions Scalable Social Architectures
  • 24. Summary Metrics-driven Optimizations You can’t improve something you can’t measure Every smart person has an ‘opinion’ Leverage automated monitoring tools Let machines work while humans rest Any system is only as robust as its weakest link It’s an ONGOING process – a journey … better get used to it  Think Early, Think Often, Think Through Scalable Social Architectures
  • 25. Questions? biren.gandhi@gmail.com http://www.facebook.com/birengandhi http://www.linkedin.com/in/birengandhi http://twitter.com/birengandhi http://scalingchallenges.posterous.com/ Thank You Scalable Social Architectures