In our deep-dive technical series, we look at the strategic importance of having Baas as part of your API Management solution. Apigee Edge API BaaS enables web and mobile app developers to link their apps to a cloud datastore and provide features including user management, push notifications, geolocation services, and more.
2. Jeffrey West
Who Am I?
• BaaS Engineering Coach at Apigee
• 10+ years in Middleware
implementation, integration,
development & product
management
• Apache Committer
4. 4
(m) obile
B ackend
a s
a
S ervice
Datastore
Push
Notifications
Connections /
Social
Location
Users
…and more
Application
5. 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
14. 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
15. But I just want to store data!
15
REST API
GET / PUT / POST / DELETE
Scalable, Multi-tenant
Persistence (Single Cluster)
17. • 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
21. 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=LTIxNDg0NDUxNDpnR2tBQVFFQWdITUFDWFJ2YlM1emJXbDBhQUNBZFF
BUUQyMVZneExfRWVLRlV3TG9Hc1doZXdDQWRRQVFIYVdjb0JwREVlS1VCd0xvR3NWT0JRQQ
21
23. 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
User
A
Product
A
User
B
User
C
Likes>>
<<Liking
24. • 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
25. 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 file=@max.jpg '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
27. 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
28. Push Notifications
• Notification Providers
• Narrowcast / Broadcast
– One User’s device
– All Devices
– All Devices in a Geo
– Only iOS / Android
29. Flexible Notification Targeting
Push 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 users
POST 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
32. 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