Cloud sync APIs for
mobile developers
Leah Culver, Dropbox
APIDays Mediterranea 2014
Slide 2
Slide 2 text
Dropbox
“Your [digital] stuff everywhere”
Slide 3
Slide 3 text
Wherever you are
Slide 4
Slide 4 text
Safe and secure
Slide 5
Slide 5 text
Share with friends
Slide 6
Slide 6 text
• Filesystem that just works
• “The magic folder”
Then
Slide 7
Slide 7 text
• Multi-device world
• Mobile filesystem?
Now
Slide 8
Slide 8 text
Dropbox APIs for mobile apps
Slide 9
Slide 9 text
Core API
• REST-ish, OAuth 2.0, JSON
• SDKs for Android, iOS, OS X,
Python, Ruby, Java, PHP
• Community-supported libraries
for C#, JavaScript, Perl, etc.
HTTP API for files
Slide 10
Slide 10 text
• List files
/metadata//
• Upload file
/files_put//
• Get a thumbnail
/thumbnails//
• Share via a link
/shares//
Core API
Slide 11
Slide 11 text
Core API is great. So what now?
Slide 12
Slide 12 text
• Cross-platform support
• Sync across devices
• Offline access (bonus!)
Mobile API challenges
Slide 13
Slide 13 text
Sync API
Slide 14
Slide 14 text
Sync API
• Just like Core API
• Filesystem for mobile apps
• Store and sync photos, videos, etc.
Slide 15
Slide 15 text
• iOS, Android, OSX
• Handle offline caching and syncing
• Notifications of changes
• Updates in real time
Sync SDKs
Slide 16
Slide 16 text
Image Grid Sample
(demo)
Slide 17
Slide 17 text
Sample code
Slide 18
Slide 18 text
Great for files… but what about data?
Slide 19
Slide 19 text
Sync API
file system-like interface
Datastore API
structured data
Mobile APIs
Slide 20
Slide 20 text
Datastore API
• Storage for structured data
• Like a NoSQL database
• Stored in the user’s Dropbox
• Not files!
Slide 21
Slide 21 text
account→datastore→table→record→field→value
Datastore API
Slide 22
Slide 22 text
Why not files?
Monolithic → inefficient syncing
Opaque → conflicts
Slide 23
Slide 23 text
Why not files?
• Clearly defined structure
• More efficient syncing
• Advanced conflict resolution
Slide 24
Slide 24 text
Similar to Sync SDKs …
• iOS, Android, OSX, JavaScript, Python
• Handles offline caching and syncing
• Notifications of changes
• Updates in real time
Slide 25
Slide 25 text
Store data in user’s own Dropbox
!
• User owns their data
• Access to files/data outside your app
• Free for developers
Slide 26
Slide 26 text
Dropbox 2048
Slide 27
Slide 27 text
No content
Slide 28
Slide 28 text
2048
• JavaScript game (now mobile too)
• High score and game state
saved via cookies
• Very fun (and addictive!)
Slide 29
Slide 29 text
Dropbox 2048
• Save data in user’s Dropbox
• Top 3 high scores
• Current game state
• Syncs between different browsers
Slide 30
Slide 30 text
No content
Slide 31
Slide 31 text
pretty blue colors
high scores
Slide 32
Slide 32 text
No content
Slide 33
Slide 33 text
No content
Slide 34
Slide 34 text
github.com/leah/2048
Code
Slide 35
Slide 35 text
Sync and Datastore API
Version 3.0
• New datastore properties
• Named datastores
• Batching file-system operations
• Better error handling
• And more…
Slide 36
Slide 36 text
Local datastores
(preview feature)
Slide 37
Slide 37 text
• Cross-platform SDKs
• Both files and data
• Users’ own Dropbox
• Handles offline access, sync,
and conflict resolution
TL;DL