38
Software Architecture Patterns Assaf Gannon 2015 Tikal Hosted by:

Software Architecture Patterns

Embed Size (px)

Citation preview

Software Architecture Patterns

Assaf Gannon

2015Tikal

Hosted by:

Why Use a Pattern

text

● Proven construct●Easy to communicate●Keep things in order

Common Patterns

● Layered Architecture● Event-Driven Architecture● Microkernel Architecture● Microservices Architecture

Layered Architecture

text

●The most common architecture

●De-facto standard for most JEEApplications

●AKA - “N-Tier” architecture

Layered Architecture

Key Concepts

● Separation of concerns● Layers’ Isolation● Open/Closed Layers

Open/Closed Layers

Pattern Example

The Architecture Sinkhole Anti-Pattern

● Requests flow through layers without processing

● Keep it to 80-20

Pattern Analysis

● Overall Agility - Low● Ease of Deployment - Low● Testability - High● Performance - Low● Scalability - Low● Ease of Development - High

Event-Driven Architecture

text

●Distributed●Asynchronous●Highly scalable●Highly adaptable●Two main topologies:

○Mediator○Broker

Mediator Topology

● Events processing have multiple steps that require orchestration

● Four main components:o Event Queueso Event Mediatoro Event Channelso Event Processors

Mediator Topology

The Event Mediator

● For basic use cases:o Apache Camelo Spring Integrationo Mule ESB

● More Complex (BPEL):o Apache ODE

● Even More Complexo jBPM

Mediator Topology Example

Broker Topology

● No central event mediator● Message flows across processors in

a chain like fashion● Main components:o Message Brokero Event Processor

Broker Topology

Broker Topology Example

Pattern Analysis

● Overall Agility - High● Ease of Deployment - High● Testability - Low● Performance - High● Scalability - High● Ease of Development - Low

Microkernel Architecture

text

Microkernel● AKA Plugin Architecture Pattern● Natural for Product Based Apps● Consists of:o Core Systemo Plugins

● Can be embedded in other patterns

Microkernel

Pattern Analysis

● Overall Agility - High● Ease of Deployment - High● Testability - High● Performance - High● Scalability - Low● Ease of Development - Low

Microservices Architecture

text

Microservices● Evolved from other patterns● Alternative to Monolithic

Applications and SOA Architecture● Still evolving● Many ways to implement

Core Concepts● Separately deployed units● Very Very small service components● Single purpose function or an

independent portion of functionality● Distributed● Loosely coupled ● Multiple versions are acceptable● Asynchronous● No Orchestration

Basic Layout

API REST-Based

Application REST-based

Centralized Messaging Topology

DataBase● Central Database tends to become a

bottleneck● DB should be segregated among

services - without sharing● Service publishes conclusions - NOT

raw data

Pattern Analysis

● Overall Agility - High● Ease of Deployment - High● Testability - High● Performance - Low● Scalability - High● Ease of Development - High

Pattern ConsiderationsLayered Pattern A solid general purpose pattern - best when you are not sure.

Avoid the “Sinkhole Anti-Pattern”Tends to encourage Monolithic Applications

Event-Driven Relatively complex. Distributed architectures issues must be addressed, such as remote processor availability, lack of responsiveness, reconnection logic,and failure recovery.No transactions across processors. Difficult to create and maintain processor contracts

Microkernel Can be embedded and used within other patterns.Great support for evolutionary design and incremental development.Should always be the first choice for product-based applications

Microservices Easy to perform real-time production deployments.Very agile-oriented architectureShares complexity issues with data-driven pattern

Pattern Comparison

THANK YOU

Assaf GannonEmail:[email protected]