This is the 26th day of my participation in the August Text Challenge.More challenges in August

  • 📢 welcome to like: 👍 collect ⭐ message 📝 if there are mistakes please correct, give people rose, hand left lingering fragrance!
  • 📢 This article was originally written by Webmote and originally published by Nuggets.
  • 📢 author’s motto: life is toss about, when you don’t toss about life, life will start to toss about you, let us come on together! 💪 💪 💪

1. Dapr profile

Dapr, a Microsoft-led distributed runtime, aims to create an event-driven, portable, scalable distributed runtime that can be built in the cloud as well as locally.

Service discovery, infrastructure service proxy gateway, state management, message subscription and publishing, and Actors and telemetry are the preferred microservices architectures.

2. Eshop example

Microsoft’s Web applications basically use Eshop as an example to illustrate that they can really complete the needs of XXX, so this time is no exception, a microservice based on Dapr is in front of us.

Eshop’s business is a small online store with order, payment, sorting, shopping cart, and more.

3. Microservices Architecture

This example supports multiple deployment scenarios, using either Docker or Kubernetes. Let’s look at the architecture. Okay?

Microservices use Dapr’s Actors, state management, service building blocks, publish/subscribe, security configuration, and event binding triggers. Here’s a more complete example.

This set of services adopts the classic separation method, consisting of front-end SPA and back-end Api. Focus on the backend architecture.

The back-end services are managed uniformly using Dapr. The SPA front end accesses an Api gateway composed of the base service Envoy and the FRONT service composed of the Dapr functions of SideCar mode.

The login authorization Service is performed by Identity Service. Note that it is independent and not part of the Dapr Service. Provides OAuth authorization Token.

Through Dapr, Api gateway can directly access major business Api services (Basket, Catelog, Ordering, Payment) and Api aggregation services (BFF). The Api Aggregation service (Web Shopping Aggregator) accesses the aggregation upstream service interface through Dapr’s access interface.

In the upstream Api service, its communication protocol is Http, while Dapr uses GRPC protocol to communicate with it, and communicates with the downstream service through Http. You can also use the GRPC protocol.

4. Project address

The project is stored on Github, and interested kids can pull it down and run it down, because OF memory configuration issues on my working machine, I didn’t get this example up and running.

Yes, the local debugging environment of micro services is a big problem, to build up a K8s set, it is a headache.

What jobs does Dapr simplify?

Dapr makes it easy for developers to write microservices using any language or framework. It solves many of the challenges in distributed applications, such as:

  • How do distributed services discover each other and communicate synchronously?
  • How do they implement asynchronous messaging?
  • How do they maintain context information throughout the transaction?
  • How can they adapt to failure?
  • How do they scale to meet changing needs?
  • How are they monitored and observed?

Project file structure

Hope to have it up and running by the weekend!

dapr init
Copy the code

🎏 5. Summary

Routine summary, rational view!

Knot is what ah, knot is I want you to praise but can not get lonely. 😳 😳 😳

👓 have seen this, but also care about a thumbs-up?

👓 has been liked, but also care about a collection?

👓 are collected, but also care about a comment?