Common app pattern
Every user action requires downloading data
• pros: simple to implement,
• cons: poor user experience.
Slide 6
Slide 6 text
"Speed is a
feature"
Slide 7
Slide 7 text
Minimize in-app
latencies...
Slide 8
Slide 8 text
to make your
users happy :)
Slide 9
Slide 9 text
No content
Slide 10
Slide 10 text
Build Faster
Mobile Apps
Slide 11
Slide 11 text
Additional benefits
Besides reacting faster, your app:
1. works off-line,
2. stays up-to-date seamlessly.
Slide 12
Slide 12 text
How does it
work?
Slide 13
Slide 13 text
As simple as 1, 2, 3
1. import your data,
2. drag and drop the Winch iOS framework,
3. call sync() .
Slide 14
Slide 14 text
Concepts
Slide 15
Slide 15 text
In short
Winch is a key-value data store.
“
Slide 16
Slide 16 text
Think of it as...
datastore ~ database
namespace ~ table
key ~ primary key
value ~ data
Slide 17
Slide 17 text
Example:
Snippets for iOS
Slide 18
Slide 18 text
What is Snippets?
• an iOS app to learn and experience your favorite tech on-the-go,
• it works with Redis so far,
• it is open source,
• it is powered by Winch.
Initiated at AngelHack Paris, October 2013.
Slide 19
Slide 19 text
Overview
Slide 20
Slide 20 text
No content
Slide 21
Slide 21 text
No content
Slide 22
Slide 22 text
No content
Slide 23
Slide 23 text
No content
Slide 24
Slide 24 text
Data Model
Slide 25
Slide 25 text
Commands: rds:cmds
• key: command unique ID, e.g "get"
• value: JSON doc with command name, summary, CLI sample, e.g:
{
"name": "GET",
"summary": "Get the value of a key"
"cli":["GET nonexisting",...]
}
01.
02.
03.
04.
05.
Slide 26
Slide 26 text
Groups: rds:groups
• key: integer key, e.g "0003"
• value: JSON doc with group name and related commands, e.g:
{
"name": "Hashes",
"cmds": ["hdel", "hget", ...]
}
01.
02.
03.
04.
Slide 27
Slide 27 text
HTML docs: rds:docs
• key: command unique ID, e.g "get"
• value: HTML fragment, e.g:
GET key
Available since 1.0.0
...
It is used with: [webView loadHTMLString:html baseURL:nil];
01.
02.
03.
Slide 28
Slide 28 text
Model Layer
Slide 29
Slide 29 text
Use Mantle™, by GitHub
Mantle makes it easy to write a simple model layer
for your Cocoa or Cocoa Touch application.
“
Slide 30
Slide 30 text
No content
Slide 31
Slide 31 text
RDSCommand.h
Slide 32
Slide 32 text
RDSCommand.m
Slide 33
Slide 33 text
Winch Category
Slide 34
Slide 34 text
Write app specific helpers
Create a WNCDatabase+MyApp category and
implement custom extensions for your app data
model.
“
Slide 35
Slide 35 text
Overview
Slide 36
Slide 36 text
Sync
Abstract your namespaces under a custom sync method:
Slide 37
Slide 37 text
Fetch
Get a collection of model objects via a single call: