A brief high-level introduction to TouchDB, and more generally why you want to keep the network off your app's critical path by using a sync engine to do the networking for you.
Originally presented at the Silicon Valley iOS Developers' Meetup.
library – No finicky schema – “Property-‐lists on steroids!” (aka all-‐JSON) • A powerful data-‐sync engine – AutomaNc caching & offline support – Share content with other users
library – No finicky schema – “Property-‐lists on steroids!” (aka all-‐JSON) • A powerful data-‐sync engine – AutomaNc caching & offline support – Share content with other users • OpNmized for mobile apps – Under 500k code size (iOS) – IniNalizes in < 100ms
library – No finicky schema – “Property-‐lists on steroids!” (aka all-‐JSON) • A powerful data-‐sync engine – AutomaNc caching & offline support – Share content with other users • OpNmized for mobile apps – Under 500k code size (iOS) – IniNalizes in < 100ms • Open Source
library – No finicky schema – “Property-‐lists on steroids!” (aka all-‐JSON) • A powerful data-‐sync engine – AutomaNc caching & offline support – Share content with other users • OpNmized for mobile apps – Under 500k code size (iOS) – IniNalizes in < 100ms • Open Source • A be*er approach to networking for apps
they first build a distributed applicaNon, makes the following eight assumpNons. All prove to be false in the long run and all cause big trouble and painful learning experiences.” – 1. The network is reliable. – 2. Latency is zero. – 3. Bandwidth is infinite. – 4. The network is secure. […] – 8. The network is homogeneous. Peter Deutsch, Sun Microsystems, 1994 Wikipedia: Fallacies_of_Distributed_CompuJng
manages “documents” – Arbitrary JSON content – Can contain large binary afachments – Conflict management (versioning) • It lets you query them – Map/reduce “views” – Schemaless, highly flexible • It syncs them for you – Whenever the network’s available – All data or filtered – ConNnuous, live updates without blocking your UI
A T A blah blah blah blah blah blah blah blah 1. Create a local database 2. Set the remote URL to sync with 3. Populate your UI from the local data 4. Use KVO & bindings to update the UI
A T A blah blah blah blah blah blah blah blah 1. Create a local database 2. Set the remote URL to sync with 3. Populate your UI from the local data 4. Use KVO & bindings to update the UI
A T A blah blah blah blah blah blah blah blah 1. Create a local database 2. Set the remote URL to sync with 3. Populate your UI from the local data 4. Use KVO & bindings to update the UI
A T A blah blah blah blah blah blah blah blah 1. Create a local database 2. Set the remote URL to sync with 3. Populate your UI from the local data 4. Use KVO & bindings to update the UI 5. Write changes back to the local db
A T A blah blah blah blah blah blah blah blah 1. Create a local database 2. Set the remote URL to sync with 3. Populate your UI from the local data 4. Use KVO & bindings to update the UI 5. Write changes back to the local db TouchDB
A T A blah blah blah blah blah blah blah blah 1. Create a local database 2. Set the remote URL to sync with 3. Populate your UI from the local data 4. Use KVO & bindings to update the UI 5. Write changes back to the local db TouchDB
blah blah blah blah TouchDB Peer-‐to-‐Peer Syncing With TouchDB 20 Your App TouchDB D A T A blah blah blah blah blah blah blah blah TouchDB TouchDB Sync Sync
data store • Easy data networking & syncing • All open source, no proprietary layers • Cross-‐plaporm • MulN-‐user • MulNple server opNons: – Hosted – Run your own – Desktop – Peer-‐to-‐peer