Distributed systems engineering and Lab
Module LAB

Academic Year 2024/2025 - Teacher: ALESSANDRO MIDOLO

Expected Learning Outcomes

General learning objectives in terms of expected learning outcomes.

1. Knowledge and understanding: the student will know advanced development mechanisms, including collaborative and distributed development, validation of complex systems, automation of the release process, design and implementation of distributed microservice systems.

2. Applying knowledge and understanding: the student will have the ability to use advanced development, validation and release tools for distributed applications.

3. Making judgements: the student will acquire the ability to analyze development, validation and release systems for distributed applications.

4. Communication skills: the student will learn to describe in technical language the fundamental characteristics of development, validation and release systems for distributed applications.

5. Learning skills: the student will be able to address and solve problems of use and implementation in realistic contexts, studying, evaluating and using new technologies for the development, validation and release of distributed applications.

Course Structure

Lectures for concepts and solutions, explanation of code examples for the techniques examined.

Required Prerequisites

Ability to design and implement object-oriented systems in C++ or Java

Attendance of Lessons

Attendance at classes is strongly recommended.

Detailed Course Content

Introduction to DevOps: It explores the fundamental practices of DevOps, comparing the waterfall model and the AGILE model. Dives into DevOps culture, key concepts such as SCM, pipelines, and the practices of continuous integration, continuous delivery, and continuous deployment. Microservices architecture and the importance of infrastructure automation and infrastructure as code are explored. Finally, monitoring and logging and the need for communication and collaboration for project success are discussed.

Git and Maven: An introduction to the Version Control System (VCS) and the Distributed Version Control System (DCVS), with a focus on Git. Git configuration, various git workflows, and fundamental commands are covered, including branching, merging, and resolving merge conflicts. The use of remote repositories is explored. Maven is also explored in depth, covering Maven configuration, the POM file, dependency management, and the use of Maven plugins to streamline the build process.

Microservices: It addresses the design and development of microservice-based applications, focusing on two main technologies: Spring Boot and Python. It explores how to create and manage microservices using Spring Boot, highlighting its features and benefits. It also analyzes the best practices for developing microservices in Python, illustrating useful frameworks and tools for implementing scalable and maintainable architectures.

Microservices Design Patterns: It explores the fundamental architectures and practices for managing microservices. We discuss patterns such as database per service, which streamlines data management, and the saga pattern for managing distributed transactions. We also explore event sourcing to track changes in application state. We delve into the importance of the API Gateway to manage communications between clients and microservices, and the service registry to monitor available services. Finally, we look at implementing API health checks to ensure the health and availability of microservices.

Distributed Tracing: It focuses on tracing techniques in applications and microservices. The concept of tracing is introduced to monitor and analyze interactions between services in a distributed architecture. The use of OpenTracing, a standard for distributed tracing, is explored, and various useful tools are discussed to implement tracing in microservices and distributed systems, improving visibility and diagnosis of application performance.

Software Testing: It delves into the essential techniques and tools for ensuring software quality. It begins with unit testing, introducing the concepts of test suites and scaffolding. The use of JUnit and Mockito to write and manage automated tests is analyzed. It also explores tools such as JaCoCo for measuring code coverage, and discusses mutation testing and regression testing to ensure software stability after changes. Finally, it addresses automatic test generation, facilitating the approach to testing and improving efficiency.

Textbook Information

  1. G. Kim et al.: The DevOps Handbook. It Revolution Press, 2016
  2. S. Chacon and B. Straub: Pro Git. Apress, 2014
  3. Sonatype Company: Maven: The Definitive Guide. O'Reilly, 2008
  4. B. Laboon: A Friendly Introduction to Software Testing. CreateSpace Independent Publishing, 2017
  5. Pezze, M. Software testing and analysis: process, principles, and techniques. John Wiley & Sons, 2008
  6. M. Macero: Learn Microservices with Spring Boot. Apress, 2017
  7. Yuri Shkuro: Mastering Distributed Tracing: Analyzing performance in microservices and complex systems. Packt Publishing, 2019
  8. Newman, Sam. Monolith to microservices: evolutionary patterns to transform your monolith. O'Reilly Media, 2019
  9. S. Newman: Building Microservices. O'Reilly, 2015
  10. Richardson, Chris. Microservices patterns: with examples in Java. Simon and Schuster, 2018

Course Planning

 SubjectsText References
1Introduction to DevOps, DevOps culture, SCM & pipelines, continuous integration, continuous delivery, continuous deployment[1]
2Git, Distributed Version Control System (DCVS), git workflow, maven, dependency management, maven plugins[2, 3]
3Microservices: Monolith vs Microservices, Conway's Law, Monolith First, Coordination, Service Discovery, Load Balancing, Session Affinity, VMs and Containers[8, 9]
4Microservices with Spring Boot: Spring Boot Initializr and Starters, Dependency Injection, Spring Web Application Architecture, RESTful APIs, CRUD, Zuul[6]
5Design Patterns for microservices: Database per service, Saga, Event Sourcing, API Gateway, Service Registry, Health Check API[10]
6Distributed Tracing in applicazioni a Microservizi con Open Tracing e Jaeger[7]
7Unit Testing: Test Suite & Scaffolding, JUnit, JaCoCo, Mockito[4,5]
8Mutation Testing: quality evaluation of a test suite, PITest[5]
9Automatic test suite generation: random generation with Randoop, evolutionary generation with EvoSuite, notes on Model CheckingNotes provided

Learning Assessment

Learning Assessment Procedures

The exam consists of a paper agreed upon before the exam date, which consists of the implementation of a small software system, and then an oral exam. The exam will be evaluated very well if it is shown that the student has acquired a deep knowledge of the course concepts and precision in their presentation. An intermediate grade will be given if the exam shows a partial understanding of the topics. A barely sufficient grade will be given when, despite partial knowledge of the topics, they are presented superficially. The learning assessment may also be carried out electronically, if conditions require it.

Examples of frequently asked questions and / or exercises

Key Features of a DevOps Approach

Describe the concept of Mutation Testing

What is the relationship between Dependence Injection and Unit Testing

Describe the concept of Session Affinity and how to avoid it in a Microservices context

Show the typical structure of a Microservices application implemented using Spring Boot

Describe the database per service design pattern

Discuss the difference between logging and tracing in a distributed application