deep dive: strategic importance of baas
TRANSCRIPT
The Strategic Importance of BaaSJeffrey West
Jeffrey West
Who Am I?
• BaaS Engineering Coach at Apigee• 10+ years in Middleware
implementation, integration, development & product management
• Apache Committer
Context
3
4
(m) obileB ackend a saS ervice
Datastore
Push Notifications
Connections /Social
Location
Users
…and more
Application
Building Systems of Engagement with Edge API BaaS
5
Systems of Record
Apigee Edge: Intelligent API Platform
Systems of Engagement
App Developers
DatabaseERPCRM Data �Warehouse Data Lake
Partner AppsConsumer Apps Employee Apps Insights
Systems of Engagement
6
7 ©2015 Apigee. All Rights Reserved.
Web Scale�10’s of thousands requests/sec�…across multiple data centers
Scaling Usergrid to 10,000 Req/s w/ Gatling
• 10k test run:– 35 c3.xlarge Tomcat Nodes– 9 c3.4xlarge C* nodes– 6 m3.large ES nodes
• Closing test ~7,800/s:– 15 c3.xlarge Tomcat Nodes– 9 c3.4xlarge C* nodes– 6 m3.large ES nodes
8
Strategic Value
9
Speed
10
Speed
…to proof of value…to deploy…to change…to ENGAGE
– Customers– Partners– Employees
11 ©2015 Apigee. All Rights Reserved.
How?
12
OrganizationOrganization
Organization
Application
DevicesUsers Groups
Security Roles
CollectionData / Collections
Entity{…}Entity
{…}Entity{…}
Application
DevicesUsers Groups
Security Roles
Entity{…}Entity
{…}Entity{…}
CollectionData / Collections
Entity{…}Entity
{…}Entity{…}
API BaaS – Users, Roles & Security• Organization administrator
accounts
• Registration & Login for your app
• End user credentials
• Organization-level client ID and shared secret
• Application-level client ID and shared secret
• Hierarchical Groups
• Fine-Grained User/Group/Role/Permission model
14
But I just want to store data!
15
REST APIGET / PUT / POST / DELETE
Scalable, Multi-tenant Persistence (Single Cluster)
Apigee API BaaS:Powered by Apache Usergrid
16
• Apache Open Source Mobile Backend as a Service• REST API for easy interaction from any platform• SDKs available for iOS / Android / Javascript
17
http://usergrid.apache.org
The Usergrid Stack
18
Built on Horizontally Scalable Technologies
Built on Horizontally Scalable Technologies
20 ©2015 Apigee. All Rights Reserved.
( )
API-Driven Data Access w/ Query• REST Semantics
– GET, PUT, POST, DELETE• Filtering:
– GET http://api.usergrid.com/MyOrg/MyApp/books?ql=select * where title contains 'ta*'– GET http://api.usergrid.com/MyOrg/MyApp/books?ql=select * where title contains 'tale’– GET http://api.usergrid.com/MyOrg/MyApp/books?ql=select * where title = 'A Tale of Two Cities'
• Limit– GET http://api.usergrid.com/{org}/{app}/{collection}?limit=5&ql=where status='active’
• Location:– GET http://api.usergrid.com/{org}/{app}/{collection}?ql=select * where location within {d} of {x, y}
• Cursors– GET http://api.usergrid.com/MyOrg/MyApp/users?ql=select * where name =
’John*'&limit=50&cursor=LTIxNDg0NDUxNDpnR2tBQVFFQWdITUFDWFJ2YlM1emJXbDBhQUNBZFFBUUQyMVZneExfRWVLRlV3TG9Hc1doZXdDQWRRQVFIYVdjb0JwREVlS1VCd0xvR3NWT0JRQQ
21
Working with Graph & NoSQL Data
22
Graph Data Persistence: Entities & Connections• Entities
– Objects / Documents representing an Entity
• Collections– Logical grouping of Entities
• Connections / Entity Relationships– Graph Data Structure– /{collection}/{entityA}/{verb}/{collection}/{entityB}– /Users/me/likes/Products/iPhone6– /Recipes/Bread/includes/Ingredients/Flour
23
UserA
ProductA
UserB
UserC
Likes>><<Liking
• De-normalization and model the data based on the way you expect to use it. Use connections to reflect relationships (which may or may not be based on “keys”)
• SDKs for seven languages can simplify app development, or just use “curl”, Apache HTTP Client, or your favorite browser tool.
Designing for Apigee Edge API BaaS
24
Device
Device
Device
Device
Notification�Preferences User
Application
Notification�Preferences User
Consent
File Storage: Larger JSON Data & Binary Assets• Purpose: Store binary files such as images, ZIP files and even large JSON
objects which do not need to be indexed
• Files can be attached to any entity:– curl -H "Authorization: Bearer ${TOKEN}" -X POST -F name='max.jpg' -F [email protected] 'https://api.usergrid.com/{org}/{app}/{collection}/{entity}'
• Retrieve your file by specifying a MIME type to accept:– curl -H "Accept: image/jpeg" -H "Authorization: Bearer ${TOKEN}" -X GET -o max_webcast.jpg 'https://api.usergrid.com/{org}/{app}/{collection}/{entity}'
25
Engaging with your Users
26
27
88% of emails are never opened 84% of Facebook posts are never viewed 71% of tweets are never read 98% of SMS/MMS messages are opened and read
Push Notifications• Notification Providers
• Narrowcast / Broadcast– One User’s device– All Devices– All Devices in a Geo– Only iOS / Android
Flexible Notification TargetingPush Notification to 20 Miles of a store location
POST https://api.usergrid.com/jeffreyawest/sandbox/devices;ql=“location within 32186.9 of 34.427514,-118.535013”/notifications
Push Notifications to a group of usersPOST https://api.usergrid.com/jeffreyawest/sandbox/groups/capos/notifications
POST https://api.usergrid.com/jeffreyawest/sandbox/groups/soldiers/notifications
Push Notifications to a group of users in a certain location
POST https://api.usergrid.com/jeffreyawest/sandbox/groups/capos/users;ql=/devices;ql=“location within 32186.9 of 034.427514,-118.535013”/notifications
29
DEMO
30
Roadmap
31
What’s Next for Usergrid
• Grow the community!• Blueprints Driver Release!• Service abstraction• Indexing closer to real-time• Larger Clusters• Distributed Work System• Encryption & Security
32
Application Performance Monitoring from Apigee
33
Q & A
34