designing and implementing a multiuser apps platform

92
Designing & Implementing a Multiuser Apps Platform

Upload: apigee

Post on 11-May-2015

1.787 views

Category:

Technology


5 download

TRANSCRIPT

Page 1: Designing and Implementing a Multiuser Apps Platform

Designing &Implementing

a MultiuserApps Platform

Page 2: Designing and Implementing a Multiuser Apps Platform

Hi I’mEd Anuff

apigee

Page 3: Designing and Implementing a Multiuser Apps Platform

Apigee

API ManagementAPI AnalyticsAPI Tools

Page 4: Designing and Implementing a Multiuser Apps Platform

Usergrid

Backend-as-a-Service& Open Source

Mobile andRich client apps

Page 5: Designing and Implementing a Multiuser Apps Platform

App, Cloud, & HTTP

Page 6: Designing and Implementing a Multiuser Apps Platform

No Web Stack

PageTemplatesMVC Logic

Database

Page 7: Designing and Implementing a Multiuser Apps Platform

Just Apps and APIsUser Management! Datastore!

Location!

Messaging!

Social Graph!

Analytics!

Activity Streams!

Page 8: Designing and Implementing a Multiuser Apps Platform

What do wereally want in 2012?

Page 9: Designing and Implementing a Multiuser Apps Platform

/users

/groups

/users/me/followers

Page 10: Designing and Implementing a Multiuser Apps Platform

/restaurants/products/car-washes

/<whatever>

Page 11: Designing and Implementing a Multiuser Apps Platform

POST /devices/<id>

Page 12: Designing and Implementing a Multiuser Apps Platform

POST /events

{ “category” : “ads”, “counters” : { “ad_clicks” : 5 }}

}}

Page 13: Designing and Implementing a Multiuser Apps Platform

/users/bieber/friends/selena

/users/ed/likes/foods/pizza

Page 14: Designing and Implementing a Multiuser Apps Platform

GET /restaurants?near=37.803, -122.404

Page 15: Designing and Implementing a Multiuser Apps Platform

GET /restaurants?ql=name contains‘pizza’ and within5m of 39.962,-105.114

Page 16: Designing and Implementing a Multiuser Apps Platform

POST/users/me/activities

{ “title”: “look”, “location”: …}

Page 17: Designing and Implementing a Multiuser Apps Platform

GET /users/me/feed

[{ “title”: “Ed ate aslice of pizza”,“location”: …}]

Page 18: Designing and Implementing a Multiuser Apps Platform

postUserActivity(me,activity)

[clientpostUserActivity:“me” activity:activityObj]

Page 19: Designing and Implementing a Multiuser Apps Platform

/token?grant_type=...

/auth/facebook?fb_access_token=…

Page 20: Designing and Implementing a Multiuser Apps Platform

/users?filter=facebook.first_nameeq 'john'

Page 21: Designing and Implementing a Multiuser Apps Platform

/users?ql=name eq'john' andfacebook.education.school.namecontains '...'

Page 22: Designing and Implementing a Multiuser Apps Platform

That’s whatUsergrid is.

Page 23: Designing and Implementing a Multiuser Apps Platform

Building aPush-ButtonPlatform

Page 24: Designing and Implementing a Multiuser Apps Platform

Not about singleapps

PageTemplatesMVC Logic

Database

Page 25: Designing and Implementing a Multiuser Apps Platform

Not about singleapps

PageTemplatesMVC Logic

Database

Page 26: Designing and Implementing a Multiuser Apps Platform

Lots of Teams...

Team Team Team

Page 27: Designing and Implementing a Multiuser Apps Platform

Lots of Apps...

Team

App App App

Page 28: Designing and Implementing a Multiuser Apps Platform

And App Users...

Team

App

Page 29: Designing and Implementing a Multiuser Apps Platform

And data anddevices

Team

App

Page 30: Designing and Implementing a Multiuser Apps Platform

It’s really hard tobuild for this...

Page 31: Designing and Implementing a Multiuser Apps Platform

It’s about seamlessdata sharding...

Page 32: Designing and Implementing a Multiuser Apps Platform

and designing forunpredicable APItraffic...

Page 33: Designing and Implementing a Multiuser Apps Platform

and it’s about doinga lot of hard stuff soother people don’thave to.

Page 34: Designing and Implementing a Multiuser Apps Platform

So, what’s inside?

The usual stuff...

Page 35: Designing and Implementing a Multiuser Apps Platform

JVMJavaSpringJerseyJacksonCassandra

Page 36: Designing and Implementing a Multiuser Apps Platform

JVMJavaSpringJerseyJacksonCassandra ???

Page 37: Designing and Implementing a Multiuser Apps Platform

Cassandra shouldbe the only one thatgives you pause

Page 38: Designing and Implementing a Multiuser Apps Platform

What else could Ihave used?

MySQL?Oracle?MongoDB?

Page 39: Designing and Implementing a Multiuser Apps Platform

App

Team Team Team

App App App App App

Not so hot for this...

Page 40: Designing and Implementing a Multiuser Apps Platform

Lame Hmm

No Ugh

Separate Database Shared DatabaseSe

para

teSc

hem

aSh

ared

Sche

ma

Page 41: Designing and Implementing a Multiuser Apps Platform

CREATEDATABASE

ALTERTABLE

Page 42: Designing and Implementing a Multiuser Apps Platform

Sharding SQL is toomuch work.

Oracle is too muchmoney.

Page 43: Designing and Implementing a Multiuser Apps Platform

Most NoSQL worksat the wrongabstraction level.

Page 44: Designing and Implementing a Multiuser Apps Platform

So Cassandra...

Page 45: Designing and Implementing a Multiuser Apps Platform

Cassandra sucks.

But you can teach itgreat tricks.

Page 46: Designing and Implementing a Multiuser Apps Platform

Everything you hateabout Cassandra

I love

Page 47: Designing and Implementing a Multiuser Apps Platform

Build your ownindexes!

Page 48: Designing and Implementing a Multiuser Apps Platform

Build your ownquery system!

Page 49: Designing and Implementing a Multiuser Apps Platform

Build your ownstorage format!

Page 50: Designing and Implementing a Multiuser Apps Platform

Build your ownmulti-tenancystrategy!

Page 51: Designing and Implementing a Multiuser Apps Platform

Time to assemble:

2 months

Page 52: Designing and Implementing a Multiuser Apps Platform

Times I’ve regretteddoing this:

0

Page 53: Designing and Implementing a Multiuser Apps Platform

What else sucked?

Page 54: Designing and Implementing a Multiuser Apps Platform

1. Consistency2. API Design3. Permissions4. Built-In Logic5. Operations

Page 55: Designing and Implementing a Multiuser Apps Platform

1. Consistency

ZooKeeper andAmazonWhitepapers won’tsave you

Page 56: Designing and Implementing a Multiuser Apps Platform

2. API Design

Page 57: Designing and Implementing a Multiuser Apps Platform

“Surrender to aHigher Power(whatever it mightbe)”

All hail Roy Fielding

Page 58: Designing and Implementing a Multiuser Apps Platform

REST drove thedesign

Page 59: Designing and Implementing a Multiuser Apps Platform

REST drove thescalability

Page 60: Designing and Implementing a Multiuser Apps Platform

REST drove thescalabilityAccess Model

Page 61: Designing and Implementing a Multiuser Apps Platform

REST drove thescalabilityAccess Model

Query Model

Page 62: Designing and Implementing a Multiuser Apps Platform

REST drove thescalabilityAccess Model

Query Model

Denormalization Strategy

Page 63: Designing and Implementing a Multiuser Apps Platform

3. Permissions

Page 64: Designing and Implementing a Multiuser Apps Platform

3. Permissions

OAuthTokenManagementPer-requestOverhead

Page 65: Designing and Implementing a Multiuser Apps Platform

4. Built-in Logic

Page 66: Designing and Implementing a Multiuser Apps Platform

4. Built-in Logic

Sign-in Flows

Activity Streams

User/Group Management

Page 67: Designing and Implementing a Multiuser Apps Platform

5. Operations

Page 68: Designing and Implementing a Multiuser Apps Platform

TomcatTomcatTomcatTomcat

Tomcat Tomcat Tomcat

Cassandra Cluster

Keep it simple andelastic

Page 69: Designing and Implementing a Multiuser Apps Platform

Runningwith it.

Page 70: Designing and Implementing a Multiuser Apps Platform

Projects havea will of their own

Page 71: Designing and Implementing a Multiuser Apps Platform

Counters

Page 72: Designing and Implementing a Multiuser Apps Platform

Logs

Page 73: Designing and Implementing a Multiuser Apps Platform

Admin UI

Page 74: Designing and Implementing a Multiuser Apps Platform
Page 75: Designing and Implementing a Multiuser Apps Platform

HyperMedia API

Page 76: Designing and Implementing a Multiuser Apps Platform

SenchajQueryBackbonePhoneGapTiggzi

Page 77: Designing and Implementing a Multiuser Apps Platform

What do wewant in 2013?

Page 78: Designing and Implementing a Multiuser Apps Platform

Take it for grantedand run with it.

Page 79: Designing and Implementing a Multiuser Apps Platform

Use the ideasUse the codeUse the cloud

Page 80: Designing and Implementing a Multiuser Apps Platform

usergrid.comgit.io/usergrid

Page 81: Designing and Implementing a Multiuser Apps Platform

Mobile Client

Page 82: Designing and Implementing a Multiuser Apps Platform

Mobile Experience

Page 83: Designing and Implementing a Multiuser Apps Platform

API

Page 84: Designing and Implementing a Multiuser Apps Platform

Web Version

Page 85: Designing and Implementing a Multiuser Apps Platform

Building apps in2005was very different

Page 86: Designing and Implementing a Multiuser Apps Platform

LAMPis not multi-tenant

Page 87: Designing and Implementing a Multiuser Apps Platform

LAMPis not multi-server

Page 88: Designing and Implementing a Multiuser Apps Platform

LAMPdoes too little

Page 89: Designing and Implementing a Multiuser Apps Platform

LAMPdoes too much

Page 90: Designing and Implementing a Multiuser Apps Platform

Rails, Django, Nodedon’t change theoverall architecture

Page 91: Designing and Implementing a Multiuser Apps Platform

NOSQL works at thewrong abstractionlevel.

Page 92: Designing and Implementing a Multiuser Apps Platform

PaaS is still thesame thing(to some extent)