42
Usergrid Open Source Mobile Backend on Cassandra

Open Source Mobile Backend on Cassandra

Embed Size (px)

DESCRIPTION

Video online on YouTube at http://youtu.be/RuJwIBu3jvs

Citation preview

Page 1: Open Source Mobile Backend on Cassandra

Usergrid

Open Source Mobile Backend on Cassandra

Page 2: Open Source Mobile Backend on Cassandra

Hi I’mEd Anuff

Page 3: Open Source Mobile Backend on Cassandra

API ManagementAPI AnalyticsAPI Tools

Page 4: Open Source Mobile Backend on Cassandra

Usergrid

Backend-as-a-Service& Open Source

Mobile andRich client apps

Page 5: Open Source Mobile Backend on Cassandra

App, Cloud, & HTTP

Page 6: Open Source Mobile Backend on Cassandra

No Web Stack

Page

MVC Logic

Database

Page 7: Open Source Mobile Backend on Cassandra

Just Apps and APIs

User Management! Datastore!

Location!

Messaging!

Social Graph!

Analytics!

Activity Streams!

Page 8: Open Source Mobile Backend on Cassandra

Key Capabilities

A platform not a single appFlexible data modelEasy to use from any language

Page 9: Open Source Mobile Backend on Cassandra

Why should Cassandra developers care about Usergrid?

Page 10: Open Source Mobile Backend on Cassandra

Open Source (APLv2)Built on HectorMulti-tenant (Virtual Keyspaces)JSON and full-text indexingRich permissions modelREST API

Page 11: Open Source Mobile Backend on Cassandra

Multi-tenant data for Apps

Page 12: Open Source Mobile Backend on Cassandra

Lots of Teams...

Team Team Team

Page 13: Open Source Mobile Backend on Cassandra

Lots of Apps...

Team

App App App

Page 14: Open Source Mobile Backend on Cassandra

And App Users...

Team

App

Page 15: Open Source Mobile Backend on Cassandra

And data and devices

Team

App

Page 16: Open Source Mobile Backend on Cassandra

App

Team Team Team

App App App App App

Multi-tenancy at scale

Page 17: Open Source Mobile Backend on Cassandra

- Scalability+ Isolation+ Simple

+ Scalability- No Isolation- Complicated

- Scalability+ Isolation

+ Not Complicated

- Scalability- No Isolation- Complicated

Separate Database Shared DatabaseSe

para

teSc

hem

aSh

ared

Sche

ma

Page 18: Open Source Mobile Backend on Cassandra

CREATE DATABASE

ALTER TABLE

Page 19: Open Source Mobile Backend on Cassandra

Sharding SQL is too much work.

Oracle is too much money.

Page 20: Open Source Mobile Backend on Cassandra

What about NoSQL?

Most NoSQL works at the wrong abstraction level.

Page 21: Open Source Mobile Backend on Cassandra

Does Cassandra provide any more options?

Sort of

Page 22: Open Source Mobile Backend on Cassandra

Expensive Interesting

Very Expensive Unwieldy

Separate Keyspace Shared KeyspaceSe

para

teSc

hem

aSh

ared

Sche

ma

Page 23: Open Source Mobile Backend on Cassandra

How would Shared Schema/Shared Keyspace work?

Page 24: Open Source Mobile Backend on Cassandra

Users = { "4e3c0423-…" : { username: "edanuff", email: "[email protected]", … : … }, "e5d61f2b-…" : { username: "jdoe", email: "[email protected]", … : … }}

Page 25: Open Source Mobile Backend on Cassandra

Users = { "4e3c0423-…" : { username: "edanuff", email: "[email protected]", … : … }, "e5d61f2b-…" : { username: "jdoe", email: "[email protected]", … : … }}

Page 26: Open Source Mobile Backend on Cassandra

Conventional Row Keys In Single Keyspace

Row UUID

Row UUID

Row UUID

Row UUID

Row UUID

Row UUID

Page 27: Open Source Mobile Backend on Cassandra

Tenant ID Row UUID

Multi-tenant Row Keys In Shared Keyspace

Tenant ID Row UUID

Tenant ID Row UUID

Tenant ID Row UUID

Tenant ID Row UUID

Tenant ID Row UUID

Page 28: Open Source Mobile Backend on Cassandra

“Wonderful, more things for me to build myself in the app tier...”

Hold that thought...

Page 29: Open Source Mobile Backend on Cassandra

Shared Schema/Shared Keyspace is “Virtual Keyspaces”

Part of Hector Client

Page 30: Open Source Mobile Backend on Cassandra

public static <E> KeyspacecreateVirtualKeyspace(String keyspace,E keyPrefix,Serializer<E> kps,Cluster cluster);

Page 31: Open Source Mobile Backend on Cassandra

Hector hides the Tenant Prefixes

Hector Cassandra

Prepend Tenant UUID

Remove Tenant UUID

Page 32: Open Source Mobile Backend on Cassandra

What about indexes?

Hector doesn’t filter resultsDon’t add a tenant columnApp-tier CF indexes preferable

Page 33: Open Source Mobile Backend on Cassandra

What about CQL?See previous slide for index limitationsHector doesn’t currently support Virtual Keyspaces via CQLI don’t actually ever use CQL

Page 34: Open Source Mobile Backend on Cassandra

So what else is in there?

Page 35: Open Source Mobile Backend on Cassandra

JSON

Full JSON values, fully indexed, using Jackson and stuff from Lucene

Page 36: Open Source Mobile Backend on Cassandra

Permissions

Fine grained, per user, built on Shiro

Page 37: Open Source Mobile Backend on Cassandra

REST

Full REST API, built on Jersey

Page 38: Open Source Mobile Backend on Cassandra

Anything else?

Page 39: Open Source Mobile Backend on Cassandra

Mongo Compatible API

Experimental Mongo API emulation via Netty

Mongo binary wire protocol compatible

Page 40: Open Source Mobile Backend on Cassandra

That’s whatUsergrid is.

Page 41: Open Source Mobile Backend on Cassandra

Use the ideasUse the codeUse the cloud

Page 42: Open Source Mobile Backend on Cassandra

usergrid.comgit.io/usergrid

Thanks!