Microservices with Net Core 8 and Net Core 6

FranklinGallardo7 92 views 50 slides Jul 08, 2024
Slide 1
Slide 1 of 50
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50

About This Presentation

it's developer microservices of net core 6 and net core 8, it's awesome and very nice


Slide Content

.NET CORE MICROSERVICES THE COMPLETE GUIDE BHRUGEN PATEL

What is Microservice? How to correctly implement Microservice?

OUTDATE COURSE!

EF Core .NET Core API

SQL Server VS 2022 .NET 8 Azure Subscrption

WHY MICROSERVICES? Independently Deployable Independently Scalable. No Bulky Code. Reduce Downtime. Course Overview

MICROSERVICES Frontend Web Application PRODUCT SHOPPING CART ORDER EMAIL

User adds first item to the Cart - Create Cart Header - Create Cart Details User adds a new item in the shopping cart. (User already has few other items in cart) - Find Cart Header - Add Cart Details under same Cart Header Id User updates quantity of an existing item in the cart - Find Details - Update Count in Cart Details Shopping Cart Logic

OAuth2 OpenID Connect 9 OAuth2 and OpenID Connect Built on top of Auth2 Authorization Works with Access_token

DOCKER! MULTIPLE TECHNOLOGY What this course is NOT about?

What this course is NOT about?

Client Identity Provider

IdentityServer 5 / Duende I d entity Server IdentityServer5 (Duende Identity Server) https://docs.duendesoftware.com/identityserver/v5 IdentityServer is an implementation of OpenID Connect and OAuth2 and is highly optimized to solve the typical security problems of today’s mobile, native and web applications.

ASYNC AWAIT WITHIN CODE

Microservices Application contains multiple loosely coupled microservices Individual Technology Stack Communication between microservices Separation of Concern

Microservices Application Flow Gateway .NET Identity Shopping Cart Order Coupon Email Rewards MVC Application Product Service Bus :7002 :7000 :7001 :7003 :7004 :7777

Traditional Monolith Application ASP.NET Core Application Product Component Shopping Cart Component Order Component Models Views Controller Repository Service … Models Views Controller Repository Service … Models Views Controller Repository Service …

ASP.NET Core Application ASP.NET Core Application Microservices Application ASP.NET Core Application Product Component Shopping Cart Component Order Component Models Views Controller Repository Service … Models Views Controller Repository Service … Models Views Controller Repository Service … ASP.NET Core Application Models, Views, Controllers…

COMMUNICATION (SYNC/ASYNC) SYNCHRONOUS COMMUNICATION - Synchronous communication was never a problem in relatively small monolithic applications because it is a very simple concept to reason about. The client sends a request to the server, and the server responds to the client. An advantage of synchronous communication is that the service receives an acknowledgement that the request was received, and the corresponding action was executed. ASYNCHRONOUS COMMUNICATION - When using asynchronous communication, the calling service does not wait for a response from the called service. Asynchronous communication also allows the possibility of One-To-Many communication, where a client can send a message to multiple services at once.

Microservices Application Flow Gateway .NET Identity Shopping Cart Order Coupon Email Rewards MVC Application Product Service Bus :7002 :7000 :7001 :7003 :7004 :7777

Identity Server Terminology Client Identity Resource API Resource Identity Token Access Token

Azure Storage Queue  is a service for storing large numbers of messages Azure Messaging Microsoft Azure Service Bus is a message broker with message queues and publish-subscribe topics. Azure Service Bus Azure Storage Queues

TOOLS NEEDED 01 03 SQL SERVER 2018 02 AZURE SUBSCRIPTION 04 VISUAL STUDIO 2019 .NET 6

Microservices Application Flow (Without Gateway) .NET Identity Shopping Cart Order Coupon Email Rewards MVC Application Product Service Bus :7002 :7000 :7001 :7003 :7004

Microservices Application Flow (With Gateway) Gateway .NET Identity Shopping Cart Order Coupon Email Rewards MVC Application Product Service Bus :7002 :7000 :7001 :7003 :7004 :7777

Client-to-microservice Communication Client communicates directly with all the microservices in this architecture.

Disadvantages of Client-to-microservice Tight coupling Security Monitoring API

Adding a Gateway Single point of entry to set of services Easier Security Management Larger application

Disadvantages of Gateway Tight coupling Extra layer Development

OVERVIEW 1 Here you could describe the topic of the section

PRODUCT API BASIC SETUP 02

BRIEF INTRODUCTION Venus has a beautiful name and is the second planet from the Sun. It’s terribly hot—even hotter than Mercury—and its atmosphere is extremely poisonous

OVERVIEW 1 Here you could describe the topic of the section

“This is a quote. Words full of wisdom that someone important said and can make the reader get inspired.” —SOMEONE FAMOUS

RabbitMQ Open-source messaging system RabbitMQ implements the AMQP protocol RabbitMQ Includes Reliability Routing Browser based UI Cross-platform

ASSIGNMENT – PRODUCT API Setup Product API Database / Tables Setup DbContext and Seed Product Table Setup AutoMapper CRUD functionality Product API Setup Authentication & Authorization in API Create/Edit/Delete – ADMIN Role Read – Any Authorized User Web Project to Consume API (Product API Port – 7000) Implement Product Service and Controller in Web Project Views for Product CRUD Operations

EXCHANGE Exchange Queue RabbitMQ Message Broker Routes

EXCHANGE TYPES DIRECT EXCHANGE FANOUT EXCHANGE TOPIC EXCHANGE HEADER EXCHANGE

DIRECT EXCHANGE Direct Exchange Queue RabbitMQ Message Broker Routes

DIRECT EXCHANGE Publisher Direct Exchange Queue Consumer RabbitMQ Message Broker Routing Key = checkoutQueue Routes

FANOUT EXCHANGE Fanout Exchange Queue RabbitMQ Message Broker Routes Queue Queue

TOPIC EXCHANGE Topic Exchange Queue RabbitMQ Message Broker Routes Queue Queue Routing Key: all.email.* *. newCustomer .* *. platinumCustomer .* *.*.*

HEADER EXCHANGE HEADER Exchange Queue RabbitMQ Message Broker Queue Role = basicCustomer Type= promotional Role = platinumCustomer Type= educational

QUEUES Queue Name Name of the queue Durable Persist the queue to disk Exclusive Delete queue when not needed Auto Delete Queue deleted when consumer unsubscribes

BINDINGS Exchange Queue RabbitMQ Message Broker Queue Binding Binding

STANDARD QUEUE Publisher Queue Consumer RabbitMQ Message Broker

STANDARD QUEUE Publisher Direct Exchange Queue Consumer RabbitMQ Message Broker Routing Key = checkoutQueue Routes

DIRECT ROUTING Publisher Direct Exchange Queue Queue Consumer Consumer RabbitMQ Message Broker PaymentEmail PaymentOrder

PUBLISH AND SUBSCRIBE Publisher Exchange Queue Queue Consumer Consumer RabbitMQ Message Broker
Tags