illustrated using archimate and uml - …grahamberrisford.com/00eaframeworks/05archimate/archimate...

20
Avancier Training at http://avancier.website Using caching to speed up a batch process Illustrated using ArchiMate and UML After Gerben Wierda’s paper http://eapj.org/on-slippery-ice-20150201 (The link will break if the EAP journal move the paper.)

Upload: hoangbao

Post on 13-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Avancier

Training at http://avancier.website

Using caching to speed up a batch process Illustrated using ArchiMate and UML

After Gerben Wierda’s paper

http://eapj.org/on-slippery-ice-20150201

(The link will break if the EAP journal move the paper.)

Avancier The company’s enterprise architecture principles

Training at http://avancier.website

1.presentation layer is separated from application layer

2.data is owned by one business function and served to others

3.data is mastered in one application (single source of truth)

4.systems are connected via an ESB for loose-coupling

5.rules are applied by business rule engines so systems can be

adapted to different policy types and different clients.

► Such principles are typically designed for

■ On-line transaction use cases

■ Flexibility to handle many customer and/or product variations

Avancier Alas

► “Alas, such models are no silver bullets.

► Projects get into serious trouble because of them.

► Three main reasons:

■ brittleness of loosely-coupled spaghetti

■ maintainability

■ performance.”

Gerben Wierda

Training at http://avancier.website

Avancier

*[for 1,000 employers]

*[for > 1,000 employees]

The scenario as a UML sequence diagram

Training at http://avancier.website

Check Premium

Total receivable

Get Policy Data

Premiums file

Premium errors file

Employer

Receive

Insurance

Premiums

Insurance

Member

Policy

Accounting

Business

Rules

Engine Policies Rules Acc’ts

This batch process handles millions of premiums after

each month end

Avancier

ESB

ESB

ESB

ETL

*[for 1,000 employers]

*[for > 1,000 employees]

First overhead – network + middleware

Training at http://avancier.website

Check Premium

Total receivable

Get Policy Data

Premiums file

Premium errors file

Employer

Receive

Insurance

Premiums

Insurance

Member

Policy

Accounting

Business

Rules

Engine Policies Rules Acc’ts

Message queue

Avancier

ESB

ESB

ESB

ETL

*[for 1,000 employers]

*[for > 1,000 employees]

Second overhead – database access

Training at http://avancier.website

Check Premium

Total receivable

Get Policy Data

Premiums file

Premium errors file

Slow DB access

Employer

Receive

Insurance

Premiums

Insurance

Member

Policy

Accounting

Business

Rules

Engine Policies Rules Acc’ts

Avancier How to speed up through design?

► First, identify the bottlenecks in the process

1. Middleware adds network traffic

2. Middleware itself

3. IMP database structure not designed for fast access

Training at http://avancier.website

Avancier How to speed up through design? Cache!

1. Middleware adds network traffic

● Remove network hops

● Cache data nearer point of use

2. Middleware itself

● Bypass the middleware

● Cache data nearer point of use

3. IMP database structure not designed for fast access

● Optimise the data structure for client access

● Cache data from discs to memory or SSD

Training at http://avancier.website

Avancier Gerben’s ArchiMate diagrams of cache design options

3: Server-owned cache

2: Server-updated cache

1: Client-maintained cache

Avancier Hereafter

► All bar one service (refinement) will be copied from ArchiMate

diagrams onto UML diagrams

Training at http://avancier.website

Avancier 0: Original design (no cache)

► Receive-Insurance-Premium system (RIP) requests Policy data from

► Insurance-Member-Policy system (IMP)

Training at http://avancier.website

Use Imp Data

Answer request for Data

IMP RIP

IMP update Distribute Update

GW shows show data in flow as a data object passing from a function to a function From the invoked service would be better.

Avancier 0: Original design (no cache) (drawn to match ArchiMate diagram)

Training at http://avancier.website

*[for > 1,000 employees]

RIP IMP

Policies

Use

IMP data

Answer request for data Distribute

update

IMP Update

Receive-Insurance-Premium system (RIP)

requests Policy data from Insurance-Member-

Policy system (IMP)

Avancier 1: Classic client-maintained cache

► 1) RIP looks in the cache for data that is not marked out-of-date.

► 2) If data needs to be refreshed, RIP uses the service from IMP and receives the data

► The problem is that we might be using data that is out of date.

Training at http://avancier.website

Use Imp Data

Answer request for Data

IMP RIP IMP data cache “alwatys valid”

IMP update Distribute Update

IMP update

Avancier 1: Classic client-maintained cache

Training at http://avancier.website

RIP first looks in the cache for data that is not marked out-of-date. If the data needs to be refreshed, RIP uses the service from IMP and receives the data The problem is that we might be using data that is out of date.

*[for > 1,000 employees]

RIP IMP

IMP Data

Cache

Policies

Use

IMP data

If the policy data is in the cache and not stale

Else

Answer request for data Distribute

update

IMP Update

Avancier 2: Server-updated cache

Training at http://avancier.website

RIP uses only the local cache which is kept up to date by IMP

Every time IMP updates data, it uses a service from RIP and sends it the updated data.

RIP immediately stores it in the cache.

Distribute Update Use Imp Data Keep RIP cache

up to date

Receive RIP Data Update

IMP RIP IMP data cache “alwatys valid”

IMP update

Avancier

*[for each update]

2: Server-updated cache

Training at http://avancier.website

RIP uses only the local

cache which is kept up

to date by IMP.

Every time IMP updates

data, it uses a service

from RIP and sends it

the updated data. RIP

immediately stores it in

the cache.

*[for > 1,000 employees]

RIP IMP

IMP Data

Cache

Policies

Use

IMP data

IMP Update

Receive IMP Data Update Keep

RIP cache

up to date

Distribute

update

Avancier 3: Server-owned cache

► 3rd application manages the cache made available to RIP via API

► It runs on the environment where the cache must be maintained

Training at http://avancier.website

Distribute Update Use Imp Data Manage IMP Data

Receive RIP Data Update

IMP RIP IMP data cache “alwatys valid”

IMP update

IMP Cache Agent

Serve IMP Data via API

Avancier

*[for > 1,000 employees]

3: Server-owned cache v1

Training at http://avancier.website

*[for each update]

RIP IMP

Policies

Distribute

update

IMP

Cache

Agent

Receive IMP Data Upd.

Use

IMP data

IMP Update

Serve IMP data

IMP Data

Cache

Manage

IMP data

Manage

IMP data

An agent sits on every node where data is needed fast

► RIP reads the cache via the API

► Each agent subscribes to receive

Avancier

*[for each update]

*[for > 1,000 employees]

3: Server-owned cache v2

Training at http://avancier.website

RIP IMP

Policies

Distribute

update

IMP

Cache

Agent

Receive IMP Data Upd.

Use

IMP data IMP Data

Cache

Manage

IMP data

► RIP reads the cache directly

Avancier 4: Shared data space

► Not likely to work in this case, but a general pattern

Training at http://avancier.website

RIP IMP

Policies

Distribute

update

Use

IMP data IMP Data

Cache