Designing &
Implementing
   a Multiuser
Apps Platform
Hi I’m
Ed Anuff
apigee
Apigee
API Management
API Analytics
API Tools
Usergrid
Backend-as-a-
Service
& Open Source
Mobile and
App, Cloud, & HTTP
No Web Stack

       Page
     Templates
     MVC Logic

     Database
Just Apps and APIs
                  User Management!           Datastore!




    Analytics!                                                      Location!




         Social Graph!                                    Activity Streams!




                                Messaging!
What do we
really want in 2012?
/users
/groups
/users/me/followers
/restaurants
/products
/car-washes
/<whatever>
POST /devices/<id>
POST /events
{ “category” : “ads”,
 “counters” : {
   “ad_clicks” : 5
 }
}
/users/bieber/friends/s
/users/ed/likes/foods/
GET /restaurants?
near=37.803, -
122.404
GET /restaurants?
ql=name contains
‘pizza’ and within
5m of 39.962,-
105.114
POST
/users/me/activities
{ “title”: “look”,
 “location”: …}
GET /users/me/feed
[{ “title”: “Ed ate a
slice of pizza”,
“location”: …}]
postUserActivity(me,
activity)
[client
postUserActivity:
“me” activity:
activityObj]
/token?
grant_type=...
/auth/facebook?
fb_access_token=…
/users?
filter=facebook.first_n
eq 'john'
/users?ql=name eq
'john' and
facebook.education.
school.name
contains '...'
That’s what
Usergrid is.
Building a
Push-Button
Platform
Not about single
apps
        Page
      Templates
      MVC Logic

      Database
Not about single
apps
        Page
      Templates
      MVC Logic

      Database
Lots of Teams...



Team   Team    Team
Lots of Apps...


App     App       App

        Team
And App Users...


       App

       Team
And data and
devices

       App

       Team
It’s really hard to
build for this...
It’s about seamless
data sharding...
and designing for
unpredicable API
traffic...
and it’s about doing
a lot of hard stuff so
other people don’t
have to.
So, what’s inside?
The usual stuff...
JVM
Java
Spring
Jersey
Jackson
Cassandra
JVM
Java
Spring
Jersey
Jackson
Cassandra ???
Cassandra should
be the only one that
gives you pause
What else could I
have used?
MySQL?
Oracle?
MongoDB?
Not so hot for this...


App   App   App   App   App   App

  Team        Team        Team
Schema     Separate Database Shared Database
Shared




                Lame             Hmm
Separate
Schema




                 No               Ugh
CREATE
DATABASE


 ALTER
 TABLE
Sharding SQL is too
much work.
Oracle is too much
money.
Most NoSQL works
at the wrong
abstraction level.
So Cassandra...
Cassandra sucks.
But you can teach it
great tricks.
Everything you hate
about Cassandra
I love
Build your own
indexes!
Build your own
query system!
Build your own
storage format!
Build your own
multi-tenancy
strategy!
Time to assemble:
2 months
Times I’ve regretted
doing this:
0
What else sucked?
1. Consistency
2. API Design
3. Permissions
4. Built-In Logic
5. Operations
1. Consistency
ZooKeeper and
Amazon
Whitepapers won’t
save you
2. API Design
“Surrender to a
Higher Power
(whatever it might
be)”
All hail Roy Fielding
REST drove the
design
REST drove the
scalability
REST drove the
scalability
Access Model
REST drove the
scalability
Access Model
Query Model
REST drove the
scalability
Access Model
Query Model
Denormalization Strategy
3. Permissions
3. Permissions

OAuth
Token
Management
Per-request
Overhead
4. Built-in Logic
4. Built-in Logic

Sign-in Flows
Activity Streams
User/Group Management
5. Operations
Keep it simple and
elastic
                            Tomcat
                           Tomcat
                         Tomcat
                       Tomcat
Tomcat   Tomcat      Tomcat


         Cassandra Cluster
Running
with it.
Projects have
a will of their own
Counters
Logs
Admin UI
HyperMedia API
Sencha
jQuery
Backbone
PhoneGap
Tiggzi
What do we
want in 2013?
Take it for granted
and run with it.
Use the ideas
Use the code
Use the cloud
usergrid.com
git.io/usergrid
Mobile Client
Mobile Experience
API
Web Version
Building apps in
2005
was very different
LAMP
is not multi-tenant
LAMP
is not multi-server
LAMP
does too little
LAMP
does too much
Rails, Django, Node
don’t change the
overall architecture
NOSQL works at the
wrong abstraction
level.
PaaS is still the
same thing
(to some extent)

Designing and Implementing a Multiuser Apps Platform