Cloud Save across Platforms & Devices
description
Transcript of Cloud Save across Platforms & Devices
![Page 1: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/1.jpg)
Cloud Save across Platforms & Devices
Peter Heinrich, Technical Evangelist
![Page 2: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/2.jpg)
Games Services,Appstore for Android
![Page 3: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/3.jpg)
![Page 4: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/4.jpg)
Customer Experience
“Amazon.com Core Values: A Customer Experience Obsession” – Flavio Martins, WinTheCustomer!
“Put Buyers First? What a Concept” – Joe Nocera, New York Times
“Amazon's obsession with customers pays off” – Matt Linderman, Signal vs. Noise
“If you do build a great experience, customers tell each other about that. Word of mouth is very powerful.” – Jeff Bezos
![Page 5: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/5.jpg)
Save Customer Game Data!
![Page 6: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/6.jpg)
Mobile Devices
Small $$$ Fragile
Easy to misplace or lose
Often targeted for theft
Easily damaged or broken
![Page 7: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/7.jpg)
Mobile + Cloud, BFFs
DB
![Page 8: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/8.jpg)
Use Cases Get Complicated
?
?
?
![Page 9: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/9.jpg)
Real Money, Real Problems
!
![Page 10: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/10.jpg)
Currency Is Tricky
Don’t allow offline purchases
Allow, but exclude consumables
Support negative balances
Even online devices need to coordinate balance updates between themselves
![Page 11: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/11.jpg)
7205
Time Played across Devices
5 min 7 min 20 min
min
5 5+2 7+13
![Page 12: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/12.jpg)
135, 2, or 13?
Time Played across Devices
5 min 2 min 13 min
min
2 135
![Page 13: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/13.jpg)
7205
Time Played across Devices
5 min 2 min 13 min
min
2 135
![Page 14: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/14.jpg)
Running Totals
Make each client a local authority
Keep subtotals and combine them in the cloud
Return total on demand
Sending deltas in updates is not idempotent
![Page 15: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/15.jpg)
Other Game Data
![Page 16: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/16.jpg)
No Restrictions = Lots of Work
1 2
3
132
Concurrency Control
Sequence
![Page 17: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/17.jpg)
Mergeable DataUses a simple rule for conflict resolution, based on the nature of the data:
High Score – largest / biggest
Best Time – lowest / fastest
Last Monster – most recent
![Page 18: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/18.jpg)
Optimistic Locking
1. Save local timestamp or sequence #
2. Update local value
3. Retrieve remote timestamp / sequence #
A. If local > remote, push to cloud
B. Else, pull from cloud
![Page 19: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/19.jpg)
Conflict Resolution
Model data with mergeable types
Simple rules allow unattended conflict resolution
Nature of data defines rule
Common types: Highest / lowest number, most-recent string
![Page 20: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/20.jpg)
Whispersync for Games
• Queues updates for offline operation
• Automatically resolves conflicts between mobile devices and cloud
• Lightweight API with fast integration
Syncable Types:Number lowest, highest, most recent
String most recent
AccumulatingNumber running totals
NumberList ascending, descending, latest
StringList most recent
StringSet
Map
![Page 21: Cloud Save across Platforms & Devices](https://reader035.fdocuments.in/reader035/viewer/2022062519/568151a9550346895dbfd805/html5/thumbnails/21.jpg)
Learn more: developer.amazon.com
Contact us: forums.developer.amazon.com developer.amazon.com/help/contactus.html
Follow us:@peterdotgames/AmazonAppstoreForAndroiddeveloper.amazon.com/blog