Execution Architecture

Similar documents
Implementation Architecture

Implementation Architecture

Architectural Styles I

Architectural Styles II

Architectural Styles I

SA Analysis and Design

Outline. Threads. Single and Multithreaded Processes. Benefits of Threads. Eike Ritter 1. Modified: October 16, 2012

Introduction to Asynchronous Programming Fall 2014

PROCESSES AND THREADS

Kernel Korner AEM: A Scalable and Native Event Mechanism for Linux

Chapter 1: Distributed Information Systems

Lightweight Remote Procedure Call

Creating and Analyzing Software Architecture

Chapter 4: Threads. Operating System Concepts 9 th Edition

Chapter Outline. Chapter 2 Distributed Information Systems Architecture. Layers of an information system. Design strategies.

6/20/2018 CS5386 SOFTWARE DESIGN & ARCHITECTURE LECTURE 5: ARCHITECTURAL VIEWS C&C STYLES. Outline for Today. Architecture views C&C Views

COURSE OUTLINE MOC 20480: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

Enterprise Java Unit 1-Chapter 2 Prof. Sujata Rizal Java EE 6 Architecture, Server and Containers

Object-Oriented Design

Chapter 4: Threads. Operating System Concepts 9 th Edition

SA Analysis and Design

OPERATING SYSTEM. Chapter 4: Threads

Chapter 4: Multithreaded Programming

Spotfire Security. Peter McKinnis July 2017

Course 20480: Programming in HTML5 with JavaScript and CSS3

Comet and WebSocket Web Applications How to Scale Server-Side Event-Driven Scenarios

Chapter 7, System Design: Addressing Design Goals

Chapter 4: Threads. Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads

COURSE 20480B: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

Designing Component-Based Architectures with Rational Rose RealTime

Tutorial 8 Build resilient, responsive and scalable web applications with SocketPro

Programming in HTML5 with JavaScript and CSS3

7. System Design: Addressing Design Goals

CSE 333 Lecture 1 - Systems programming

A Report on RMI and RPC Submitted by Sudharshan Reddy B

Chapter 4: Multithreaded

Case study on PhoneGap / Apache Cordova

CSE 544 Principles of Database Management Systems

Chapter 4: Threads. Chapter 4: Threads. Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues

PROCESS CONCEPTS. Process Concept Relationship to a Program What is a Process? Process Lifecycle Process Management Inter-Process Communication 2.

Distributed Systems Principles and Paradigms

Chapter 4: Threads. Chapter 4: Threads

In examining performance Interested in several things Exact times if computable Bounded times if exact not computable Can be measured

Verteilte Systeme (Distributed Systems)

Chapter Outline. Chapter 2 Distributed Information Systems Architecture. Distributed transactions (quick refresh) Layers of an information system

Service-Oriented Architecture

殷亚凤. Processes. Distributed Systems [3]

Designing and debugging real-time distributed systems

Resource Containers. A new facility for resource management in server systems. Presented by Uday Ananth. G. Banga, P. Druschel, J. C.

Operating Systems. V. Input / Output

Building blocks: Connectors: View concern stakeholder (1..*):

Chapter 4 Multithreaded Programming

4.8 Summary. Practice Exercises

Cloud-Native Applications. Copyright 2017 Pivotal Software, Inc. All rights Reserved. Version 1.0

Utilizing Linux Kernel Components in K42 K42 Team modified October 2001

The Concurrency Viewpoint

Graph and Timeseries Databases

Chapter 2 Distributed Information Systems Architecture

CAS 703 Software Design

CSE398: Network Systems Design

Lecture 9: MIMD Architectures

Processes in Distributed Systems

Chapter 9. Software Testing

Good Practices in Parallel and Scientific Software. Gabriel Pedraza Ferreira

WHAT IS SOFTWARE ARCHITECTURE?

Operating Systems (ECS 150) Spring 2011

GNU Radio runtime. Reinventing a very fast wheel. Andrej Rode FOSDEM Andrej Rode GNU Radio runtime FOSDEM / 21

Technical design in UML for AngularJS applications and other web applications

FUNCTIONAL BEST PRACTICES ORACLE USER PRODUCTIVITY KIT

Patterns for Asynchronous Invocations in Distributed Object Frameworks

CS533 Concepts of Operating Systems. Jonathan Walpole

OBJECT-ORIENTED DESIGN

Smart Client Offline Data Caching and Synchronization

Chapter 4: Threads. Operating System Concepts. Silberschatz, Galvin and Gagne

Gustavo Alonso, ETH Zürich. Web services: Concepts, Architectures and Applications - Chapter 1 2

Six Patterns for Process-Driven Architectures

Characterising Resource Management Performance in Kubernetes. Appendices.

CHAPTER 3 - PROCESS CONCEPT

Performance Issues in Parallelization Saman Amarasinghe Fall 2009

Virtual machines (e.g., VMware)

Introduction. Software Architecture VO/KU ( / ) Roman Kern. KTI, TU Graz

System Design. Design: HOW to implement a system

Introduction to Software Architecture. The top level... (and design revisited)

Page 1. Challenges" Concurrency" CS162 Operating Systems and Systems Programming Lecture 4. Synchronization, Atomic operations, Locks"

Implementing the Twelve-Factor App Methodology for Developing Cloud- Native Applications

Module 6 Node.js and Socket.IO

NAME: STUDENT ID: MIDTERM 235 POINTS. Closed book, closed notes 70 minutes

Web Development 20480: Programming in HTML5 with JavaScript and CSS3. Upcoming Dates. Course Description. Course Outline

Java Concurrency in practice Chapter 9 GUI Applications

Chapter 3 Parallel Software

Processes in Distributed Systems

20480C: Programming in HTML5 with JavaScript and CSS3. Course Code: 20480C; Duration: 5 days; Instructor-led. JavaScript code.

DISTRIBUTED HIGH-SPEED COMPUTING OF MULTIMEDIA DATA

Flash: an efficient and portable web server

OS Extensibility: SPIN and Exokernels. Robert Grimm New York University

Java SE7 Fundamentals

CSC Operating Systems Fall Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. August 27 th, 2009.

Announcements. Computer System Organization. Roadmap. Major OS Components. Processes. Tevfik Ko!ar. CSC Operating Systems Fall 2009

G52CON: Concepts of Concurrency

NightStar. NightView Source Level Debugger. Real-Time Linux Debugging and Analysis Tools BROCHURE

Transcription:

Execution Architecture Software Architecture VO (706.706) Roman Kern Institute for Interactive Systems and Data Science, TU Graz 2018-11-07 Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 1 / 55

Outline 1 Definition 2 Design 3 Stereotypes 4 Detailed Design 5 Connecting conceptual and execution views 6 Behaviour 7 Execution on the Web Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 2 / 55

Definition What is execution architecture? Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 3 / 55

Execution View Focuses on the system runtime structure Hardware elements, subsystems, processes and threads Suited for examining quality attributes, most-notably runtime attributes E.g. performance, security, usability, But also e.g. scalability Similarly to conceptual architecture comprised of components and connectors Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 4 / 55

Components in execution architecture Concurrent components (abstraction created by execution of a software program) If the system is a single-computer, single-process, single-thread system then the execution architecture is very simple Figure: The simplest execution architecture Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 5 / 55

Components in execution architecture Thus, execution architecture is needed for distributed, concurrent systems Nowadays, huge majority of systems comes into this category e.g., network-based systems e.g., multi-processor systems (multi-core), sometimes abstraction through OS e.g., multi-threaded systems - GUI systems belong here as well (event-thread) Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 6 / 55

Components in execution architecture Components Hardware - only boundaries Concurrent subsystems - e.g. a database system Processes - an OS process, runs on a single computer and has its own memory space Threads - an OS thread - executes concurrently with other threads within the memory space of a parent process Typically, we have different execution models depending on granularity Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 7 / 55

Connectors in execution architecture Connectors Connectors indicate that one component calls another The arrow depicts the call direction The arrow head points from the calling component to the called component Three different types of arrows for three different calling scenarios Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 8 / 55

Connectors in execution architecture Synchronous communication The calling components waits for a response of the called component Asynchronous communication The calling component does not wait for a response Callback The calling component receives a response asynchronously by setting a means by which the called component can send response later Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 9 / 55

Connectors in execution architecture Figure: Execution connectors from Software Architecture Primer Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 10 / 55

Execution architecture: Example Figure: Example of execution architecture from Software Architecture Primer Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 11 / 55

Conceptual vs. Execution arch. Element Conceptual Execution Components Domain-level responsibilities Unit of concurrent activity Connectors Information flow Invocation Views Single Multiple Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 12 / 55

Conceptual vs. Execution arch. Figure: Conceptual vs. execution from Software Architecture Primer Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 13 / 55

Design How to create the execution architecture? Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 14 / 55

Execution Architecture Design Here we design a number of different models Some of them will include physical components, i.e. hardware Each model is a model at a specific level of granularity Less details Concurrent subsystems Processes More details Threads Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 15 / 55

Concurrent subsystems model Concurrent subsystems model Top-level execution model To get an overview of the running system Subsystems can be quite complex and have many processes and/or threads However, a concurrent subsystem is not something that is clearly defined only in some cases it is clear Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 16 / 55

Concurrent subsystems model Figure: Client-server execution architecture: subsystems Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 17 / 55

Concurrent subsystems model A large number of similar processes should be treated as a single unit E.g. the indexing system of a search engine A lot of processes there but logically they belong to the same unit Crawler, parsers, analysers, index updating, Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 18 / 55

Concurrent subsystems model A process that has a high degree of internal concurrency (threads) should be treated as a concurrent subsystem E.g. a server is typically a single process but might create threads to handle client requests Existing systems are best treated as concurrent subsystems E.g. a file server Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 19 / 55

Concurrent subsystems model A concurrent subsystem is always long-lived Created when the systems is started Closed when the system is shutdown Operates throughout the system lifetime Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 20 / 55

Process model Process model Restricting a concurrency model to processes depicts the execution structure Basically, you examine each concurrent subsystem for processes You do not go into details on external systems Typically, such models will be only slightly more detailed than concurrent subsystem models Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 21 / 55

Process model Figure: Client-server execution architecture: processes Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 22 / 55

Stereotypes Common types of components in the execution architecture? Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 23 / 55

Execution stereotypes Similarly to conceptual components execution components can belong to stereotypes Again we will use three different stereotypes Each stereotype has a particular clearly defined semantics In execution architecture this semantics describes the kind of concurrent activity Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 24 / 55

Execution stereotypes User-initiated: the component performs action because of user input This components are always user-interfaces In typical case such components exhibit a certain amount of internal concurrency e.g., an event thread that listens to user-input events Enhances responsiveness of user-interface, and in general usability Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 25 / 55

Execution stereotypes Active: the component generates activity internally e.g., components loop continuously or wake up periodically e.g., cron-job Typical for real-time portions of the system e.g., a crawler in a search engine might be an active component Whenever there is a new page it generates activity and invokes parser, analyser, indexer, Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 26 / 55

Execution stereotypes Services: the component waits for requests of other components and generates responses for such requests Typically performs a complex task and has clearly defined protocol for communication with other components e.g., database, web, file servers In most cases services are concurrent subsystems that exhibit a large amount of internal concurrency Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 27 / 55

Execution stereotypes Figure: Execution stereotypes from Software Architecture Primer Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 28 / 55

Sample Execution Architecture We start first with the big picture: concurrent systems Our system is a Web application What concurrent subsystems do we have? Obviously: a Web browser and a Web server Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 29 / 55

Sample Execution Architecture The (part of) application logic is on the server side We need a Web server which can run applications Thus, the Web server is actually a Web application server Additionally, we have an external system - another concurrent subsystem Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 30 / 55

Sample Execution Architecture Figure: Concurrent subsystem execution architecture Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 31 / 55

Detailed Design Fine grained architecture? Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 32 / 55

Detailed execution model Includes processes and threads Threads do not have their own memory space nor they have their own copy of the code in memory The code is loaded only once by their parent process The memory is typically shared by the threads We need to take care about thread synchronization Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 33 / 55

Quality attributes Many quality attributes are addressed by the execution architecture E.g. usability in GUIs is addressed by a special event thread E.g. a highly reliable component needs a separate execution component E.g. security typically requires a separate execution component Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 34 / 55

Example 1: GUI Event Thread We have a multimedia player, e.g. it executes an animation but the GUI needs to be responsive Which threads do we have? How do they communicate? Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 35 / 55

Example 2: Web server cache with dynamic content E.g. a wiki system where users edit content In cache you have all documents + valid/invalid flag If valid serve from cache If invalid: reload in cache, set valid flag How is caching executed? Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 36 / 55

Example 3: Web server cache with a database server E.g. a content management system with content stored in a database What happens when a field is updated in the database? Note, database server is a separate process Which threads do we have on the Web server side? Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 37 / 55

Sources of concurrency Many reasons why separate, concurrent compontents are beneficial: Forks in a use-case map require concurrent activities Components that perform significant amounts of computation are best modeled as concurrent activities (usability, performance) Network components are also concurrent activities (usability, performance) Concurrent components might be beneficial if developed by separate teams (loose coupling) Critical components might be isolated Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 38 / 55

Sources of concurrency Downsides of concurrent components: Realtime components might be isolated from non-realtime components Latency introduced by context switched between components Synchronisation overhead due to shared data Concurrency adds to the complexity of the system (and might hard to find bugs, e.g. Heisenbugs) Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 39 / 55

Sample Detailed Execution Architecture Figure: Detailed execution architecture Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 40 / 55

Sample Detailed Execution Architecture Figure: Detailed execution architecture Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 41 / 55

Sample Detailed Execution Architecture Figure: Detailed execution architecture Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 42 / 55

Connecting views Connecting conceptual and execution views Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 43 / 55

Binding execution and conceptual models We need to decide where conceptual components reside in the execution architecture Which of them might be on the users device and which of them in logic component on the server (Unfortunately) There are no strict rules for this! Depends on the quality attributes we need to satisfy E.g. if performance is needed - if large number of users move some conceptual components to the client Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 44 / 55

Binding execution and conceptual models Figure: Binding conceptual and execution architecture for the example application Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 45 / 55

Behaviour Implications of the behaviour on the execution architecture? Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 46 / 55

Execution behaviour We will use-case maps to model behaviour Actually we need only to verify that execution architecture supports the desired behaviour find errors in the architecture We can use the same use-case maps from the conceptual architecture Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 47 / 55

Execution behaviour Figure: Execution behaviour for use case new route Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 48 / 55

Execution behaviour Figure: Execution behaviour for use case buy ticket Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 49 / 55

Execution on the Web Concurrency on the Web Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 50 / 55

Concurrency on the Web We had concurrency on the server side With introduction of AJAX it is possible to have concurrency in a browser You can communicate asynchronously with the server If you decide to do so then you have to think about the updating strategy Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 51 / 55

Concurrency on the Web How do we communicate asynchronously HTTP There is no native HTTP support for asynchronous communication You have to simulate this Typically by polling HTML5 introduces WebSockets API Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 52 / 55

Concurrency on the Web Figure: Asynchronous communication server/client Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 53 / 55

Conclusions Use-case maps to find errors (even if they appear redundant) Don t overdo documenting dynamic behaviour (only with architectural impact) In complex scenarios make deployment models, e.g. map concurrent components to physical components e.g. processors, hardware/software subsystems, network devices Put systems to separate nodes for improved scalability, security e.g. legacy systems, off-the-shelf systems, critical components Separate realtime components from non-realtime components (But) don t overdo separate nodes e.g. costs, maintenance, points of failure, synchronization Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 54 / 55

The End Next: Implementation Architecture Roman Kern (ISDS, TU Graz) Execution Architecture 2018-11-07 55 / 55