Application Patterns 
tomi vanek 
February 2014
Copyright © 2014 Accenture All rights reserved. 
2 
•User Interaction 
•Services 
•Persistence – scaling, locking, cache 
•Real-time processing 
•High Volume Batch Processing 
Agenda
User Interaction
Copyright © 2014 Accenture All rights reserved. 
4 
MVP 
MVC / MVP / MV-VM 
Model 
View 
Controller 
Action 
Model 
View 
Presenter 
Action 
Model 
View 
View-Model 
Action 
MVC 
MV-VM
Copyright © 2014 Accenture All rights reserved. 
5 
Model-View-Controller (MVC)
Copyright © 2014 Accenture All rights reserved. 
6 
MVC Variant: Page Flow
Copyright © 2014 Accenture All rights reserved. 
7 
Page flow with asynchronous commit of order 
Simple synchronous MVC implementation 
MVC: Page Flow Example
Copyright © 2014 Accenture All rights reserved. 
8 
In-Memory Server Session State
Copyright © 2014 Accenture All rights reserved. 
9 
Persistent Session State
Copyright © 2014 Accenture All rights reserved. 
10 
Serialized Session State in View
Copyright © 2014 Accenture All rights reserved. 
11 
Client Session State in Local Storage
Services
Copyright © 2014 Accenture All rights reserved. 
13 
Method invocation / Resource manipulation 
•Services: 
–Strongly typed interface contract. 
–Broad range of aspects are standardized. 
–Implemented in integration infrastructure and technologies. 
–Service discoverability and lifetime management. 
•But: 
–Limits in scalability. 
–Expensive extensibility. 
•Resources: 
–Simple data exploration. 
–Simple extensibility. 
–Simple data consumer code. 
•But: 
–Limited schema definition. 
–No standards for complex functionalities / scenarios.
Copyright © 2014 Accenture All rights reserved. 
14 
Business Layer Remote Procedure Call 
Presentation 
Presentation Layer 
Business Tier 
Data Tier 
External 
Business Module 
Resources 
Data Layer 
Business Layer 
External 
System 
Repository 
Integration Gateway 
Service 
Service 
Relational Database
Copyright © 2014 Accenture All rights reserved. 
15 
Compact Business Layer with Active Records 
Application Tier 
Dynamic 
Presentation Module 
Presentation Layer 
Resources 
Domain Layer 
Presentation 
Data Tier 
External 
External 
System 
Integration Gateway 
Relational Database
Copyright © 2014 Accenture All rights reserved. 
16 
REST / WS Business Layer 
Presentation 
Business Tier 
Data Tier 
External 
Business Module 
Resources 
Data Layer 
Business Layer 
Presentation Layer 
External 
System 
Repository 
Integration Gateway 
Service 
Service 
Relational Database 
Controller
Copyright © 2014 Accenture All rights reserved. 
17 
Asynchronous Business Layer 
Presentation 
Business Tier 
Data Tier 
External 
Business Module 
Resources 
Data Layer 
Business Layer 
Presentation Layer 
External 
System 
Repository 
Relational Database 
Integration Gateway 
Queue 
Queue 
Service 
Queue 
Queue 
Service
Copyright © 2014 Accenture All rights reserved. 
18 
Push Notification Business Layer 
Presentation 
Business Tier 
Business Module 
Resources 
Data Layer 
Business Layer 
Presentation Layer 
Subject Register 
Service
Copyright © 2014 Accenture All rights reserved. 
19 
Data synchronization
Persistence - Scaling
Copyright © 2014 Accenture All rights reserved. 
21 
Database Scaling: Master – Slave 
Internet 
Load Balancer 
Load Balancer 
Slaves 
Web Servers 
Master 
Write 
Read 
Replicate
Copyright © 2014 Accenture All rights reserved. 
22 
Database Scaling: Active - Passive 
Internet 
Load Balancer 
Passive 
Web Servers 
Failed 
Active Instance 
Passive to Active 
Instance 
Replicate 
Read / Write
Copyright © 2014 Accenture All rights reserved. 
23 
Database Scaling: Cluster 
Internet 
Load Balancer 
Virtual Database Cluster 
Controller 
Virtual Database Cluster 
Controller
Copyright © 2014 Accenture All rights reserved. 
24 
Database Scaling 
Load Balancer 
Shard Resolver 
Web Servers 
Product 1 .. n 
Product n+1 .. o 
Product o+1 .. p
Locking
Copyright © 2014 Accenture All rights reserved. 
26 
Optimistic Locking
Copyright © 2014 Accenture All rights reserved. 
27 
Pessimistic Locking
Cache
Copyright © 2014 Accenture All rights reserved. 
29 
Read-through / Write-through Cache
Copyright © 2014 Accenture All rights reserved. 
30 
Pre-fetch
Copyright © 2014 Accenture All rights reserved. 
31 
Publisher
Real-time processing 
Integration Patterns
Copyright © 2014 Accenture All rights reserved. 
33 
Reference model
34 
Messaging Idioms 
•Channels 
•Message Construction 
•Rooting 
•Transformation 
Messaging Design Patterns 
•Pipes and Filters 
•Claim Check 
•Scatter-Gather 
Integration Application Architecture Design Patterns
Copyright © 2014 Accenture All rights reserved. 
35 
Pipes and filters
Copyright © 2014 Accenture All rights reserved. 
36 
Pipeline
Copyright © 2014 Accenture All rights reserved. 
37 
Claim-check
Copyright © 2014 Accenture All rights reserved. 
38 
Claim-check for secure communication
Copyright © 2014 Accenture All rights reserved. 
39 
Scatter-Gather with Publish-Subscribe Input Channel
Copyright © 2014 Accenture All rights reserved. 
40 
Scatter-Gather with Recipient List
Scale-Out Batch 
High Volume Batch Processing
Copyright © 2014 Accenture All rights reserved. 
42 
Batch Application Elements 
Job Launcher 
Job 
Step 
Reader 
Processor 
Writer 
Job Repository
Copyright © 2014 Accenture All rights reserved. 
43 
Batch reference model
Copyright © 2014 Accenture All rights reserved. 
44 
Scaling
Copyright © 2014 Accenture All rights reserved. 
45 
Job with Parallel Steps
Copyright © 2014 Accenture All rights reserved. 
46 
Step with parallel threads
Copyright © 2014 Accenture All rights reserved. 
47 
Partitioning
Copyright © 2014 Accenture All rights reserved. 
48 
Remote chunking
Discussion

Application patterns

  • 1.
    Application Patterns tomivanek February 2014
  • 2.
    Copyright © 2014Accenture All rights reserved. 2 •User Interaction •Services •Persistence – scaling, locking, cache •Real-time processing •High Volume Batch Processing Agenda
  • 3.
  • 4.
    Copyright © 2014Accenture All rights reserved. 4 MVP MVC / MVP / MV-VM Model View Controller Action Model View Presenter Action Model View View-Model Action MVC MV-VM
  • 5.
    Copyright © 2014Accenture All rights reserved. 5 Model-View-Controller (MVC)
  • 6.
    Copyright © 2014Accenture All rights reserved. 6 MVC Variant: Page Flow
  • 7.
    Copyright © 2014Accenture All rights reserved. 7 Page flow with asynchronous commit of order Simple synchronous MVC implementation MVC: Page Flow Example
  • 8.
    Copyright © 2014Accenture All rights reserved. 8 In-Memory Server Session State
  • 9.
    Copyright © 2014Accenture All rights reserved. 9 Persistent Session State
  • 10.
    Copyright © 2014Accenture All rights reserved. 10 Serialized Session State in View
  • 11.
    Copyright © 2014Accenture All rights reserved. 11 Client Session State in Local Storage
  • 12.
  • 13.
    Copyright © 2014Accenture All rights reserved. 13 Method invocation / Resource manipulation •Services: –Strongly typed interface contract. –Broad range of aspects are standardized. –Implemented in integration infrastructure and technologies. –Service discoverability and lifetime management. •But: –Limits in scalability. –Expensive extensibility. •Resources: –Simple data exploration. –Simple extensibility. –Simple data consumer code. •But: –Limited schema definition. –No standards for complex functionalities / scenarios.
  • 14.
    Copyright © 2014Accenture All rights reserved. 14 Business Layer Remote Procedure Call Presentation Presentation Layer Business Tier Data Tier External Business Module Resources Data Layer Business Layer External System Repository Integration Gateway Service Service Relational Database
  • 15.
    Copyright © 2014Accenture All rights reserved. 15 Compact Business Layer with Active Records Application Tier Dynamic Presentation Module Presentation Layer Resources Domain Layer Presentation Data Tier External External System Integration Gateway Relational Database
  • 16.
    Copyright © 2014Accenture All rights reserved. 16 REST / WS Business Layer Presentation Business Tier Data Tier External Business Module Resources Data Layer Business Layer Presentation Layer External System Repository Integration Gateway Service Service Relational Database Controller
  • 17.
    Copyright © 2014Accenture All rights reserved. 17 Asynchronous Business Layer Presentation Business Tier Data Tier External Business Module Resources Data Layer Business Layer Presentation Layer External System Repository Relational Database Integration Gateway Queue Queue Service Queue Queue Service
  • 18.
    Copyright © 2014Accenture All rights reserved. 18 Push Notification Business Layer Presentation Business Tier Business Module Resources Data Layer Business Layer Presentation Layer Subject Register Service
  • 19.
    Copyright © 2014Accenture All rights reserved. 19 Data synchronization
  • 20.
  • 21.
    Copyright © 2014Accenture All rights reserved. 21 Database Scaling: Master – Slave Internet Load Balancer Load Balancer Slaves Web Servers Master Write Read Replicate
  • 22.
    Copyright © 2014Accenture All rights reserved. 22 Database Scaling: Active - Passive Internet Load Balancer Passive Web Servers Failed Active Instance Passive to Active Instance Replicate Read / Write
  • 23.
    Copyright © 2014Accenture All rights reserved. 23 Database Scaling: Cluster Internet Load Balancer Virtual Database Cluster Controller Virtual Database Cluster Controller
  • 24.
    Copyright © 2014Accenture All rights reserved. 24 Database Scaling Load Balancer Shard Resolver Web Servers Product 1 .. n Product n+1 .. o Product o+1 .. p
  • 25.
  • 26.
    Copyright © 2014Accenture All rights reserved. 26 Optimistic Locking
  • 27.
    Copyright © 2014Accenture All rights reserved. 27 Pessimistic Locking
  • 28.
  • 29.
    Copyright © 2014Accenture All rights reserved. 29 Read-through / Write-through Cache
  • 30.
    Copyright © 2014Accenture All rights reserved. 30 Pre-fetch
  • 31.
    Copyright © 2014Accenture All rights reserved. 31 Publisher
  • 32.
  • 33.
    Copyright © 2014Accenture All rights reserved. 33 Reference model
  • 34.
    34 Messaging Idioms •Channels •Message Construction •Rooting •Transformation Messaging Design Patterns •Pipes and Filters •Claim Check •Scatter-Gather Integration Application Architecture Design Patterns
  • 35.
    Copyright © 2014Accenture All rights reserved. 35 Pipes and filters
  • 36.
    Copyright © 2014Accenture All rights reserved. 36 Pipeline
  • 37.
    Copyright © 2014Accenture All rights reserved. 37 Claim-check
  • 38.
    Copyright © 2014Accenture All rights reserved. 38 Claim-check for secure communication
  • 39.
    Copyright © 2014Accenture All rights reserved. 39 Scatter-Gather with Publish-Subscribe Input Channel
  • 40.
    Copyright © 2014Accenture All rights reserved. 40 Scatter-Gather with Recipient List
  • 41.
    Scale-Out Batch HighVolume Batch Processing
  • 42.
    Copyright © 2014Accenture All rights reserved. 42 Batch Application Elements Job Launcher Job Step Reader Processor Writer Job Repository
  • 43.
    Copyright © 2014Accenture All rights reserved. 43 Batch reference model
  • 44.
    Copyright © 2014Accenture All rights reserved. 44 Scaling
  • 45.
    Copyright © 2014Accenture All rights reserved. 45 Job with Parallel Steps
  • 46.
    Copyright © 2014Accenture All rights reserved. 46 Step with parallel threads
  • 47.
    Copyright © 2014Accenture All rights reserved. 47 Partitioning
  • 48.
    Copyright © 2014Accenture All rights reserved. 48 Remote chunking
  • 49.