Distribution and Integration Technologies Distributed Architectures Patterns and Styles 1
Distributed applications infrastructure ISP intranet wireless backbone desktop computer: server: laptops: tablets: smartphones: network link: wireless link: satellite link Mobile inside an organization (intranet) with external clients between organizations 2
Ubiquitous computing / spontaneous network gateway Music service Alarm service Internet Discovery service Hotel / Shopping wireless network Camera TV/PC Laptop Mobile Guests devices 3
Characteristics / challenges Heterogeneity Use: many OSs, hardware, programming languages, frameworks, Extensibility Easy integration of new services, components, nodes, Security Protection: confidentiality, integrity, authentication, availability, Scalability Architecture: allow more users with more resources without degrading Fault tolerance and treatment Response to communication, node, service faults and failures, Concurrency Several simultaneous clients and users Transparency To the user and to the programmer 4
Enterprise applications Front-office Departments Sales Marketing Client Services CRM Production IT Human Resources ERP Stock Management Account Management Product Distribution Back-office 5
Application logic architecture Client tier Middle tier Data tier Interface Business Logic Data 6
Presentation User Interface Business Logic Data Access Data Management and Storage Tiered architecture Interface Logic Data Presentation Interface design and data visualization/input UI Interaction and data transport to the business logic layer Business Data validation, manipulation, processing and security Access Data encapsulation and transformation to storage models/formats. Extraction and storage actions. Storage DBMS s and access drivers 7
Data Layer Business Layer Services Layer Cross Cutting Security Communication Presentation Layer An enterprise application (detail) UI Components Presentation Logic Components Presentation Entities External Applications Service Interfaces Message Formats Application Façade Business Workflows Business Components Business Entities Data Access Components Data Utilities Service Agents Data External Services 8
Workflows / BPM Services and Activities orchestration to form a business process Service Interface Business Workflow Component Service Agent Service Interface 9
Distributed architecture styles (1) Client / Server One half of the application (Client) emits requests to the other half (Server) Workstation Server Client and Server execute in different processes in the same or different machines Server can be client of other Servers Clients can obtain answers concurrently This style exists practically in every distributed application APM@FEUP Distributed Architecture 10
Distributed architecture styles (2) Component based architecture The application is decomposed in functional and reusable portions exposing a known and defined interface The components can generally be installed in different processes and can be remotely invoked Client Comp A Comp C Comp B Process 2 Process 1 Comp D Process 3 11
Components Interface 1: method 1 method 2 Interface 2: method 3 method 4 Interface 3: method 5 method 6 Interface 4: method 7 method 8 Remote class 1 Remote class 2 Installation unit: component (executable code file) properties (general OO): encapsulation inheritance polymorphism component composition: contention aggregation other properties: binary specification language independence localization independence A middleware provides a functionality set allowing the easy creation of new instances of the remote classes and the invocation of their methods 12
Distributed architecture styles (3) Domain Driven Models the application following the business process and the intervenient entities. The main application objects represent the entities, with their state and behavior in the business process (business entities or business objects) Business objects 13
Business objects State Behavior Interface Entities from the application logical model Remote entity P1 Use of a P2 Creation remote entity Transport channel Initialization Serialization Entity class code Entity class code 14
Distributed architecture styles (4) Layered Multi-Tiered Architecture The layered architecture divides the application functionality in stacked groups that can communicate between them. A layer becomes a tier if it can be installed in a separate machine. Browser Web Server Web Server Web Server Presentation Presentation Presentation Application Server Application Server Application Server Business Business Logic Business Logic Logic Database Server Database Replication Database Server Database 15
Distributed architecture styles (5) Message bus Applications are built in a way that can consume and expose functionalities through message sending and receiving. They must know only the message format and meaning and not the specific details of the senders and receivers. Application C Application A Application B 16
Distributed architecture styles (6) Service Oriented Architecture (SOA) The applications are built in a way to expose and consume functionalities presented as services, using well defined contracts (interfaces) and messages Service A Application Service B Service D Service C Service E 17
Integration ways Applications DBs Presentation Interface Logic Logic Data Access Presentation Interface Logic Data Access Presentation Interface Logic Logic Data Access Messages or Services Messages or Services 18
Distribution models and ways Shared memory SMP systems, global variables, multithreading --- OpenMP Distributed shared memory Difficult to implement But simple programming Mobile code Mobile agents, where code and data can move from node to node Message passing Needs a communication channel Explicit sending and receiving Remote invocation RPC Function invocation, similar to local calls Data is moved as parameters and results OO paradigm easy to achieve 19
Remote invocation mechanism... var = func_a(... ).. func_a( )..... proxy of func_a(... ) marshalling dispatcher of func_a(... ) communication channel Client Remote function 20
Distributed platform architecture Applications Middleware communications Operating System High level abstractions: RMI, events,... Names and location Protocols for calls and responses External data representation Hardware Middleware: - Implements a distributed programming model above processes, communication channels and message passing; - Isolates the hardware and the operating system, allowing interoperability between different platforms; - Supplies a high level of programming transparency, emulating a local programming model; 21
Middleware function Application Application Application standard API Middleware Middleware Middleware specific API Operating System Operating System Operating System Communication Network APM@FEUP Distributed Architecture 22