SlideShare a Scribd company logo
Scalable Social ArchitecturesThink Early, Think Often, Think Throughbirengandhihttp://unhub.com/biren
Scalability by the numberssource: developeranalytics.com (as of Dec 1, 2010)Scalable Social Architectures
Scalability by the numbers500M active users, 50% log-in EVERY DAYsource: hitwise.comScalable Social Architectures
Isn’t that great?Exponential Growth is AWESOME or PAINFUL  Scalable Social Architectures
Scaling ChallengesScalable Social ArchitecturesThink EarlyThink OftenThink Through
Scaling ChallengesAnd the biggest challenge is …One Size Does NOT Fit AllScalable Social Architectures
Social Web ArchitecturesScalable Social ArchitecturesFirewallCachingWeb and App TierPublic NetworkLB/ProxyDB TierPlatform API Calls“Social” Part
Social Game ArchitecturesScalable Social ArchitecturesNot “nice to have”, but  “must have”CDNUpload/MissFirewallCachingWeb and App TierPublic NetworkLB/ProxyDB TierPlatform API Calls
Gaming Stack SummaryScalable Social Architectures
Obvious Challenges PersistenceCachingWeb ServerClient PerceptionDataScalable Social Architectures
PersistenceRDBMS (mysql)Data modelingDe-normalization is your friend SlavingShardingNoSQLHbase, Cassandra, MongoDB, Redis, …MembaseGraph DatabasesNeo4j, InfiniteGraph, …Traffic PatternsRead/Write MixConsistency ModelsScalable Social Architectures
MysqlSharding ExampleApp TierApp TierM0M1M0M1MasterS0S1S0S1S2S3SlaveS’0S’1S’2S’3
CachingIn-process (MMO)Java vs. Scripting LanguagesAPCMostly read-only global dataPriming after releasesSerialization MemcacheFunctional (vertical) ShardingStatistical (horizontal) ShardingGranularity & Compression of Stored ObjectsScalable Social Architectures
Memcached ExampleKey Format: <function>:<version>:value (e.g. user:1:123 or better u:1:123)Scalable Social ArchitecturesHorizontalShardingVerticalSharding
Memcached ExampleKey Format: <function>:<version>:value (e.g. user:1:123 or better u:1:123)Scalable Social ArchitecturesHorizontalShardingVerticalShardinguid % nfeature?
Web TierEasy to Scale (Stateless)Cloud-friendly auto-grow policiesSticky sessions?H/W or S/W Load BalancersHAProxy, Zeus for Cloud environmentsDNS could be a bottleneckRound Robin DNSTech ChoicesApache, Nginx + FastCGINode.js on the server sideScalable Social Architectures
Client TierCDNStatic assets (images, JS, CSS etc.)Invalidation/update schemes (versioning)UGC might be little challengingFlash (or Graphic Engines)Watch out for frame ratesUsers’ machines are not as powerfulJavaScriptFrameworks (jQuery, Prototype, etc.)Tons of great advice on minifying, compressing, obfuscatingScalable Social Architectures
DataVersioningCoexistence of old and new dataRollback during catastrophic eventsIntegrityChecksum (costly)Field-level Validation (not cheap either)Gaming ContentLightweight CMS (integrated in art pipeline)Scalable Social Architectures
Not-so-obvious ChallengesData Center vs. CloudNetwork Port SaturationCPU UtilizationConnection BloatRuntime ConfigurationProgramming ModelsDeployment DisciplineScalable Social Architectures
Not-so-obvious ChallengesData Center vs. CloudVirtualization is good, but slowLittle control over optimization High failure ratesNetwork SaturationTraffic going across (DB/Memcache boxes)CPU UtilizationOne core is overworked Scalable Social ArchitecturesCloud Perf. 1/5 to 1/8 of Data Center
Not-so-obvious ChallengesConnection BloatDatabase/MemcachedPersistent ConnectionsProxies (mysql-proxy, moxi, memagent etc.)Runtime ConfigurationControlled rollout of featuresFire-fighting defenseHome-grown, Apache ZooKeeper, … Scalable Social Architectures
Not-so-obvious ChallengesProgramming ModelsExternal platform APIsFailure semanticsMake async, as much as possibleGraceful subsystem failuresOrganize all users data into same shardsThings WILL fail when you least expect them toConstant Performance EvaluationProfiling Tools (xhprof, xdebug etc. for PHP)HipHop CompilerPHP Extensions for Common CodeHeterogeneous languages for subcomponents Scalable Social Architectures
Deployment DisciplinesTools Hudson/Bamboo (deployment)Munin/Nagios (monitoring)Staging environmentAs close to production as possibleUser Downtime404 PagesTransparent HandlingCache PrimingDB failures after every deploymentDeployment Time1000+ serversP2P solutionsScalable Social Architectures
SummaryMetrics-driven OptimizationsYou can’t improve something you can’t measureEvery smart person has an ‘opinion’Leverage automated monitoring toolsLet machines work while humans restAny system is only as robust as its weakest linkIt’s an ONGOING process – a journey …better get used to it Think Early, Think Often, Think ThroughScalable Social Architectures

More Related Content

PDF
Drone World Expo Presentation
PDF
Architecting Large Enterprise Java Projects
PPTX
Enterprise Spring Building Scalable Applications
PDF
Architecting for Enterprise with JavaScript
PDF
Architecting Large Enterprise Projects @DevConf.CZ
KEY
Modular Java - OSGi
PDF
ARCHITECTING LARGE ENTERPRISE JAVA PROJECTS - vJUG
PPT
Knowledge share about scalable application architecture
Drone World Expo Presentation
Architecting Large Enterprise Java Projects
Enterprise Spring Building Scalable Applications
Architecting for Enterprise with JavaScript
Architecting Large Enterprise Projects @DevConf.CZ
Modular Java - OSGi
ARCHITECTING LARGE ENTERPRISE JAVA PROJECTS - vJUG
Knowledge share about scalable application architecture

Similar to Scalable Social Architectures by Biren Gandhi (20)

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

More from Biren Gandhi (10)

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

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation theory and applications.pdf
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
Machine Learning_overview_presentation.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
Programs and apps: productivity, graphics, security and other tools
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation theory and applications.pdf
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
The AUB Centre for AI in Media Proposal.docx
The Rise and Fall of 3GPP – Time for a Sabbatical?
gpt5_lecture_notes_comprehensive_20250812015547.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
cuic standard and advanced reporting.pdf
Electronic commerce courselecture one. Pdf
Machine Learning_overview_presentation.pptx
Assigned Numbers - 2025 - Bluetooth® Document
NewMind AI Weekly Chronicles - August'25-Week II
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Machine learning based COVID-19 study performance prediction
Building Integrated photovoltaic BIPV_UPV.pdf
20250228 LYD VKU AI Blended-Learning.pptx

Scalable Social Architectures by Biren Gandhi