SlideShare a Scribd company logo
1 of 13
Download to read offline
F10	
Session	-	Mobile	Testing	
4/28/17	1:00	PM	
	
	
	
	
	
	
Can	Your	Mobile	Infrastructure	Survive	
1	Million	Concurrent	Users?	
	
Presented	by:	
	
Siva	Katir	
PlayFab	
	
	
	
Brought	to	you	by:		
		
	
	
	
	
350	Corporate	Way,	Suite	400,	Orange	Park,	FL	32073		
888---268---8770	··	904---278---0524	-	info@techwell.com	-	https://www.techwell.com/
Siva	Katir	
PlayFab	
	
Siva	Katir	has	more	than	a	decade	of	experience	developing	across	cloud	systems,	
and	desktop	and	mobile	environments.	Siva	has	designed	and	developed	high-
availability	infrastructures—from	synchronizing	order	and	inventory	data	
between	multiple	companies	to	managing	work	permits,	worker	statuses,	and	
their	physical	locations	across	multiple	BP	oil	refineries.	His	varied	work	
experience	includes	deploying	CI	pipelines,	managing	servers,	and	running	his	
own	software	company	for	six	years.	Siva	is	passionate	about	programming	and	
sharing	his	knowledge	with	other	programmers	through	his	blog.
CAN YOUR MOBILE
INFRASTRUCTURE SURVIVE
1 MILLION CONCURRENT USERS?
Siva Katir
PlayFab, Inc
Mobile Dev + Test 2016
Don’t be your own worst enemy!
The Simpsons: Tapped Out launched by
EA in 2012
Backend was so unprepared for massive
loads of traffic it was pulled for FIVE
months for total redesign
Went on to become a huge and long-
lasting hit in the market for many years
afterwards
Can your company afford to add an
extra 5 months to the development
cycle? Including lost marketing and
promotional spend? Including lost
mindshare? Including bad press?
Be your own guardian angel!
Loadout launched on Steam by
Edge of Reality
500x increase in players overnight
on being featured in Steam store
EC2 auto-scaled in atomic and
replaceable servers instantly to
handle load
No downtime, no panic, no fires
DO YOU EVEN NEED A BACKEND?
Maybe! Maybe not!
What can my backend do for me?
Push updates without going
through full certification process
• New artwork? No problem!
• Message of the day!
• In-app purchase promotions!
Improve customer service
• Have an authoritative source for
what a client ‘has’
• Direct access to grant entitlements
to remediate issues
What can my backend do for me?
Support a single user across multiple
devices
• Recover a user’s session even if they
lose or replace their device
• Continue the same session across
multiple devices (phone to tablet)
Perform ‘trusted’ transactions
(especially around receipt verification)
• Clients are untrustworthy!
• Client-to-Provider transaction can only
say if a receipt is valid, NOT if a receipt
is valid for your app
Know Your Project
What is your budget?
• What does it cost to host?
• What does it cost to run?
Who are your engineers?
• Do you have the in-house expertise to
manage all services?
• DevOps? Backend? Whole-Stack?
Front-End?
• Are they willing to be on-call 24x7?
What do you need to put in the cloud?
Why?
Know Your Data
What data are you storing?
• User data
• Group data
• Application data
How does each piece of data need to
be queried?
• Can all data be looked up by a key?
• Need to do arbitrary field queries?
Is the data read and/or write heavy?
How much data do you expect to store
per user?
BUILDING A BACKEND 101
Not taught in schools!
Pick a Cloud Provider
Is your language well supported in
your provider?
How much self management is
required for each service?
How well is scalability built in?
Do you have region requirements?
• European data protection laws
• Russia and China have special data
laws
Large Needs or Small Needs?
Database + basic CRUD APIs?
• AWS Lambda!
Complex data + user management?
• AWS Mobile or Azure Mobile
Services!
Highly custom requirements?
• Roll your own on a public cloud
(PROCEED WITH CAUTION!)
Storing and Retrieving Data
Know your databases strength
• MySQL – Very easy to get started with and
widely supported
• MS-SQL – Powerful query engine and incredibly
performant
• MongoDB – Can query against arbitrary fields
• DynamoDB – Very easy scaling and fast random
access
Know their weaknesses too
• MySQL – very hard to scale
• MS-SQL – still pretty hard to scale
• MongoDB – very hard to scale correctly and
maintain data integrity
• DynamoDB – can only query against
predefined indexes cost effectively
Storing and Retrieving Data
Novel solutions to database shortcomings
• Use multiple databases to take advantage of their
individual strengths
• Example: Store “index” data in SQL, while using
DynamoDB for actual data storage which clients use
• Allows you to store all data without needing to scale
a difficult to scale database
Keys:
• Have a way to reliably update the SQL database out
of the user’s flow
• Don’t treat the SQL store as authoritative
• Some tools can make this entirely seamless, such as
using DynamoDB write streams and Lambda to
update SQL through
SQL:
{
“playerId”: 00001
“purchaseId”: 1002092,
“purchaseValue”: 0.99,
“purchaseDate”: 03/01/2016 09:01:05
}
DyanamoDB:
{
“playerId”: 00001,
“purchaseId”: 1002092,
“purchasedItems”:
[{
“itemName”: ”in_app_1”,
“purchasePrice”: 0.99
}]
}
SELECT purchaseId, purchaseValue FROM
sqlPurchaseTable WHERE purchaseDate > 3/1/2016
Plan For Failure
Design for the worst, hope for the best
• Any machine can go down at any time
• No machine should be ‘special’
If any machine can go down then any
machine can also be brought up
Architect-in failure behavior both up
and down the stack
• DB times out?
• Web server disk fails?
• Third-party provider goes down?
http://gunshowcomic.com/648
COMMON PITFALLS
It’s a trap!
Saving Data
Remote != Local
Do:
• Save only changed data
• Save data in batches
• Prepare for connection failures
• Prepare for client failures
• Prepare for server failures
Don’t:
• Save on a timer (unless it’s retrying)
• Save duplicated data
• Expect it to work
• Make assumptions on if it worked
http://cloudtweaks.com/
Loading Data
Easy Wins
• Client:
• Pre-load data during idle times
• Cache locally
• Assume data can fail to be loaded
• Assume data can arrive corrupted or out of
order
• Assume it will load slow
• If security matters, connect via SSL
• Don’t connect directly to the data store
• Server:
• Cache data that is OK to serve stale
• Design data schemas to make each request
perform as few queries as possible
• Design authorization in such a way to prevent
any, or at least limit any extra queries
Easy Fails
• Trying to implement a custom SSL service
• Trying to be clever with caching
• Assuming anything will work on the first try
Scalability
Don’t optimize early
• Actually know what your bottlenecks
are; most likely it is NOT string
handling!
• Run a realistic load test with a
profiler to get actual useful data
Don’t run blind
• Know your KPIs before launch
• Track your KPIs realtime via counters
with DataDog, Cloudwatch ect
• Set up alerting to your DRI
Scalability
Know what infrastructure to scale and when
• Data
• API servers
• Load balancers
Design to scale horizontally, not vertically
• All services should be stateless unless they
don’t need to scale with number of users
• Don’t assume a server will exist minute to
minute
Keep a safe capacity margin in your
infrastructure
• 50% is reasonable
• Know how long it will take to increase capacity
Managing Connections
Use connection pooling
Don’t try to outsmart your language’s
connection management
Making a connection has a cost!
Don’t re-invent a protocol if an existing
one will do
• HTTP is way easier to debug than
websockets
• Websockets stream data way more
efficiently than HTTP
• Both are safer than using raw TCP
QUESTIONS?
Siva Katir
siva.katir@live.com
@sivakatir
http://www.slideshare.net/SivaKatir

More Related Content

What's hot

Accelerate Business Agility with PaaS
Accelerate Business Agility with PaaS Accelerate Business Agility with PaaS
Accelerate Business Agility with PaaS
WSO2
 
WSO2 Intro Webinar - Simplifying Enterprise Integration with Configurable WS...
WSO2 Intro Webinar -  Simplifying Enterprise Integration with Configurable WS...WSO2 Intro Webinar -  Simplifying Enterprise Integration with Configurable WS...
WSO2 Intro Webinar - Simplifying Enterprise Integration with Configurable WS...
WSO2
 
RedisConf18 - Scaling Whitepages With Redison Flash
RedisConf18 - Scaling Whitepages With Redison FlashRedisConf18 - Scaling Whitepages With Redison Flash
RedisConf18 - Scaling Whitepages With Redison Flash
Redis Labs
 
ProdSec: A Technical Approach
ProdSec: A Technical ApproachProdSec: A Technical Approach
ProdSec: A Technical Approach
Jeremy Brown
 

What's hot (20)

Cortana Analytics Workshop: The "Big Data" of the Cortana Analytics Suite, Pa...
Cortana Analytics Workshop: The "Big Data" of the Cortana Analytics Suite, Pa...Cortana Analytics Workshop: The "Big Data" of the Cortana Analytics Suite, Pa...
Cortana Analytics Workshop: The "Big Data" of the Cortana Analytics Suite, Pa...
 
AWS re:Invent 2016: Fireside chat with Groupon, Intuit, and LifeLock on solvi...
AWS re:Invent 2016: Fireside chat with Groupon, Intuit, and LifeLock on solvi...AWS re:Invent 2016: Fireside chat with Groupon, Intuit, and LifeLock on solvi...
AWS re:Invent 2016: Fireside chat with Groupon, Intuit, and LifeLock on solvi...
 
Accelerate Business Agility with PaaS
Accelerate Business Agility with PaaS Accelerate Business Agility with PaaS
Accelerate Business Agility with PaaS
 
RightScale Webinar: Successfully Deploy Your Windows Workloads
RightScale Webinar: Successfully Deploy Your Windows WorkloadsRightScale Webinar: Successfully Deploy Your Windows Workloads
RightScale Webinar: Successfully Deploy Your Windows Workloads
 
WSO2 Intro Webinar - Simplifying Enterprise Integration with Configurable WS...
WSO2 Intro Webinar -  Simplifying Enterprise Integration with Configurable WS...WSO2 Intro Webinar -  Simplifying Enterprise Integration with Configurable WS...
WSO2 Intro Webinar - Simplifying Enterprise Integration with Configurable WS...
 
O365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis Jugo
O365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis JugoO365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis Jugo
O365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis Jugo
 
Office 365 Best Practices That You Are Not Thinking About
Office 365 Best Practices That You Are Not Thinking AboutOffice 365 Best Practices That You Are Not Thinking About
Office 365 Best Practices That You Are Not Thinking About
 
Real time data ingestion and Hybrid Cloud
Real time data ingestion and Hybrid CloudReal time data ingestion and Hybrid Cloud
Real time data ingestion and Hybrid Cloud
 
Building a Data Hub that Empowers Customer Insight (Technical Workshop)
Building a Data Hub that Empowers Customer Insight (Technical Workshop)Building a Data Hub that Empowers Customer Insight (Technical Workshop)
Building a Data Hub that Empowers Customer Insight (Technical Workshop)
 
How DataStax Enterprise and Azure Make Your Apps Scale from Day 1
How DataStax Enterprise and Azure Make Your Apps Scale from Day 1How DataStax Enterprise and Azure Make Your Apps Scale from Day 1
How DataStax Enterprise and Azure Make Your Apps Scale from Day 1
 
Microsoft certified azure developer associate
Microsoft certified azure developer associateMicrosoft certified azure developer associate
Microsoft certified azure developer associate
 
The Art of Intelligence – Introduction Machine Learning for Java professional...
The Art of Intelligence – Introduction Machine Learning for Java professional...The Art of Intelligence – Introduction Machine Learning for Java professional...
The Art of Intelligence – Introduction Machine Learning for Java professional...
 
Webinar: Bitcoins and Blockchains - Emerging Financial Services Trends and Te...
Webinar: Bitcoins and Blockchains - Emerging Financial Services Trends and Te...Webinar: Bitcoins and Blockchains - Emerging Financial Services Trends and Te...
Webinar: Bitcoins and Blockchains - Emerging Financial Services Trends and Te...
 
RedisConf18 - Scaling Whitepages With Redison Flash
RedisConf18 - Scaling Whitepages With Redison FlashRedisConf18 - Scaling Whitepages With Redison Flash
RedisConf18 - Scaling Whitepages With Redison Flash
 
Introducing Apache Kafka and why it is important to Oracle, Java and IT profe...
Introducing Apache Kafka and why it is important to Oracle, Java and IT profe...Introducing Apache Kafka and why it is important to Oracle, Java and IT profe...
Introducing Apache Kafka and why it is important to Oracle, Java and IT profe...
 
Blockchain for the DBA and Data Professional
Blockchain for the DBA and Data ProfessionalBlockchain for the DBA and Data Professional
Blockchain for the DBA and Data Professional
 
ProdSec: A Technical Approach
ProdSec: A Technical ApproachProdSec: A Technical Approach
ProdSec: A Technical Approach
 
Kengo Horiuchi, SaaS Business Born in the Cloud :: AWS Partner Techshift
Kengo Horiuchi, SaaS Business Born in the Cloud :: AWS Partner Techshift Kengo Horiuchi, SaaS Business Born in the Cloud :: AWS Partner Techshift
Kengo Horiuchi, SaaS Business Born in the Cloud :: AWS Partner Techshift
 
AWS Summit 2013 | Auckland - Building Web Scale Applications with AWS
AWS Summit 2013 | Auckland - Building Web Scale Applications with AWSAWS Summit 2013 | Auckland - Building Web Scale Applications with AWS
AWS Summit 2013 | Auckland - Building Web Scale Applications with AWS
 
Reporting from the Trenches: Intuit & Cassandra
Reporting from the Trenches: Intuit & CassandraReporting from the Trenches: Intuit & Cassandra
Reporting from the Trenches: Intuit & Cassandra
 

Similar to Can Your Mobile Infrastructure Survive 1 Million Concurrent Users?

Cloud computing elisheba wiggins
Cloud computing elisheba wigginsCloud computing elisheba wiggins
Cloud computing elisheba wiggins
Elisheba Wiggins
 
How to Choose a Host for a Big Data Project
How to Choose a Host for a Big Data ProjectHow to Choose a Host for a Big Data Project
How to Choose a Host for a Big Data Project
Peak Hosting
 
RapidScale CloudServer
RapidScale CloudServerRapidScale CloudServer
RapidScale CloudServer
RapidScale
 
Webinar: Digital Transformation With Integration Platform as a Service (iPaaS)
Webinar: Digital Transformation With Integration Platform as a Service (iPaaS)Webinar: Digital Transformation With Integration Platform as a Service (iPaaS)
Webinar: Digital Transformation With Integration Platform as a Service (iPaaS)
APPSeCONNECT
 
Right scale enterprise solution
Right scale enterprise solution Right scale enterprise solution
Right scale enterprise solution
Brad , Yun Lee
 

Similar to Can Your Mobile Infrastructure Survive 1 Million Concurrent Users? (20)

Demystifying Data Warehouse as a Service (DWaaS)
Demystifying Data Warehouse as a Service (DWaaS)Demystifying Data Warehouse as a Service (DWaaS)
Demystifying Data Warehouse as a Service (DWaaS)
 
Horses for Courses: Database Roundtable
Horses for Courses: Database RoundtableHorses for Courses: Database Roundtable
Horses for Courses: Database Roundtable
 
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at DatabricksLessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
 
Cloud computing elisheba wiggins
Cloud computing elisheba wigginsCloud computing elisheba wiggins
Cloud computing elisheba wiggins
 
IBM Cloud Day January 2021 - A well architected data lake
IBM Cloud Day January 2021 - A well architected data lakeIBM Cloud Day January 2021 - A well architected data lake
IBM Cloud Day January 2021 - A well architected data lake
 
Dave Nielsen - the economically unstoppable cloud
Dave Nielsen - the economically unstoppable cloudDave Nielsen - the economically unstoppable cloud
Dave Nielsen - the economically unstoppable cloud
 
Security in the cloud Workshop HSTC 2014
Security in the cloud Workshop HSTC 2014Security in the cloud Workshop HSTC 2014
Security in the cloud Workshop HSTC 2014
 
How to Choose a Host for a Big Data Project
How to Choose a Host for a Big Data ProjectHow to Choose a Host for a Big Data Project
How to Choose a Host for a Big Data Project
 
RapidScale CloudServer
RapidScale CloudServerRapidScale CloudServer
RapidScale CloudServer
 
How Data Drives Business at Choice Hotels
How Data Drives Business at Choice HotelsHow Data Drives Business at Choice Hotels
How Data Drives Business at Choice Hotels
 
Sage Summit 2012: Cloud Computing for Accountants
Sage Summit 2012: Cloud Computing for AccountantsSage Summit 2012: Cloud Computing for Accountants
Sage Summit 2012: Cloud Computing for Accountants
 
Webinar: Digital Transformation With Integration Platform as a Service (iPaaS)
Webinar: Digital Transformation With Integration Platform as a Service (iPaaS)Webinar: Digital Transformation With Integration Platform as a Service (iPaaS)
Webinar: Digital Transformation With Integration Platform as a Service (iPaaS)
 
KoprowskiT_SQLSatDenmark_WASDforBeginners
KoprowskiT_SQLSatDenmark_WASDforBeginnersKoprowskiT_SQLSatDenmark_WASDforBeginners
KoprowskiT_SQLSatDenmark_WASDforBeginners
 
Right scale enterprise solution
Right scale enterprise solution Right scale enterprise solution
Right scale enterprise solution
 
Right scale enterprise solution
Right scale enterprise solution Right scale enterprise solution
Right scale enterprise solution
 
Serverless Computing: Driving Innovation and Business Value
Serverless Computing: Driving Innovation and Business ValueServerless Computing: Driving Innovation and Business Value
Serverless Computing: Driving Innovation and Business Value
 
Azure Comsos DB Use Cases
Azure Comsos DB Use CasesAzure Comsos DB Use Cases
Azure Comsos DB Use Cases
 
harish_resume
harish_resumeharish_resume
harish_resume
 
MySQL@king
MySQL@kingMySQL@king
MySQL@king
 
(ENT211) Migrating the US Government to the Cloud | AWS re:Invent 2014
(ENT211) Migrating the US Government to the Cloud | AWS re:Invent 2014(ENT211) Migrating the US Government to the Cloud | AWS re:Invent 2014
(ENT211) Migrating the US Government to the Cloud | AWS re:Invent 2014
 

More from TechWell

More from TechWell (20)

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and Recovering
 
Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization
 
Test Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTest Design for Fully Automated Build Architecture
Test Design for Fully Automated Build Architecture
 
System-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartSystem-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good Start
 
Build Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyBuild Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test Strategy
 
Testing Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTesting Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for Success
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlow
 
Develop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityDevelop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your Sanity
 
Ma 15
Ma 15Ma 15
Ma 15
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps Strategy
 
Transform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTransform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOps
 
The Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipThe Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—Leadership
 
Resolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsResolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile Teams
 
Pin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GamePin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile Game
 
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsAgile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
 
A Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationA Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps Implementation
 
Databases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessDatabases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery Process
 
Mobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateMobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to Automate
 
Cultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessCultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for Success
 
Turn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTurn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile Transformation
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Recently uploaded (20)

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 

Can Your Mobile Infrastructure Survive 1 Million Concurrent Users?

  • 3. CAN YOUR MOBILE INFRASTRUCTURE SURVIVE 1 MILLION CONCURRENT USERS? Siva Katir PlayFab, Inc Mobile Dev + Test 2016 Don’t be your own worst enemy! The Simpsons: Tapped Out launched by EA in 2012 Backend was so unprepared for massive loads of traffic it was pulled for FIVE months for total redesign Went on to become a huge and long- lasting hit in the market for many years afterwards Can your company afford to add an extra 5 months to the development cycle? Including lost marketing and promotional spend? Including lost mindshare? Including bad press?
  • 4. Be your own guardian angel! Loadout launched on Steam by Edge of Reality 500x increase in players overnight on being featured in Steam store EC2 auto-scaled in atomic and replaceable servers instantly to handle load No downtime, no panic, no fires DO YOU EVEN NEED A BACKEND? Maybe! Maybe not!
  • 5. What can my backend do for me? Push updates without going through full certification process • New artwork? No problem! • Message of the day! • In-app purchase promotions! Improve customer service • Have an authoritative source for what a client ‘has’ • Direct access to grant entitlements to remediate issues What can my backend do for me? Support a single user across multiple devices • Recover a user’s session even if they lose or replace their device • Continue the same session across multiple devices (phone to tablet) Perform ‘trusted’ transactions (especially around receipt verification) • Clients are untrustworthy! • Client-to-Provider transaction can only say if a receipt is valid, NOT if a receipt is valid for your app
  • 6. Know Your Project What is your budget? • What does it cost to host? • What does it cost to run? Who are your engineers? • Do you have the in-house expertise to manage all services? • DevOps? Backend? Whole-Stack? Front-End? • Are they willing to be on-call 24x7? What do you need to put in the cloud? Why? Know Your Data What data are you storing? • User data • Group data • Application data How does each piece of data need to be queried? • Can all data be looked up by a key? • Need to do arbitrary field queries? Is the data read and/or write heavy? How much data do you expect to store per user?
  • 7. BUILDING A BACKEND 101 Not taught in schools! Pick a Cloud Provider Is your language well supported in your provider? How much self management is required for each service? How well is scalability built in? Do you have region requirements? • European data protection laws • Russia and China have special data laws
  • 8. Large Needs or Small Needs? Database + basic CRUD APIs? • AWS Lambda! Complex data + user management? • AWS Mobile or Azure Mobile Services! Highly custom requirements? • Roll your own on a public cloud (PROCEED WITH CAUTION!) Storing and Retrieving Data Know your databases strength • MySQL – Very easy to get started with and widely supported • MS-SQL – Powerful query engine and incredibly performant • MongoDB – Can query against arbitrary fields • DynamoDB – Very easy scaling and fast random access Know their weaknesses too • MySQL – very hard to scale • MS-SQL – still pretty hard to scale • MongoDB – very hard to scale correctly and maintain data integrity • DynamoDB – can only query against predefined indexes cost effectively
  • 9. Storing and Retrieving Data Novel solutions to database shortcomings • Use multiple databases to take advantage of their individual strengths • Example: Store “index” data in SQL, while using DynamoDB for actual data storage which clients use • Allows you to store all data without needing to scale a difficult to scale database Keys: • Have a way to reliably update the SQL database out of the user’s flow • Don’t treat the SQL store as authoritative • Some tools can make this entirely seamless, such as using DynamoDB write streams and Lambda to update SQL through SQL: { “playerId”: 00001 “purchaseId”: 1002092, “purchaseValue”: 0.99, “purchaseDate”: 03/01/2016 09:01:05 } DyanamoDB: { “playerId”: 00001, “purchaseId”: 1002092, “purchasedItems”: [{ “itemName”: ”in_app_1”, “purchasePrice”: 0.99 }] } SELECT purchaseId, purchaseValue FROM sqlPurchaseTable WHERE purchaseDate > 3/1/2016 Plan For Failure Design for the worst, hope for the best • Any machine can go down at any time • No machine should be ‘special’ If any machine can go down then any machine can also be brought up Architect-in failure behavior both up and down the stack • DB times out? • Web server disk fails? • Third-party provider goes down? http://gunshowcomic.com/648
  • 10. COMMON PITFALLS It’s a trap! Saving Data Remote != Local Do: • Save only changed data • Save data in batches • Prepare for connection failures • Prepare for client failures • Prepare for server failures Don’t: • Save on a timer (unless it’s retrying) • Save duplicated data • Expect it to work • Make assumptions on if it worked http://cloudtweaks.com/
  • 11. Loading Data Easy Wins • Client: • Pre-load data during idle times • Cache locally • Assume data can fail to be loaded • Assume data can arrive corrupted or out of order • Assume it will load slow • If security matters, connect via SSL • Don’t connect directly to the data store • Server: • Cache data that is OK to serve stale • Design data schemas to make each request perform as few queries as possible • Design authorization in such a way to prevent any, or at least limit any extra queries Easy Fails • Trying to implement a custom SSL service • Trying to be clever with caching • Assuming anything will work on the first try Scalability Don’t optimize early • Actually know what your bottlenecks are; most likely it is NOT string handling! • Run a realistic load test with a profiler to get actual useful data Don’t run blind • Know your KPIs before launch • Track your KPIs realtime via counters with DataDog, Cloudwatch ect • Set up alerting to your DRI
  • 12. Scalability Know what infrastructure to scale and when • Data • API servers • Load balancers Design to scale horizontally, not vertically • All services should be stateless unless they don’t need to scale with number of users • Don’t assume a server will exist minute to minute Keep a safe capacity margin in your infrastructure • 50% is reasonable • Know how long it will take to increase capacity Managing Connections Use connection pooling Don’t try to outsmart your language’s connection management Making a connection has a cost! Don’t re-invent a protocol if an existing one will do • HTTP is way easier to debug than websockets • Websockets stream data way more efficiently than HTTP • Both are safer than using raw TCP