designing and implementing a multiuser apps platform

Post on 11-May-2015

1.787 Views

Category:

Technology

5 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Designing &Implementing

a MultiuserApps Platform

Hi I’mEd Anuff

apigee

Apigee

API ManagementAPI AnalyticsAPI Tools

Usergrid

Backend-as-a-Service& Open Source

Mobile andRich client apps

App, Cloud, & HTTP

No Web Stack

PageTemplatesMVC Logic

Database

Just Apps and APIsUser Management! Datastore!

Location!

Messaging!

Social Graph!

Analytics!

Activity Streams!

What do wereally 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/selena

/users/ed/likes/foods/pizza

GET /restaurants?near=37.803, -122.404

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

POST/users/me/activities

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

GET /users/me/feed

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

postUserActivity(me,activity)

[clientpostUserActivity:“me” activity:activityObj]

/token?grant_type=...

/auth/facebook?fb_access_token=…

/users?filter=facebook.first_nameeq 'john'

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

That’s whatUsergrid is.

Building aPush-ButtonPlatform

Not about singleapps

PageTemplatesMVC Logic

Database

Not about singleapps

PageTemplatesMVC Logic

Database

Lots of Teams...

Team Team Team

Lots of Apps...

Team

App App App

And App Users...

Team

App

And data anddevices

Team

App

It’s really hard tobuild for this...

It’s about seamlessdata sharding...

and designing forunpredicable APItraffic...

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

So, what’s inside?

The usual stuff...

JVMJavaSpringJerseyJacksonCassandra

JVMJavaSpringJerseyJacksonCassandra ???

Cassandra shouldbe the only one thatgives you pause

What else could Ihave used?

MySQL?Oracle?MongoDB?

App

Team Team Team

App App App App App

Not so hot for this...

Lame Hmm

No Ugh

Separate Database Shared DatabaseSe

para

teSc

hem

aSh

ared

Sche

ma

CREATEDATABASE

ALTERTABLE

Sharding SQL is toomuch work.

Oracle is too muchmoney.

Most NoSQL worksat the wrongabstraction level.

So Cassandra...

Cassandra sucks.

But you can teach itgreat tricks.

Everything you hateabout Cassandra

I love

Build your ownindexes!

Build your ownquery system!

Build your ownstorage format!

Build your ownmulti-tenancystrategy!

Time to assemble:

2 months

Times I’ve regretteddoing this:

0

What else sucked?

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

1. Consistency

ZooKeeper andAmazonWhitepapers won’tsave you

2. API Design

“Surrender to aHigher Power(whatever it mightbe)”

All hail Roy Fielding

REST drove thedesign

REST drove thescalability

REST drove thescalabilityAccess Model

REST drove thescalabilityAccess Model

Query Model

REST drove thescalabilityAccess Model

Query Model

Denormalization Strategy

3. Permissions

3. Permissions

OAuthTokenManagementPer-requestOverhead

4. Built-in Logic

4. Built-in Logic

Sign-in Flows

Activity Streams

User/Group Management

5. Operations

TomcatTomcatTomcatTomcat

Tomcat Tomcat Tomcat

Cassandra Cluster

Keep it simple andelastic

Runningwith it.

Projects havea will of their own

Counters

Logs

Admin UI

HyperMedia API

SenchajQueryBackbonePhoneGapTiggzi

What do wewant in 2013?

Take it for grantedand run with it.

Use the ideasUse the codeUse the cloud

usergrid.comgit.io/usergrid

Mobile Client

Mobile Experience

API

Web Version

Building apps in2005was very different

LAMPis not multi-tenant

LAMPis not multi-server

LAMPdoes too little

LAMPdoes too much

Rails, Django, Nodedon’t change theoverall architecture

NOSQL works at thewrong abstractionlevel.

PaaS is still thesame thing(to some extent)

top related