copyright ©2009 opher etzion event processing course engineering and implementation considerations...

13
Copyright ©2009 Opher Etzion Copyright ©2009 Opher Etzion Event Processing Course Engineering and implementation considerations (related to chapter 10)

Post on 21-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

Event Processing Course

Engineering and implementation considerations (related to chapter 10)

2Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

Lecture outline

Non functional properties

Performance objectives

Optimizations

3Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

Non functional properties - scalability

scalability in the volume of processed events

Scalability in the quantity of agents

Scalability in the quantity of producers

scalability in the quantity of consumers

scalability in the quantity of context partitions

Scalability in context state size

Scalability in the complexity of computation

scalability in the processor environment

Scalability is the capability of a system to adapt readily to a greater or lesser intensity of use, volume ,or demand while still meeting its business objectives .

4Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

Non functional requirements - availability

Availability is the percentage of the time in which a certain system is perceived as functioning by its users .

Recoverability is the ability to restore the state to its exact value

before a failure occurred.

5Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

Non functional requirements - security

Ensuring only authorized parties are allowed to be event producers of event consumers

Ensuring that incoming events are filtered so that authorized producers cannot introduce invalid events, or events that they are not entitled to publish

Ensuring that consumers only receive information to which they are entitled. In some cases a consumer might be entitled to see some of the attributes of an event but not others.

Ensuring that unauthorized parties cannot add new EPAs to the system, or make modifications to the EPN itself (in systems where dynamic EPN modification is supported)

Keeping auditable logs of events received and processed, or other activities performed by the system.

Ensuring that all databases and data communications links used by the system are secure.

6Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

Performance objectives

Objective

Number

Objective Name Objective metrics

1 MAX input

throughput

Maximize the quantity of input events processed by a

certain system or sub-system within a given time period

2 MAX output

throughput

Maximize the quantity of derived events produced by a

certain system or sub-system within a given time period

3 MIN average

latency

Minimize the average time it takes to process an event

and all its consequences in a certain system or sub-

system

4 Min maximal

latency

Minimize the maximal time it takes to process an event

and all its consequences in a certain system or sub-

system

5 Latency

leveling

Minimize the variance of processing times for a single

event or a collection of events in a certain system or sub-

system

6 Real-time

constraints

Minimize the deviation in latency, from a given value,

for the processing of an event and all its consequences in

a certain system or sub-system.

7Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

Optimizations

Optimizations related to EPA assignment: partition, parallelism, distribution and load shedding.

Optimizations related to the coding of specific EPAs: code optimization, state management.

Optimization related to the execution process: scheduling, and routing optimizations.

8Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

EPA assignment optimizations

Partitioning of EPA Instances to run time artifacts

Amount > 100

More Than5 OccurrencesWithin 1 Hour

Amount > 100

More Than3 OccurrencesWithin 1 Hour

Cancel FollowsDiscount

High VolumePurchase

Purchase

Cancel High VolumeCancel

Give Discount to Company

Discount Canceled

Cancel Discount to Company

Amount > 100

More Than5 OccurrencesWithin 1 Hour

Amount > 100

More Than3 OccurrencesWithin 1 Hour

Cancel FollowsDiscount

High VolumePurchasePurchase

CancelHigh Volume

Cancel

Give Discountto Company

Discount Canceled

Cancel Discount to Company

Stratum 1 Stratum 2 Stratum 3

Stratification algorithm

Stratified Event Processing Graph

9Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

More EPA assignment optimizations

Parallel processing

Distributed processing

Load shedding

10Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

EPA code optimizations - optimized code generation

1 2 1110853 4 6 7 9

1 2

5 6

8 9

1 2

3

4

5

5

6

71

1

8 9

Match 1

Match 2

11Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

EPA code optimizations – state management

Using persistent states. This resolve space scalability issues and recoverability, however, it may harm performance goals.

Using in-memory databases that provide caching capabilities, while guaranteeing recoverability. This is a way to balance between the two sides of the trade-off, with various tuning possibilities that relate to different assumptions about MTBF (mean time between failures) an MTTR (mean time to repair), in this case time for recovery.

Using grid memory instead of persistence: The idea here is to replicate the state in memory held on multiple machines, so as to get recoverability without having to use disk-based persistence. This solution has an overhead of network traffic, and the complexity of synchronization among the different replicas.

Using a mixture of approaches: Use persistent storage for states that have space scalability issues, and in-memory for others. You can also allow different levels of recoverability for different EPAs.

12Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

Execution optimizations

Scheduling

Routing

13Copyright ©2009 Opher EtzionCopyright ©2009 Opher Etzion

Summary

In the lecture we discussed:

Non functional properties

Performance indicators

Optimizations