Preface

Although “microservices” is a new term, the concepts that it represents have been around for long time. In 2006, Werner Vogels (CTO at Amazon) gave a talk at the JAOO conference presenting the Amazon Cloud and Amazon’s partner model. In his talk he mentioned the CAP theorem, today the basis for NoSQL. In addition, he spoke about small teams that develop and run services with their own databases. Today this structure is called DevOps, and the architecture is known as micro services.

Later I was asked to develop a strategy for a client that would enable them to integrate modern technologies into their existing application. After a few attempts to integrate the new technologies directly into the legacy code, we finally built a new application with a completely different modern technology stack alongside the old one. The old and the new application were only coupled via HTML links and via a shared database. Except for the shared database, this is in essence a microservices approach. That happened in 2008.

In 2009, I worked with another client who had divided his complete infrastructure into REST services, each being developed by individual teams. This would also be called microservices today. Many other companies with a web-based business model had already implemented similar architectures at that time. Lately, I have also realized how continuous delivery influences software architecture. This is another area where microservices offer a number of advantages.

This is the reason for writing this book—a number of people have been pursuing a microservices approach for a long time, among them some very experienced architects. Like every other approach to architecture, microservices cannot solve every problem. However, this concept represents an interesting alternative to existing approaches.

Overview of the Book

This book provides a detailed introduction to microservices. Architecture and organization are the main topics. However, technical implementation strategies are not neglected. A complete example of a microservice-based system demonstrates a concrete technical implementation. The discussion of technologies for nanoservices illustrates that modularization does not stop with microservices. The book provides all the necessary information for readers to start using microservices.

For Whom Is the Book Meant?

The book addresses managers, architects, and developers who want to introduce microservices as an architectural approach.

Managers

Microservices work best when a business is organized to support a microservices-based architecture. In the introduction, managers understand the basic ideas behind microservices. Afterwards they can focus on the organizational impact of using microservices.

Developers

Developers are provided with a comprehensive introduction to the technical aspects and can acquire the necessary skills to use microservices. A detailed example of a technical implementation of microservices, as well as numerous additional technologies, for example for nanoservices, helps to convey the basic concepts.

Architects

Architects get to know microservices from an architectural perspective and can at the same time deepen their understanding of the associated technical and organizational issues.

The book highlights possible areas for experimentation and additional information sources. These will help the interested reader to test their new knowledge practically and delve deeper into subjects that are of relevance to them.

Structure and Coverage

The book is organized into four parts.

Part I: Motivation and Basics

The first part of the book explains the motivation for using microservices and the foundation of the microservices architecture. Chapter 1, “Preliminaries,” presents the basic properties as well as the advantages and disadvantages of microservices. Chapter 2, “Microservice Scenarios,” presents two scenarios for the use of microservices: an e-commerce application and a system for signal processing. This section provides some initial insights into microservices and points out contexts for applications.

Part II: Microservices—What, Why, and Why Not?

Part II not only explains microservices in detail but also deals with their advantages and disadvantages:

Chapter 3, “What Are Microservices,” investigates the definition of the term “microservices” from three perspectives: the size of a microservice, Conway’s Law (which states that organizations can only create specific software architectures), and finally a technical perspective based on domain-driven Design and Bounded Context.

• The reasons for using microservices are detailed in Chapter 4, “Reasons for Using Microservices.” Microservices have not only technical but also organizational advantages, and there are good reasons for turning to microservices from a business perspective.

• The unique challenges posed by microservices are discussed in Chapter 5, “Challenges.” Among these are technical challenges as well as problems related to architecture, infrastructure, and operation.

Chapter 6, “Microservices and SOA,” aims at defining the differences between microservices and SOA (service-oriented architecture). At first sight both concepts seem to be closely related. However, a closer look reveals plenty of differences.

Part III: Implementing Microservices

Part III deals with the application of microservices and demonstrates how the advantages that were described in Part II can be obtained and how the associated challenges can be solved.

Chapter 7, “Architecture of Microservice-Based Systems,” describes the architecture of microservices-based systems. In addition to domain architecture, technical challenges are discussed.

Chapter 8, “Integration and Communication,” presents the different approaches to the integration of and the communication between microservices. This includes not only communication via REST or messaging but also the integration of UIs and the replication of data.

Chapter 9, “Architecture of Individual Microservices,” shows possible architectures for microservices such as CQRS, Event Sourcing, or hexagonal architecture. Finally, suitable technologies for typical challenges are addressed.

• Testing is the main focus of Chapter 10, “Testing Microservices and Microservice-Based Systems.” Tests have to be as independent as possible to enable the independent deployment of the different microservices. However, the tests need to not only check the individual microservices, but also the system in its entirety.

• Operation and Continuous Delivery are addressed in Chapter 11, “Operations and Continuous Delivery of Microservices.” Microservices generate a huge number of deployable artifacts and thus increase the demands on the infrastructure. This is a substantial challenge when introducing microservices.

Chapter 12, “Organizational Effects of a Microservices-Based Architecture,” illustrates how microservices also influence the organization. After all, micro-services are an architecture, which is supposed to influence and improve the organization.

Part IV: Technologies

The last part of the book shows in detail and at the code level how microservices can be implemented technically:

Chapter 13, “Example of a Microservices-Based Architecture,” contains an exhaustive example for a microservices architecture based on Java, Spring Boot, Docker, and Spring Cloud. This chapter aims at providing an application, which can be easily run, that illustrates the concepts behind microservices in practical terms and offers a starting point for the implementation of a microservices system and experiments.

• Even smaller than microservices are nanoservices, which are presented in Chapter 14, “Technologies for Nanoservices.” Nanoservices require specific technologies and a number of compromises. The chapter discusses different technologies and their related advantages and disadvantages.

Chapter 15, “Getting Started with Microservices,” demonstrates how micro-services can be adopted.

Essays

The book contains essays that were written by experts of various aspects of micro-services. The experts were asked to record their main findings about microservices on approximately two pages. Sometimes these essays complement book chapters, sometimes they focus on other topics, and sometimes they contradict passages in the book. This illustrates that there is, in general, no single correct answer when it comes to software architectures, but rather a collection of different opinions and possibilities. The essays offer the unique opportunity to get to know different viewpoints in order to subsequently develop an opinion.

Paths through the Book

The book offers content suitable for each type of audience. Of course, everybody can and should read the chapters that are primarily meant for people with a different type of job. However, the chapters focused on topics that are most relevant for a certain audience are indicated in Table P.1.

Image

Table P.1 Paths through the Book

Readers who only want to obtain an overview are advised to concentrate on the summary section at the end of each chapter. People who want to gain practical knowledge should commence with Chapters 13 and 14, which deal with concrete technologies and code.

The instructions for experiments, which are given in the sections “Try and Experiment,” help deepen your understanding by providing practical exercises. Whenever a chapter is of particular interest to you, you are encouraged to complete the related exercises to get a better grasp of the topics presented in that chapter.

Supplementary Materials

Errata, links to examples, and additional information can be found at http://micro-services-book.com/. The example code is available at https://github.com/ewolff/microservice/.

Register your copy of Microservices at informit.com for convenient access to downloads, updates, and corrections as they become available. To start the registration process, go to informit.com/register and log in or create an account. Enter the product ISBN 9780134602417 and click Submit. Once the process is complete, you will find any available bonus content under “Registered Products.”

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset