The document discusses building predictive applications using a lambda architecture with batch, speed, and serving layers to handle both historical and real-time data. It provides examples of how Netflix uses this architecture with offline, nearline, and online layers. Finally, it advocates for building applications as microservices with APIs at each tier for isolation, scalability, and independent development.
10. Batch Layer (Offline)
• Singular Value
Decomposition
• Batch like operations
• High algorithm complexity
• Results Flow into Cassandra
11. Speed Layer (Near Line)
11
• Medium request/response!
• Medium data!
• Medium algorithm complexity!
• Intermediate caching,
incremental learning algos!
12. Serving layer (Online)
• Fast request/response,
performance is key – high
availability/SLA
• Fallback mechanism to
Nearline/Offline operations
• Low algorithm complexity
13. Final Thoughts:!
!
• Very complete system!
• Very custom and high performance!
• Lots of specialized systems for
specialized tasks!
• Not practical for most enterprises!
14. Data Scientists & Developers
14
Direct Mail
Email
Web
Mobile
Outreach
How can they work independently ?
18. Isolation at all tiers
18
Batch
Storage
Near RT
Storage
Batch
Processing
(MR)
Near
RealTime
Processing
Query DB
Serving Layer!
APIs
Direct Mail
Email
Web
Mobile
Outreach
Req / Res
Processing
Historical
Events
Recent
Events
Batch
Processing
(MR)
Near
RealTime
Processing
Req / Res
Processing
Batch
Processing
(MR)
Near
RealTime
Processing
Req / Res
Processing
Batch
Processing
(MR)
Near
RealTime
Processing
Req / Res
Processing
Batch
Storage
Near RT
Storage
Query DB
Batch
Storage
Near RT
Storage
Query DB
19. API at all tiers
19
Batch Layer!
Serving Layer!
Speed Layer!
Direct Mail
Email
Web
Mobile
Outreach
/Scores!
/Counts!
/Recommendations!
Historical
Events
Recent
Events
23. Batch Layer
• Uses R for building predictive
models
• Algorithms based on Event
Sequences
• Lots and lots of tooling
23
Hadoop
Insights
(GRASP)
API BaaS
(Batch Scores)
1
Apigee UI
26. Speed Layer
• Easy to program via node.js
• Low algorithm complexity – Storm is overkill for
most Apigee customers
• Simple aggregates via C* counters good enough
• Good for capturing locations, activity stream, etc.
26
Node.js
API BaaS
Apigee UI
27. BaaS Node.js Counter Example
var event = new Usergrid.Counter(event_options, function (error, result) { … });
// Then we POST the event to increment the counter
var counter_options = {
name: productName + ’.add_to_cart',
value: 1
}
event.increment (counter_options, function (error, result)
27
curl -X GET https://api.usergrid.com/my-org/my-app/counters?
counter=appleIpad3.add_to_cart
Input code:
Output code:!
28. Microservices Layer
• API Layer (Swagger)
• Context Injection
• Service Orchestration
• Fallback logic
28
Node.js
Node.js
API BaaS
Direct Mail
Email
Web
Mobile
Outreach
(Context)
Backend
38. API Design is Important
• We have been talking API
design for a long time
• We have an approach that we
like and often recommend
• We believe that it is important to
design APIs carefully, up front
39. My Perspective on API Design
• URIs are important
• Verbs should be used in a consistent way
• Follow common usage
• Links can be helpful
39
42. An API Design Story
• I designed a lovely, consistent API
– In a Google Doc
• The team implemented it
– In Java
• I verified that the implementation matched the doc
– Using my eyeballs
• We wrote docs
– Using information from both places
44. Modern Web / API Frameworks
• Write code
• Get an API up quickly
• API design and code are the same
• Examples:
– Express for Node.js
– Ruby on Rails
– Lots of others
44
45. Another approach: Code First
45
@Path("/my-resource")
@Api(value="/my-resource”,
description="Rest api for do operations on admin",
produces=MediaType.APPLICATION_JSON)
@Produces({ MediaType.APPLICATION_JSON })
class MyResource{
@ApiOperation(value = "Get specific element",
httpMethod = "GET",
notes = "Fetch the selement of the collection",
response = Response.class)
@ApiResponses(value = {
@ApiResponse(code = 200, message = ”Element found"),
@ApiResponse(code = 404, message = “Element not found"),
@ApiResponse(code = 500, message = “Server error due to encoding"),
@ApiResponse(code = 400, message = "Bad request: decoding error"),
@ApiResponse(code = 412, message = ”Prereq: Required data not found")
})
public Response get(
@ApiParam(value = "UUID of the element", required = true)
@PathParam("uuid") String uuid) {
Generate
47. Why Can’t We Do This?
1. Design the API
2. Annotate it with policies
3. Wire it to some back end
4. Run it
48. Swagger 2.0
• Swagger 2.0
• Describes the shape of the API
– URIs
– Verbs
– Query parameters
– Headers
– Request and response formats
48
49. Building a Model in Swagger 2.0
• Specify API design using YAML
– URI Paths
– Verbs
– Parameters
– Request format (optional)
– Response format (optional)
– Error responses (optional)
49
50. Plugging in Code
• Point each API operation to some code
– In our project it is a Node.js module
50
51. Annotating the Model
• The API definition can have “policies”
– OAuth
– Quota
– Spike arresting
– Caching
• Each operation can have parameters
– Quota
– OAuth scope
– Etc.
51
56. How it Works
56
• No code generation
• Model is built at start-up time
• A127 middleware applied as defined in Swagger:
– Caching, Quota, OAuth, Spike Arrest, Analytics, etc.
• Paths and parameters
• Model Definitions
• Vendor Extensions
(middleware)
Interprets Swagger
68. The number of connected devices is set to dramatically increase
68
69. Too Many Devices, Too Few Developers
• Connected Devices • Software Developers
• 2013: 6 Billion
• 2018: 20 Billion
• 333% Increase
Source: Business Insider Intelligence - The
Internet Of Everything: 2014
• 2013: 18 Million
• 2019: 26 Million
• 45% Increase
Source: Evans Data Corporation - Global
Developer Population and Demographic Study
2013
109. 1. From Best Effort to Operation Excellence
109 2015 Apigee Confidential
2. How to quickly build or easily participate to a
Digital Service Ecosystem
110. So you having fun developing solutions using many API’s
110 2015 Apigee Confidential
118. Many service providers are building digital service
ecosystems leveraging their core assets
118 2015 Apigee Confidential
Identity
Powered by
119. Your journey in an Digital Service Ecosystem
119 2015 Apigee Confidential
Product
Definition
Product Offering
Product
Ordering/
Activation
Product Usage
and Mediation
Billing
Invoicing
120. • Trouble ticketing
• Catalog Management
• Product Ordering
• DSRA
No need to reinvent the wheel
120 2015 Apigee Confidential
• Common
Service API’s
• Based on
Open
Standards
UnifiedProfileMgmt
UnifiedIdentityMgmt
ConsistentOperation
Mgmt
EventuallyConsistent
OperationMgmt
Analytics
Commerce
API Services
121. Creating Digital Service Ecosystem
by quickly on-boarding
independent services
121 2015 Apigee Confidential