Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Building Microservices with .NET Core
Building Microservices with .NET Core

Building Microservices with .NET Core: Develop skills in Reactive Microservices, database scaling, Azure Microservices, and more

Arrow left icon
Profile Icon Lalit Kale Profile Icon Soumya Mukherjee Profile Icon Gaurav Aroraa Profile Icon Manish Kanwar
Arrow right icon
S$36.99 S$52.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.3 (4 Ratings)
eBook Jun 2017 274 pages 1st Edition
eBook
S$36.99 S$52.99
Paperback
S$66.99
Subscription
Free Trial
Arrow left icon
Profile Icon Lalit Kale Profile Icon Soumya Mukherjee Profile Icon Gaurav Aroraa Profile Icon Manish Kanwar
Arrow right icon
S$36.99 S$52.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.3 (4 Ratings)
eBook Jun 2017 274 pages 1st Edition
eBook
S$36.99 S$52.99
Paperback
S$66.99
Subscription
Free Trial
eBook
S$36.99 S$52.99
Paperback
S$66.99
Subscription
Free Trial

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
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Building Microservices with .NET Core

DDD and its importance for microservices


Domain-Driven Design (DDD) is a methodology and a process of designing complex systems. In this section, we will briefly discuss DDD and how it is important in the context of microservices.

Domain model design

 The main objective of domain design is to understand the exact domain problems and then draft a model that can be written in any set of language/technologies. For example, in our Flix One bookstore application, we need to understand Order Management and Stock Management.

Here are a few characteristics of the domain-driven model:

  • A domain model should focus on a specific business model and not across multiple business models
  • It should be reusable
  • It should be designed in a way that it should be called in the loosely coupled way, unlike the rest of the system
  • It should be designed independently of persistence implementations.
  • It should be pulled out from a project to another location, so it should not be based on any infrastructure framework.

Importance...

The concept of Seam


At the very core of microservices lies the capability to work on a specific functionality in isolation from the rest of the system. This translates into all the advantages discussed earlier, such as reduced module dependency, code reusability, easier code maintenance, and better deployment.

In my opinion, the same attributes that were attained with the implementation of microservices should be maintained during the process of implementation. Why should the whole process of moving monoliths to microservices be painful and not be as rewarding as having the microservices itself? Just remember that the transition can't be done overnight and would need meticulous planning. Many capable solution architects have differed from my approach while presenting their highly capable teams. The answer lies not just in the points already mentioned but the risk to the business itself at the same time.

This is very well attainable. However, we must identify our way to the path correctly in...

Communication between microservices


In the preceding section, we separated our Order module into Order Services and discussed how we can break down the foreign key relationship between ORDER and PRODUCT tables.

In a monolithic application, we have a single repository that queries the database to fetch the records from both ORDER and PRODUCT tables. However, in our upcoming microservice application, we will segregate repositories between Order Service and Product Service. With each service having its respective database, each one would access its own database only. Order Service would only be able to access order Database, whereas Product Service would be able to access product Database only. Order Service should not be allowed to access product Database and vice versa. Refer to the following image:

Note

We will discuss communication between microservices in Chapter 3, Integration Techniques, in detail.

In the preceding figure, we see that our UI is interacting with Order Service and Product...

Revisiting the case study--Flix One


In the preceding chapter, we took an example of an imaginary company, Flix One Inc., operating in the e-commerce domain and having its own .NET monolithic application: Flix One book store. We have already discussed:

  • How to segregate the code
  • How to segregate the database
  • How to denormalize the database
  • How to begin transitioning
  • The available refactoring approaches 

In this section, we will start writing/transitioning .NET monolith to a microservice application.

Prerequisites

We will use the following tools and technologies while transitioning our monolithic application to the microservice-styled architecture:

  • Visual Studio 2015 or later
  • C# 6.0
  • ASP.NET Core MVC/Web API
  • Entity Framework
  • SQL Server

Transitioning to our product service

We already have our product module in place. We are going to pull back this module now and start with a new ASP.NET Core MVC project. For this, follow all the steps we discussed in the preceding sections and in Chapter 1, What Are Microservices...

Summary


In this chapter, we discussed different factors that can be used to identify and isolate microservices at a high level. We also discussed the various characteristics of a good service. Talking about DDD, we saw what its importance is in the context of microservices.

Further, we analyzed how we can correctly achieve vertical isolation of microservices through various parameters in detail. While we tried to draw upon our previous understanding of the challenges posed by a monolithic application and its solution in microservices, we saw that we can use factors such as module interdependency, technology utilization, and team structure to identify seams and perform the transition from a monolithic architecture to microservices in an organized manner.

It became apparent that the database can pose a clear challenge in the process. However, we identified how we can still perform this with a simple strategy and the possible approaches to do this. We then discussed that with the foreign keys...

Communication between microservices

In the preceding section, we separated our Order module into Order Services and discussed how we can break down the foreign key relationship between ORDER and PRODUCT tables.

In a monolithic application, we have a single repository that queries the database to fetch the records from both ORDER and PRODUCT tables. However, in our upcoming microservice application, we will segregate repositories between Order Service and Product Service. With each service having its respective database, each one would access its own database only. Order Service would only be able to access order Database, whereas Product Service would be able to access product Database only. Order Service should not be allowed to access product Database and vice versa. Refer to the following image:

We will discuss communication between microservices in Chapter 3, Integration...

Revisiting the case study--Flix One

In the preceding chapter, we took an example of an imaginary company, Flix One Inc., operating in the e-commerce domain and having its own .NET monolithic application: Flix One book store. We have already discussed:

  • How to segregate the code
  • How to segregate the database
  • How to denormalize the database
  • How to begin transitioning
  • The available refactoring approaches 

In this section, we will start writing/transitioning .NET monolith to a microservice application.

Prerequisites

We will use the following tools and technologies while transitioning our monolithic application to the microservice-styled architecture:

  • Visual Studio 2015 or later
  • C# 6.0
  • ASP.NET Core MVC/Web API
  • Entity Framework
  • SQL Server
...

Summary

In this chapter, we discussed different factors that can be used to identify and isolate microservices at a high level. We also discussed the various characteristics of a good service. Talking about DDD, we saw what its importance is in the context of microservices.

Further, we analyzed how we can correctly achieve vertical isolation of microservices through various parameters in detail. While we tried to draw upon our previous understanding of the challenges posed by a monolithic application and its solution in microservices, we saw that we can use factors such as module interdependency, technology utilization, and team structure to identify seams and perform the transition from a monolithic architecture to microservices in an organized manner.

It became apparent that the database can pose a clear challenge in the process. However, we identified how we can still perform this with a simple strategy...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Start your microservices journey and understand a broader perspective of microservices development
  • Build, deploy, and test microservices using ASP.Net MVC, Web API, and Microsoft Azure Cloud
  • Get started with reactive microservices and understand the fundamentals behind it

Description

Microservices is an architectural style that promotes the development of complex applications as a suite of small services based on business capabilities. This book will help you identify the appropriate service boundaries within the business. We'll start by looking at what microservices are, and what the main characteristics are. Moving forward, you will be introduced to real-life application scenarios, and after assessing the current issues, we will begin the journey of transforming this application by splitting it into a suite of microservices. You will identify the service boundaries, split the application into multiple microservices, and define the service contracts. You will find out how to configure, deploy, and monitor microservices, and configure scaling to allow the application to quickly adapt to increased demand in the future. With an introduction to the reactive microservices, you strategically gain further value to keep your code base simple, focusing on what is more important rather than the messy asynchronous calls.

Who is this book for?

This book is for .NET Core developers who want to learn and understand microservices architecture and implement it in their .NET Core applications. It’s ideal for developers who are completely new to microservices or have just a theoretical understanding of this architectural approach and want to gain a practical perspective in order to better manage application complexity.

What you will learn

  • Compare microservices with monolithic applications and SOA
  • Identify the appropriate service boundaries by mapping them to the relevant bounded contexts
  • Define the service interface and implement the APIs using ASP.NET Web API
  • Integrate the services via synchronous and asynchronous mechanisms
  • Implement microservices security using Azure Active Directory, OpenID Connect, and OAuth 2.0
  • Understand the operations and scaling of microservices in .NET Core
  • Understand the testing pyramid and implement consumer-driven contract using pact net core
  • Understand what the key features of reactive microservices are and implement them using reactive extension

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 14, 2017
Length: 274 pages
Edition : 1st
Language : English
ISBN-13 : 9781785884962
Vendor :
Microsoft
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
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jun 14, 2017
Length: 274 pages
Edition : 1st
Language : English
ISBN-13 : 9781785884962
Vendor :
Microsoft
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 S$6 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 S$6 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total S$ 201.97
Enterprise Application Architecture with .NET Core
S$74.99
Building Microservices with .NET Core
S$66.99
.NET Design Patterns
S$59.99
Total S$ 201.97 Stars icon
Banner background image

Table of Contents

10 Chapters
What Are Microservices? Chevron down icon Chevron up icon
Building Microservices Chevron down icon Chevron up icon
Integration Techniques Chevron down icon Chevron up icon
Testing Strategies Chevron down icon Chevron up icon
Deployment Chevron down icon Chevron up icon
Security Chevron down icon Chevron up icon
Monitoring Chevron down icon Chevron up icon
Scaling Chevron down icon Chevron up icon
Reactive Microservices Chevron down icon Chevron up icon
Creating a Complete Microservice Solution Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.3
(4 Ratings)
5 star 25%
4 star 25%
3 star 25%
2 star 0%
1 star 25%
Delano O'bryant Jan 12, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I found out about this book researching Mircoservices. I read clips of information from the web out of this book. It sparked my interest and got me developing Microservices. This book is a great quick references as well.
Amazon Verified review Amazon
Amazon Customer Aug 07, 2017
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Good work!, This book introduce to you to Microservices paradigm with most clearly.However is focused to Microsoft Azure Cloud could be touch AWS services or custom hosted only with Kestrel and IIS services.
Amazon Verified review Amazon
Simon Apr 15, 2022
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Most of the explanations of this book just waffle on. About coverting a monolith to microservices rather than a step by step, I'm not very impressed by it.
Amazon Verified review Amazon
Paul R. Chitoiu Jul 17, 2018
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
This is obviously aa very overpriced, very low quality book. It's published by Packt, which means pretty much anything can write one of these. Just look at the sample. Full of grammar errors and other weird things. Clearly written by non-english speakers who did not bother to use a proofreader. And it's over $40! What a joke...
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.