The course is part of this learning path
Store2008 Review - Overview of the .Net Monolithic Code
Store2018 - Refactor and Redesign
This course will enable you to:
Understand the principles and patterns associated with microservices
Understand the principles and patterns associated with Restful APIs
Understand important requirements to consider when migrating a monolithic application into a microservices architecture
Understand the benefits of using microservices and associated software patterns and tools to build microservice based applications at speed and scale
Understand tradeoffs between different architectural approaches
Become familiar and comfortable with modern open source technologies such as Dotnet Core, Docker, Docker Compose, Linux, Terraform, Swagger, React
Become familiar with Docker and Container orchestration runtimes to host and run containers, such as Docker Compose, Amazon ECS using Fargate, and Amazon EKS
A basic understanding of software development
A basic understanding of the software development life cycle
A basic understanding of Devops and CICD practices
Familiarity with Dotnet and C#
Familiarity with AWS
Software Developers and Architects
DevOps Practitioners interested in CICD implementation
Anyone interested in understanding and adopting Microservices and Restful APIs within their own organisation
Anyone interested in modernising an existing application
Anyone interested in Docker, and Containers in general
Anyone interested in container orchestration runtimes such as Kubernetes
Welcome back. In this lecture we'll begin the redevelopment of our monolithic application into our microservices architecture. For this, we're gonna use Visual Studio for Mac, Community edition. We're gonna do this because it aligns with our strategy to re-architect not just from a monolithic architecture to microservices, but to make our technology stack more open-source based. Okay, let's get started. So, within Visual Studio Community edition, let's take a quick look at, at the version that we're using.
So, I'm running on Mac, and I'm using version 7.5.4 build 3. These are the details. So, it comes pre-installed with these .NET Core Runtimes, and we're gonna develop specifically with the 2.1.1 version. Okay. Next, let's create our Solution, which we'll use to host all our projects. So the first project we'll spin up is a ASP.NET Core Web App MVC project. This'll be our Store2018 presentation component. So click next. Again, selecting the .NET Core 2.1 framework. Next again, and we'll give it a project name. So we'll call it Store2018. And we'll store it in the, microservices-demo folder. Open. Okay. Version control, we'll use git.
Click create. Okay, so you can see here that Visual Studio has correctly created our solution, and placed within it our ASP.NET MVC application as the first project. So lets jump over into the terminal, and have a look at the directory structure. So, listing the contents we can see that we have a directory Store2018. So this is the solution directory. So if we navigate into it, then we do a list contents. You can see that indeed we have a solution file, and within it is our ASP.NET MVC project directory. So the next thing I'm gonna do is create another directory called services, and this services directory will host our account service, inventory service, and shopping service projects. Okay, lets jump back into Visual Studio, and within our solution we will add a solution folder, and we'll call it services as well.
Okay, under services we'll create our first service component, so, add new project. We'll select the ASP.NET Core Web API template, which is found under the .NET Core App subsection. So, there it is there. Okay, we're gonna use .NET Core 2.1 as the target framework, click next, for project name we'll call it AccountService, and under location we want to make sure that it goes into the services folder. Okay, click create. Okay, so that's our first service. We'll add the next one, which is the inventory service. And give it a name, InventoryService. And again, we want to make sure that it goes in the services directory. So, this has called me out a couple of times, so, under location be careful.
So, click create. Excellent, that's in the right place. And then we do the last service, which is our shopping service. And we'll call it ShoppingService. Click create, and that's good. So we've got our three service components. Okay, if we jump back over into the terminal. Lets take a look at the directory structure of our services directory. And as expected, under services we have three services. Our AccountService, InventoryService, and ShoppingService. And each of them share the same project structure.
Each of these services is a Web API project. Again, if we go back to our microservices architecture, what we've set up is our three Web API services, and then we'll set up our presentation service. Which is an ASP.NET Core project. Okay, lastly what we'll do is we'll do a quick compile. So, under build we'll do a clean all. Followed by a rebuild all. And I would expect this to compile because we haven't changed any of the source code. So, it's looking good. And the build is successful. So, that completes this lecture, and in the next lecture we'll start to fill out each of these projects with the changes required for the microservices architecture to work. Go ahead, and close this lecture, and we'll see you shortly in the next one.
About the Author
Jeremy is the DevOps Content Lead at Cloud Academy where he specializes in developing technical training documentation for DevOps.
He has a strong background in software engineering, and has been coding with various languages, frameworks, and systems for the past 20+ years. In recent times, Jeremy has been focused on DevOps, Cloud, Security, and Machine Learning.
Jeremy holds professional certifications for both the AWS and GCP cloud platforms.