Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Hands-On Microservices ??? Monitoring and Testing
Hands-On Microservices ??? Monitoring and Testing

Hands-On Microservices ??? Monitoring and Testing: A performance engineer's guide to the continuous testing and monitoring of microservices

eBook
$17.99 $25.99
Paperback
$32.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

Hands-On Microservices ??? Monitoring and Testing

Anatomy of Microservice Decomposition Services

In Chapter 1, Software Architecture Patterns, we discussed the microservice architecture and its benefits and challenges. The microservice architecture approach is all about dividing a complex monolithic application into several different independent services, which run independently on several machines or cloud servers. In this chapter, we will discuss the anatomy of the microservice architecture and look at how to decompose a monolithic application into a number of processes.

This chapter will discuss microservices in detail, including how to use applications and services. We will also look at the decomposition of the microservice architecture on the basis of business capability and the domain and subdomain.

By the end of this chapter, you will understand how microservices are built and will be able to build your own. You will also...

Anatomy of a microservice

One of the biggest challenges in using a microservice architecture is deciding how to break an existing, complex monolithic system into several services. A microservice architecture structures a complex system into more manageable, separate services, each of which focuses on a specific part of your business goal.

As we know, managing complex monolithic applications is much harder than managing a small service, for developers as well as Quality Assurance (QA) teams. A potential method of reducing the complexity of a monolithic application is by using a distributed application development approach, which refers to the decomposition of a monolithic application into several smaller microservices. It is important to consider how microservices can be made to achieve the same business goal as the original monolithic application. Microservices provide a perfect...

Decomposition based on business capability

Business capability refers to structured modeling, which provides a high-level overview of the business. Business capabilities are the top layer of the business architecture and belong to the business domain. We can split a monolithic application into services based on their business capabilities. These services have broad context boundaries, including user interface, persistent storage, and any external collaborations. Consequently, the teams are cross-functional and include the full range of skills required for the development: user experience, database, and project management.

A business capability refers to how a business architecture model behaves in order to achieve a business goal. A business capability is similar to a business object. Let's define the services of our application based on its business capabilities:

  • Customer...

Decomposition on the basis of domain

You can also split a monolithic application into a microservice-based application based on its domain. The domain decomposition methods focus on a bounded context, which is a central pattern of Domain-Driven Design (DDD). Domain decomposition methods split a domain into subdomains. You can define services that correspond to the subdomains of the DDD, as shown in the following diagram:

The preceding diagram shows a decomposition based on subdomains. Each subdomain has a corresponding service. Subdomains can be classified according to business processes. For example, as you can see in the preceding diagram, we have decomposed the online bookshop application into the following subdomains:

  • Customer Account Management
  • Book Inventory Management
  • Order Management
  • Shipping Management

The main challenge of this approach lies in identifying the subdomains...

Microservice chassis to handle cross-cutting concerns

In any new application development, you are often required to implement particular scenarios or services, such as cross-cutting concerns. You have to spend a significant amount of time implementing common cross-cutting concerns in the development of a new application. Let's have a look at the following cross-cutting concerns:

  • Build system and externalized configuration: We have to choose either a Maven or a Gradle-based system to compile, package, version, and resolve external dependencies. This will also deal with further external configurations, such as credentials, and the network locations of external services, including databases or message brokers.
  • Implement logging: Logging is also required for all services of a new application development. You have to configure a logging framework, such as Java, Log4j, Logj42...

Building microservices

In this section, we will discuss how to build a microservice-based application using the same online bookshop example as in the previous sections. Our application has the following four modules:

  • Customer Account Management
  • Order Management
  • Book Inventory Management
  • Shipping Management

I will create a microservice for each of these modules. The following microservices correspond to the application modules:

  • Customer Account Management → Account Service
  • Order Management → Order Service
  • Book Inventory Management → Book Service
  • Shipping Management → Shipping Service

The following diagram shows the architecture of this online bookshop application:

As you can see in the preceding diagram, we have four core microservices in this application. This architecture also has two more services: an API Gateway and the Shopfront UI web application...

SOAP versus RESTful microservices

SOAP and RESTful microservices have the following differences:

SOAP

RESTful microservices

An XML-based message protocol.

An architectural style.

Uses WSDL for communication between the consumer and the provider.

Use XML or JSON to send and receive data.

Invokes services by calling the RPC method.

Simply call services via the URL path.

The transfer is over HTTP. Also uses other protocols, such as SMTP or FTP.

The transfer is over HTTP only.

SOAP-based reads can't be cached.

RESTful microservice reads can be cached.

SOAP is not very scalable

RESTful microservices are very scalable.

SOAP is more suitable for enterprise systems and high-security systems, such as a banking system.

RESTful microservices are suitable for all types of systems apart from where high security and high reliability is critical...

Summary

In this chapter, we have discussed the decomposition of a monolithic application into a microservice-based architecture. You can decompose a monolithic application based on either its business capabilities or its domain. Business capabilities are the processes that are required for the business goal. In domain-based decomposition, we can use a bounded context, which is a central pattern for the DDD. In the DDD, we have to identify the domain's subdomains, each of which has a corresponding service in the application architecture.

We have built an online bookshop application with a microservice architecture. We have also discussed the differences between SOAP and RESTful microservices.

In Chapter 3, Microservices Deployment Patterns, we'll gain an understanding of how to deploy microservices and how these services communicate with each other in the architecture...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Learn different approaches for testing microservices to design and implement, robust and secure applications
  • Become more efficient while working with microservices
  • Explore Testing and Monitoring tools such as JMeter, Ready API,and AppDynamics

Description

Microservices are the latest "right" way of developing web applications. Microservices architecture has been gaining momentum over the past few years, but once you've started down the microservices path, you need to test and optimize the services. This book focuses on exploring various testing, monitoring, and optimization techniques for microservices. The book starts with the evolution of software architecture style, from monolithic to virtualized, to microservices architecture. Then you will explore methods to deploy microservices and various implementation patterns. With the help of a real-world example, you will understand how external APIs help product developers to focus on core competencies. After that, you will learn testing techniques, such as Unit Testing, Integration Testing, Functional Testing, and Load Testing. Next, you will explore performance testing tools, such as JMeter, and Gatling. Then, we deep dive into monitoring techniques and learn performance benchmarking of the various architectural components. For this, you will explore monitoring tools such as Appdynamics, Dynatrace, AWS CloudWatch, and Nagios. Finally, you will learn to identify, address, and report various performance issues related to microservices.

Who is this book for?

This book is for developers who are involved with microservices architecture to develop robust and secure applications. Basic knowledge of microservices is essential in order to get the most out of this book.

What you will learn

  • Understand the architecture of microservices and how to build services
  • Establish how external APIs help to accelerate the development process
  • Understand testing techniques, such as unit testing, integration testing, end-to-end testing, and UI/functional testing
  • Explore various tools related to the performance testing, monitoring, and optimization of microservices
  • Design strategies for performance testing
  • Identify performance issues and fine-tune performance

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 30, 2018
Length: 160 pages
Edition : 1st
Language : English
ISBN-13 : 9781789138405
Vendor :
Apache
Languages :
Concepts :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want

Product Details

Publication date : Oct 30, 2018
Length: 160 pages
Edition : 1st
Language : English
ISBN-13 : 9781789138405
Vendor :
Apache
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 142.97
Hands-On Microservices ??? Monitoring and Testing
$32.99
Software Architect’s Handbook
$54.99
Microservices Development Cookbook
$54.99
Total $ 142.97 Stars icon

Table of Contents

10 Chapters
Software Architecture Patterns Chevron down icon Chevron up icon
Anatomy of Microservice Decomposition Services Chevron down icon Chevron up icon
Microservices Deployment Patterns Chevron down icon Chevron up icon
Inter-Service Communication Chevron down icon Chevron up icon
Service Registry and Discovery Chevron down icon Chevron up icon
External API Gateway Chevron down icon Chevron up icon
Testing of Microservices Chevron down icon Chevron up icon
Performance Testing of Microservices Chevron down icon Chevron up icon
Performance Monitoring of Microservices Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Most Recent
Rating distribution
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.7
(6 Ratings)
5 star 33.3%
4 star 0%
3 star 0%
2 star 33.3%
1 star 33.3%
Filter icon Filter
Most Recent

Filter reviews by




Bayr Mar 12, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
good
Subscriber review Packt
Yogesh Mehta Nov 19, 2022
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
Writer has written limited things about AWS CloudWatch in the book who is selling on the platform of amazon itself
Amazon Verified review Amazon
Devesh Apr 27, 2020
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
It seems the content in the book is stiched together after being picked from many places. It takes only basic implementation examples of frameworks and brief description of tools. It totally "ignores" to pick complex examples and scenarios. Overall, its not a very thoughtful piece of work.
Amazon Verified review Amazon
ARJIT GAUTAM Oct 25, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very well written and provides you clear understanding.
Amazon Verified review Amazon
Amazon Customer Jun 27, 2019
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Expected better
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.