Presentation is loading. Please wait.

Presentation is loading. Please wait.

Title Line Subtitle Line Top of Content Box Line Top of Footer Line Left Margin LineRight Margin Line Top of Footer Line Top of Content Box Line Subtitle.

Similar presentations


Presentation on theme: "Title Line Subtitle Line Top of Content Box Line Top of Footer Line Left Margin LineRight Margin Line Top of Footer Line Top of Content Box Line Subtitle."— Presentation transcript:

1 Title Line Subtitle Line Top of Content Box Line Top of Footer Line Left Margin LineRight Margin Line Top of Footer Line Top of Content Box Line Subtitle Line Title Line Right Margin LineLeft Margin Line. Intel Confidential Gabriel Infante-Lopez ​ Reactive In-Memory Graph-like Index ​ Noviembre – 2014

2 2 General Idea Programming with actors. Architecture. Patterns for Error Handling. Patterns for Fault Tolerance. Patterns for Scalability. Overview

3 3 Graph Representation

4 4 Queries using the DB index for entities: Movies: movies fulfilling a given criteria, e.g., movies with “peter” in their title. Users: users for a given criteria. Sentiment Analysis: Movies with positive sentiment. Queries using the DB index for relations: Similar movies: movies similar to a given one. Similar Users: Users similar to a given user. What can we ask?

5 5 What else can we ask? Movies similar to movies I liked, Movies similar to movies that my friends have seen. Movies that have receive a positive review by friends of my friends. People similar to me that is friend of a friend of mine. People that is similar to me that has written review similars to those I have written. Movies that are similar in cast and theme to movies I did like. BTW, I want the match with the best score.

6 6 Database persistence indexing entities. In memory graph traversing, dijkstra, mining security In Memory Index

7 7 1.Granular Security 2.Ephemeral Data 3.Contextual Security 4.Mining and Traversing and the same time. 5.Scalability 6.Fault Tolerance. 7.Reply as we know it. 8.Distributed Garbage Collection Main Features

8 Programming with Actors 8

9 The Actor Model Key Abstraction C vs Java: You can use memory without having to admin it. Thread vs actor: concurrency without dealing with admin of threads. Don't communicate by sharing memory; share memory by communicating.

10 Actor model ●Actor = states + mailbox + behaviors (msg handlers) ●From outside, can’t manipulate actors directly. ●To interact with an actor, must send msgs to it. ●Each actor has a mailbox, msgs are put to mailbox, and processed one by one. ← An actor is like a single threaded process; it doesn’t do more than one thing at a time.

11 Concurrency: Actor vs Thread Thread: ●Heavy weight: Can only create not too many threads; usually: 2000~5000 ●Shared state ← Source of bugs ●Passive: Have to call object.method() to make the object alive. Actor: ●Light weight: Can create millions of actors; usually: ~2.5 million actors/GB Shared nothing ●Active: Actors are alive by themselves. ← Easy to model programs that have millions of on-going things (very high level of concurrency).

12 Concurrency: Actor vs Thread ●Thread: n dimensions, hard to reason about. ●Actor: 1D, one thing at a time. var1 var2

13 ●Actor is a high level logical way to think, to model programs. ●At lower level, actors run above a thread pool. Concurrency: Actor vs Thread

14 Programming Model

15 class Vertex extends Actor with Logging { var neigs = List[(ActorRef, weight)]() override def update: Receive = { case Weight(d) => if(d < min) { min = d neighs map {case (ref, weight) => ref ! Weight(min + weight) } case AddEdge(ref) => { neigs = ref::neigs }

16 Akka http://akka.io/ (an implementation of actor model) http://akka.io/

17 In Memory Index Main Components 17

18 18

19 19 1.Communication between client and server is asynchronous. 2.Different components form an Akka cluster 1.heartbeats check for the connectivity of the cluster. 2.information is gossiped. 3.information about the load of the cluster is also gossiped (clients know the load of the system) 3.client handles errors as exceptions. 1.errors are detected in server, communicated to the client, and raised by the client. 4.client hides actor system. Main Components

20 In Memory Index Service 20

21 21

22 22 1.Query state is held in query handlers. 2.Query leaves depending on the load of the systems 3.Collectors reduce information from graph. Index Service

23 23 1.How information flows in the system. 1.who sends what, who stores what, errors as information, status as information. 2.Who knows what 1.where are the abstraction layers in our system, who needs to know, who needs to have access. Design differences and usage. 3.async and decentralized logging. 1.everything has to be async and non-blocking, including logging. 4.Decentralized garbage collector. 1.for how long the system should keep queries running, and who will remove memory 2.no centralized info handler. 5.what aspects are fixed by configuration and which are dynamic. Design Key Aspects

24 Intel & McAfee Confidential 24

25 25 Components


Download ppt "Title Line Subtitle Line Top of Content Box Line Top of Footer Line Left Margin LineRight Margin Line Top of Footer Line Top of Content Box Line Subtitle."

Similar presentations


Ads by Google