Parsing the Microsoft MicroServices architecture eshoponcontainers

Source: Internet
Author: User
Tags docker toolbox
to promote. Net core, Microsoft has provided us with an open source Demo-eshoponcontainers, a platform developed using the Net core framework that spans almost all platforms, Windows, Macs, Linux, Android, iOS), a microservices-based, small-scale application running in a container that not only demonstrates the cross-platform nature of. Net Core, but also demonstrates the power of VS2017, and all code is developed under VS2017. As you can see from the name, this is an electronic store application running on a container that leverages Docker's cross-platform so that we can "build once, run anywhere".

First, Introduction

Eshoponcontainers is a simple. Net core application based on the MicroServices architecture and Docker container. At present, the micro-service architecture in full swing, Docker technology has developed rapidly, Microsoft at this time to launch this demo, it is conceivable, although this demo can not be fully applied to the production environment, but for our developers, but very good learning materials, whether you are slightly modified or the use of the structure to re-development, Learning such a demo is very necessary, which reminds me of learning blogengine.net before.

Second, the structure

Let's take a look at the architecture diagram that Microsoft provides to us

From left to right we see 2 dashed boxes on the left side of each client application, and on the right are the hypothetical web apps, microservices apps, and databases on Docker.

In the demo, Microsoft built multiple service according to different functions, and in designing these service, Microsoft used different ways to implement, as shown in:

These are the four services that Microsoft has shown in the demo, and you can 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 and system I use on my caller's side.

Third, the source code

This set of architectures is open source on GitHub, address: https://github.com/dotnet-architecture/eShopOnContainers

We can clone the source code through GIT:

We see that there are 3 sln, it is recommended to open with vs2017, if you install the full version, You can open EShopOnContainers.sln, but generally for beginners, we open the Eshoponcontainers-servicesandwebapps.sln solution.

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

Iv. Necessary Environment:

It was said that our application is cross-platform and can be run on any Docker-enabled operating system, but we need the environment to debug when we develop debugging (you can also use iisexpress for debugging, of course)

1, 64bit Windows ten Pro

2. Turn on Hyper-V (Microsoft virtual machine)

3. Installing Docker for Windows

If we are the WIN10 version, although we can install Docker Toolbox, but there is no way to use VS2017 for Docker debugging, run error, for this tutorial, I decided to upgrade my computer to Win10, so as to better display.

In addition to installing Docker Toolbox, you will need to install it if you want to run debugging under the previous system:

1, NodeJS

2, Bower

Docker for Windows has 2 types of containers on WIN10 or server 2016, Linux container and Windows container, where we only need to use the Linux container (default). Our tutorials are only for services and WebApp, Microsoft recommends setting up Docker with 4096M (4G) and CPU 3, if you want to run the full version (including Mobile client), then you need to configure 16G memory for Dockere.

My personal advice, you'd better have a machine dedicated to the database, or a mssql-linux-sql Docker will need 4G of memory, needless to say, to build a redis.

When we're learning, we don't have to use Docker for debugging, and using IIS Express can, in which way it doesn't matter, is important to learn.

Five, learning steps:

This series is about the ServicesAndWebApps.sln code, we will learn from MicroServices first, and then look at the code structure of the Web Part. The approximate order is as follows:

1. Identity Service

2. Catalog Service

3, ordering Sevice

4. Basket Service

5. WEBAPP MVC

6, Webspa

Written at the end:

The previous time is busy, but has been very concerned about the development of. NET core, at the previous Builder Conference, 2.0 of the stunning debut, completely let me believe that Microsoft will spare no effort to develop. NET, also make me wait. NET developer feel the spring, so this is the world all. Net Developer salute, we waited for the 10 ah.

Why choose this architecture, because it is written by Microsoft, very instructive, and now the micro-service and Docker concept is getting more and more fire, the current company is based on services (not yet to reach the concept of micro-service), in the deployment, development, maintenance, expansion has a lot of inconvenience, so this study is very important to me.

The first part of the comparison of nonsense, the following will be around the code and architecture and design patterns to explain, welcome to subscribe. Finally, a picture.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.