Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

42
Usergrid Open Source Mobile Backend on Cassandra

Transcript of Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Page 1: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Usergrid

Open Source Mobile Backend on

Cassandra

Page 2: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Hi I’mEd Anuff

Page 3: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

API ManagementAPI AnalyticsAPI Tools

Page 4: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

UsergridBackend-as-a-Service& Open SourceMobile andRich client apps

Page 5: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

App, Cloud, & HTTP

Page 6: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

No Web Stack

Page Templates MVC Logic

Database

Page 7: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Just Apps and APIs

Page 8: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

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

Page 9: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Why should Cassandra developers care about Usergrid?

Page 10: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

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

Page 11: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Multi-tenant data for Apps

Page 12: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Lots of Teams...

Team Team Team

Page 13: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Lots of Apps...

Team

App App App

Page 14: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

And App Users...

Team

App

Page 15: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

And data and devices

Team

App

Page 16: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

App

Team Team Team

App App App App App

Multi-tenancy at scale

Page 17: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

- Scalability + Isolation + Simple

+ Scalability - No Isolation - Complicated

- Scalability + Isolation

+ Not Complicated

- Scalability - No Isolation - Complicated

Separate Database Shared Database Se

para

te

Sche

ma

Shar

ed

Sche

ma

Page 18: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

CREATE DATABASE

ALTER TABLE

Page 19: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Sharding SQL is too much work.Oracle is too much money.

Page 20: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

What about NoSQL?Most NoSQL works at the wrong abstraction level.

Page 21: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Does Cassandra provide any more options?Sort of

Page 22: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Expensive Interesting

Very Expensive Unwieldy

Separate Keyspace Shared Keyspace Se

para

te

Sche

ma

Shar

ed

Sche

ma

Page 23: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

How would Shared Schema/Shared Keyspace work?

Page 24: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

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

"[email protected]", … : … }

}

Page 25: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

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

"[email protected]", … : … }

}

Page 26: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Conventional Row Keys In Single Keyspace

Row UUID

Row UUID

Row UUID

Row UUID

Row UUID

Row UUID

Page 27: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

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: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

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

Page 29: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Shared Schema/Shared Keyspace is “Virtual Keyspaces”Part of Hector Client

Page 30: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

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

Page 31: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Hector hides the Tenant Prefixes

Hector Cassandra

Prepend Tenant UUID

Remove Tenant UUID

Page 32: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

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

Page 33: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

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: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

So what else is in there?

Page 35: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

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

Page 36: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

PermissionsFine grained, per user, built on Shiro

Page 37: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

RESTFull REST API, built on Jersey

Page 38: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Anything else?

Page 39: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Mongo Compatible APIExperimental Mongo API emulation via NettyMongo binary wire protocol compatible

Page 40: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

That’s whatUsergrid is.

Page 41: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

Use the ideasUse the codeUse the cloud

Page 42: Building a Mobile Data Platform with Cassandra - Apigee Under the Hood (Webcast)

usergrid.comgit.io/usergridThanks!