Microservices by Examples Using .NET Core
eBook - ePub

Microservices by Examples Using .NET Core

Using .NET Core

Biswa Pujarini Mohapatra

Share book
  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Microservices by Examples Using .NET Core

Using .NET Core

Biswa Pujarini Mohapatra

Book details
Book preview
Table of contents
Citations

About This Book

A book with lot of practical and architectural styles for Microservices using.NET Core Key Features

  • Understand core concept of Microservices
  • Understand various Microservices design patterns
  • Build microservices application using real-world examples
  • Deployment of microservices using Docker
  • Microservices Orchestration using Azure Service Fabric
  • Azure DevOps (CI/CD) using MSBuild
  • Understand the concept of API Management
  • Authentication/Authorization using JWT token for Microservices
  • Integrating Microservices in Angular 6.0 Single Page Application.
  • Dos and don'ts during integration
  • Ensuring End to end testing


Description
This book predominately covers Microservices architecture with real-world example which can help professionals on case adoption of this technology. Following the trend of modularity in real world, the idea behind Microservice by Examples is to allow developers to build their applications from various independent components which can be easily changed, removed or upgraded. Also, it is relevant now because of enterprises are moving towards DevOps/ Modernisation, this book will emphasise on containers and Dockers as well. What You Will Learn

  • Microservices and its Architecture
  • Designing the microservice application layer
  • Hands on Micro services development of Online Hotel Booking App
  • Deployment of Microservices for App-Modernization at Scale with Docker
  • Service Orchestration of Microservices using Azure Service Fabric
  • Integrating various components
  • Hands on Integration with API Management
  • Testing Microservices


Who This Book Is For
This book is for.NET Core developers who are new to microservices and want to learn, understand the microservices architecture. Table of Contents

  • An introduction to Microservices
  • Micro services Architecture
  • Designing the microservice application layer
  • Hands on Micro services development of Online Hotel Booking App
  • Deployment of Microservices for App-Modernization at Scale with Docker
  • Service Orchestration of Microservices using Azure Service Fabric
  • Integrating various components
  • Hands on Integration with API Management
  • Testing Microservices
  • Extending application with logging
  • What is next?
  • About the Author
    Biswa has done MCA from ICFAI university, a TOGAF certified. She has over 13 years of experience in Enterprise Software Services, Product Development & Management, evangelize and deliver new products. Drive the go-to-market strategy working closely with the sales team. Baishakhi Banerjee Baishakhi has completed MCA from Techno India affiliated under WBUT and is also an MCTS. She has over 13 years of experience in working with MS Technologies but for past couple of years, while working in application design and architecture, she has started working with other technologies too. Gaurav Aroraa Gaurav has done M.Phil in computer science. He is an MVP, life time member of Computer Society of India (CSI), Advisory member of IndiaMentor, certified as a scrum trainer/coach, XEN for ITIL-F and APMG for PRINCE-F and PRINCE-P. Gaurav is Open source developer, Founder of Ovatic Systems Private Limited.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Microservices by Examples Using .NET Core an online PDF/ePUB?
Yes, you can access Microservices by Examples Using .NET Core by Biswa Pujarini Mohapatra in PDF and/or ePUB format, as well as other popular books in Computer Science & Web Services & APIs. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9789387284586

CHAPTER 1

An Introduction to Microservices

Microservices is a new buzzword and is getting more popular day-by-day. In this chapter, we will focus to understand microservices.
To better understand what Microservices is, it is an architectural style generally used to develop large software applications loosely coupled with bounded contexts. Loosely coupled means each service are modular, small, and Independent runs on its process, each service is independently manageable and deployable.
In this chapter, you will get the understanding of all the necessary terms required to understand microservices. We will cover the following:
ā€¢ Understanding microservices concepts
ā€¢ Discussing monolithic and history behind it
ā€¢ Explaining concepts of web services, WCF, etc.
ā€¢ Discussing SOA
ā€¢ Discussing important concepts
ā€¢ Adopting microservices

Understanding Microservices Concepts

To know more about microservices, we should know what it is and the history behind it. The microservice architecture is a pattern to develop an application containing a set of smaller services. Microservices are independent of each other and run in their own processes. A significant advantage of these services is that, it can be developed and deployed independently on their own process. In other terms, we can say that microservices are a way to isolate our services so they can be handled entirely independent of each other in the context of designing, development, deployment, and upgrades.
Companies like Netflix, Amazon, and Spotify have a Microservices Architecture serving their resource and requests-intensive business services that, in the average case, have to scale at the scale.

What are Microservices

Let us understand what microservices mean; Microservices is an architecture pattern, offer a better way to build to decouple components within an application boundary. Microservice architecture is a style of designing software systems which divide significant software applications into many small services that can run independently. Each of the microservices has its own team working on it, so they are entirely separated from each other. This allows every service to run its own unique process and communicate autonomously without having to rely on other services or the application as a whole.

History of Microservices

Term microservices came in contact in mid of 2011.
The principle behind microservices is often just good architecture principles.
Microservices principles have been with us since decades; just the implementations are new. Understand the philosophy behind microservices, what microservices are, what they replaced. In the beginning of1980s with the introduction of the first significant systems distribution technology: Remote Procedure Calls (RPC). RPC was the concept behind Sun Microsystemsā€™ initial ONC RPC as well as the basic idea behind DCE (1988) and CORBA (1991).
The microservices style of architecture develops complex application software from small, individual applications that communicate with each other using language-independent interfaces (APIs). Companies run into trouble if they are unable to scale monolithic architecture that has developed over time if their architecture is difficult to upgrade or maintenance becomes too complicated. Microservices can be the answer to this problem, as they break down complex tasks into smaller processes that work independently of each other.
In 2014, James Lewis and Martin Fowler came together and provided a few real-world examples and presented microservices (refer to: https://www.martinfowler. com/articles/microservices.html) in their own words and further detailed it as follows:
The term ā€œMicroservice Architectureā€ has been quite popular over the last few years to explain an appropriate way of designing software applications as components of autonomously deployable services. While there is no precise definition of this architectural style, there are particular common characteristics around organization around business capability, automated deployment, intelligence in the endpoints, and decentralized control of languages, and data.
The world is moving towards the next generation of HTTP, forging strategies to create small, cross-platform containers that host independent microservices. It is very essential to know all aspect Lewis and Fowler defined above.

Microservices are Modular and Independent

When we say, Microservices have loosely coupled; it means each service is small and designed to solve specific business function. Microservices are broken down into multiple service components by design, which can be developed by a small development team so that each of the services can be developed and deployed independently without compromising the integrity of the application. In a microservice architecture-based approach, each microservice owns its process and data so that it will be independent of a development and deployment point of view. Typically, a tiered approach is taken with a back-end store, middle-tier business logic, and a front-end user interface (UI). Microservice has evolved over the past couple of years to build distributed applications that are for the cloud. Any programming language can write it and use any framework.

Microservices are Decentralized and Cross-functional

The ideal organization for microservices has small, engaged team where each team is in charge of a business function made out of various microservices which can be independently deployed. Teams handle all parts of development for their microservices, from development to deployment, and hence all level of team members required to deliver Microservices from developers, quality engineers, DevOps team and Product architects. This organization design is consistent with Conwayā€™s law, which says that the interface structure of a software system will reflect the social fabric of the organization that produced it. The code is organized around business capabilities.

Microservices are Resilience

Application developed as microservices are better for fault isolation, if one service fails, others will continue to work. This is one of the benefits of building distributed systems like microservices, that is the ability of the system to resist faultsTand unexpected failures of elements, networks, computer resources, etc. These systems are resilient even within the face of errors. The concept behind this resiliency looks simple: if our Monolithic application fails, everything that itā€™s accountable fails at the side of it; therefore letā€™s break things into smaller modules so we can withstand individual pieces of our app failing without affecting the entire system. Dealing with fault isolation in a distribution system is not very straightforward; that is the main reason microservices needs orchestrator for high availability. It is essential to choose a better cloud computing infrastructure for microservices to orchestrate microservices because the various parts of the application are segregated. A problem could happen in one section without affecting other areas of the application.

Microservices are Highly Scalable

In the previous section we read about several benefits of adopting Microservices, Scalability is the utmost importance of any distributed system and Microservices are designed for scaling. Scaling permits applications to react to variable load by increasing and decreasing the number of instances of roles, queues, and alternative services they use. It is easy to quantify the efficiency of a monolithic application but evaluating and quantifying the ability of a broad ecosystem of Microservices are quite tricky because Microservices are partitioned into thousands of small services. When it comes with the scalability of any system, it can be scale-in or scale out. We will learn about Scalability (both scale-in and scale-out) in Microservices with examples in the next chapter.

Discussing Monolithic and History Behind it

In monolithic software, we mainly built as a single unit. The monolithic software is designed to be self-contained; components of the program are interconnected and interdependent rather than loosely coupled as is the case with modular software programs. In a tightly-coupled architecture, each component and its associated components must be present in order for the code to be executed or compiled.
The monolithic architectural style is a traditional architecture type and has been widely used in the IT business. The term monolithic is not new and has come from the UNIX world. In UNIX, most of the commands exist as a standalone program whose functionality is not dependent on any other program.
Enterprise applications are built in 3 layers: A data access layer, Business layer / Service layer and UI/Presentation layer. It is a single layered software application in which the presentation layer and data access layer are consolidated into a single program on a single platform.
ā€¢ Presentation layer: Presentation (UI) layer in which user interacts with an application, all client-side logic, client-side validation related logics taken acre by this layer.
ā€¢ Business Logic layer: Business Logic layer contains all the logic related to business context, which is a middle layer communicating between Presentation and data access layer.
ā€¢ Data access layer: Data Access layer contains all the logic related to backend or Database.
In a traditional web application, client (a browser) posts a request. The business tier executes the business logic, the database collects/stores application-specific persistence data, and the UI shows the data to the user.
A monolithic app which is designed without modularity, each layer is tightly coupled. If the changes are required in one business function, entire application needs to be rebuilt and deployed. The major problem with this design is itā€™s not designed for scalability and fault tolerance. If an exception occurs in one module, then the entire system will fail to function. Technical debt from a monolithic code base is a measurable reality in traditional DevOps. With monolithic code, even isolated components receive the same memory, as well as s...

Table of contents