Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Microsoft Micro Service Architecture eShopOnContainers

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail the example analysis of Microsoft Micro Services Architecture eShopOnContainers. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

I. introduction

EShopOnContainers is a simple .net Core application based on micro-service architecture and Docker container. At present, the micro-service architecture is in full swing, docker technology is also developing rapidly, Microsoft launched this Demo at this time, its intention can be imagined, although this Demo can not be fully applied to the production environment, but for us developers, it is a very good learning material, whether you are slightly modified or re-developed using the architecture, learning such a Demo is very necessary, which reminds me of learning BlogEngine.Net before.

II. Structure

Let's take a look at the architecture diagram provided by Microsoft.

From left to right we see two dotted wireframes, on the left are client applications, and on the right are hypothetical web applications, microservice applications and databases on Docker.

In Demo, Microsoft builds several service according to different functions, and when designing these service, Microsoft uses different ways to implement them, as shown in the following figure:

These are the four services shown by Microsoft in Demo, and you can also use different frameworks and different databases to build your microservices, which is why microservices are so popular. I can use any language, any database can build my service, no matter what language or system my caller uses.

III. Source code

This architecture is open source on Github at https://github.com/dotnet-architecture/eShopOnContainers

We can clone the source code through git:

We see that there are 3 sln inside, it is recommended to use vs2017 to open, if you install the full version, you can open eShopOnContainers.sln, but generally for beginners, we still open eShopOnContainers-ServicesAndWebApps.sln solution.

You can see that webapp and service app are already covered in the solution, and our tutorials are based on this solution.

4. Necessary environment:

As mentioned earlier, our application is cross-platform and can run on any operating system that supports Docker, but when we develop and debug, we need the appropriate environment to debug (of course, you can also use iisexpress for debugging)

1 、 64bit Windows 10 Pro

2. Enable Hyper-V (Microsoft's virtual machine)

3. Install Docker for Windows

If we are the previous version of win10, although we can install Docker Toolbox, but there is no way to use VS2017 for Docker debugging, the runtime will report an error. For this tutorial, I decided to upgrade my computer to Win10 so that it can be better displayed.

If you want to debug and run on the previous system, in addition to installing Docker Toolbox, you need to install:

1 、 NodeJS

2 、 Bower

Docker for Windows has two types of containers on win10 or server 2016, Linux container and Windows Container, here we only need to use Linux Container (default). Our tutorial is only for Services and WebApp. Microsoft recommends that you set the memory for Docker to 4096m (4G) and CPU 3. If you want to run the full version (including mobile clients), you need to configure 16GB of memory for Dockere.

My personal advice is that you'd better have a dedicated database machine, otherwise a mssql-linux-sql docker needs 4G memory, not to mention a redis.

When we are learning, we do not have to use Docker for debugging, we can also use iis express, which way is not important, the important thing is to learn.

5. Learning steps:

This series is all based on ServicesAndWebApps.sln code. We will first learn from microservices, and then look at the code structure of the web section. The approximate order is as follows:

1 、 Identity service

2 、 Catalog Service

3 、 Ordering Sevice

4 、 Basket Service

5 、 WebApp Mvc

6 、 WebSPA

Write at the end:

I was busy some time ago, but I have been paying close attention to the development of .net Core. At the previous builder conference, the amazing appearance of 2.0completely made me believe that Microsoft would spare no effort to develop .net, and it also made me feel that spring was coming for .net Developer. We have waited for 10 years to pay tribute to all .net Developer in the world.

Why choose this architecture? because it is written by Microsoft, it is very instructive, and now the concepts of micro-services and Docker are becoming more and more popular. The current company is based on services (it has not yet reached the concept of micro-services), and there are a lot of inconveniences in deployment, development, maintenance and expansion, so this study is very important to me.

The first article is a bit more nonsense, which will be explained around the code and architecture and design patterns. You are welcome to subscribe. Finally, let's take an effect picture.

This is the end of the article on "sample Analysis of Microsoft Microservice Architecture eShopOnContainers". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report