webcast: api-centric architecture for building context-aware apps

32
API Centric Architectures for Context-Aware Apps Webinar

Upload: apigee

Post on 15-Jul-2015

2.450 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Webcast: API-Centric Architecture for Building Context-Aware Apps

API Centric Architectures for Context-Aware Apps!Webinar

Page 2: Webcast: API-Centric Architecture for Building Context-Aware Apps

@karlunho Alan Ho

@gbrail Greg Brail

Page 3: Webcast: API-Centric Architecture for Building Context-Aware Apps

youtube.com/apigee

Page 4: Webcast: API-Centric Architecture for Building Context-Aware Apps

slideshare.com/apigee

Page 5: Webcast: API-Centric Architecture for Building Context-Aware Apps

Agenda!

1.  Context-Aware App Overview !

2.  Intro to Lambda architecture and microservices !

3.  Industry overview on context-aware architecture !

4.  Netflix Recommendation Engine Deep Dive !

5.  Insights Deep Dive !

5

Page 6: Webcast: API-Centric Architecture for Building Context-Aware Apps

Context Aware Apps!

6

Page 7: Webcast: API-Centric Architecture for Building Context-Aware Apps

What is Context ?!

7

Historical !Events!

Recent!Events! Now!

Page 8: Webcast: API-Centric Architecture for Building Context-Aware Apps

Technology Choices Today!

8

Datawarehouse RDBMS J2EE AppServer

Page 9: Webcast: API-Centric Architecture for Building Context-Aware Apps

Modern Architectures for Adaptive Apps!

9

Lambda Architecture

Batch Storage

RealTime Storage

Batch Processing

(MR)

RealTime Processing

Microservices Architecture

Micro Service

Micro Service

Micro Service

Micro Service

Micro Service

Micro Service

Query DB

Batch Layer

Serving Layer

Speed Layer

APIs

Direct Mail

Email

Web

Mobile

Outreach

Page 10: Webcast: API-Centric Architecture for Building Context-Aware Apps

Two Major Context-aware Use Cases!

10

Targeting Recommendations

Page 11: Webcast: API-Centric Architecture for Building Context-Aware Apps

Industry View!

11

Page 12: Webcast: API-Centric Architecture for Building Context-Aware Apps

Needle in a Haystack!

Page 13: Webcast: API-Centric Architecture for Building Context-Aware Apps

Dynamic Decision Brokers!

13

Page 14: Webcast: API-Centric Architecture for Building Context-Aware Apps

Netflix Deep Dive!

14

Page 15: Webcast: API-Centric Architecture for Building Context-Aware Apps

•  Offline = Batch

•  Nearline = Speed Layer

•  Online = Serving Layer + Microservices

Page 16: Webcast: API-Centric Architecture for Building Context-Aware Apps

Batch Layer (Offline)!

•  Singular Value Decomposition

•  Batch like operations

•  High algorithm complexity

•  Results Flow into Cassandra

Page 17: Webcast: API-Centric Architecture for Building Context-Aware Apps

Speed Layer (Near Line)!

17

•  Medium request/response!

•  Medium data!

•  Medium algorithm complexity!

•  Intermediate caching, incremental learning algos!

Page 18: Webcast: API-Centric Architecture for Building Context-Aware Apps

Serving & Microservices layer (Online)!•  Fast request/response,

performance is key – high availability/SLA !

•  Fallback mechanism to Nearline/Offline operations !

•  Low algorithm complexity !

Page 19: Webcast: API-Centric Architecture for Building Context-Aware Apps

Final Thoughts:!!•  Very complete system!

•  Very custom and high performance!

•  Lots of specialized systems for specialized tasks!

•  Not practical for most enterprises!

Page 20: Webcast: API-Centric Architecture for Building Context-Aware Apps

Insights Deep Dive!

Page 21: Webcast: API-Centric Architecture for Building Context-Aware Apps

Recommendations Example!

21

Page 22: Webcast: API-Centric Architecture for Building Context-Aware Apps

Recommendation Architecture!

22

Hadoop

In-Memory

Insights (GRASP)

Node.js

Node.js Node.js

Node.js Node.js

Node.js Node.js

API BaaS

(APIs)

Direct Mail

Email

Web

Mobile

Outreach

(Batch Scores)

(Counters / Activities)

(Query)

Historical Events

Realtime Events

(Context)

Backend

(Mashup)

3

4

5

1

2

6

Page 23: Webcast: API-Centric Architecture for Building Context-Aware Apps

Batch Layer!

•  Uses R for building predictive models !

•  Algorithms based on Event Sequences !

•  Lots and lots of tooling !

23

HadoopInsights(GRASP)

API BaaS

(Batch Scores)1

Apigee UI

Page 24: Webcast: API-Centric Architecture for Building Context-Aware Apps

24

R Code!

Page 25: Webcast: API-Centric Architecture for Building Context-Aware Apps

25

Scored Export to Serving Layer!

Page 26: Webcast: API-Centric Architecture for Building Context-Aware Apps

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

Page 27: Webcast: API-Centric Architecture for Building Context-Aware Apps

BaaS Node.js Counter Example!

var event = new Usergrid.Counter(event_options, function (error, result) { … });

// Then we POST the event to increment the countervar 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:!

Page 28: Webcast: API-Centric Architecture for Building Context-Aware Apps

Microservices Layer!

•  API Layer (Swagger) !

•  Context Injection !

•  Service Orchestration !

•  Fallback logic !

28

Node.js Node.js

Node.js Node.js

Node.js Node.js

API BaaS

Direct Mail

Email

Web

Mobile

Outreach

(Context)

Backend

Page 29: Webcast: API-Centric Architecture for Building Context-Aware Apps

Swagger Based API Design!

29

Page 30: Webcast: API-Centric Architecture for Building Context-Aware Apps

Node.js Code!

30

Page 31: Webcast: API-Centric Architecture for Building Context-Aware Apps

APIs are Everywhere!

31

Hadoop

In-Memory

Insights(GRASP)

Node.js

Node.js Node.js

Node.js Node.js

Node.js Node.js

API BaaS

Direct Mail

Email

Web

Mobile

Outreach

HistoricalEvents

RealtimeEvents

Backend

Page 32: Webcast: API-Centric Architecture for Building Context-Aware Apps

Summary!•  Context-Aware apps are the new experience benchmark •  Modern Apps Architecture = Microservices & Lambda

Architecture

•  Netflix is an example of a successful company implementing this architectures

•  Apigee helps companies implement Lambda and Microservices

architectures

32