Oky i want to build e-commerce app for my internship using microservice architecture To…
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
Oky i want to build e-commerce app for my internship using microservice architecture
To start will i want to simulate a proficianale software engineer requirement with function and non-functional requirement in this video you're going to learn how to develop a spring boot application using microservices architecture this is going to be a highly practical tutorial so to follow along I expect you to have at least a basic understanding about spring Boot and basic understanding of what microservices architecture is and why you use them this video is sponsored by lumo lumo's troubleshooting and observability platform autonomously deploys open Telemetry in under 5 minutes with a single click automatically capturing and 00:27 contextualizing all of the data developers need to troubleshoot microservices issues in production lumo is the only distributed tracing platform that enriches traces with complete in context request and response playload and correlates them to the relevant logs and metrics enabling developers to resolve issues up to 80% faster to know more about lumo check out the link in the description section so we'll be building a simple online shop application using microservices architectural patterns using mainly spring Boot and the latest spring Cloud 00:58 Technologies we're going to cover all the interesting and important architectural patterns like service Discovery centralized configuration distributor tracing even driven architecture centralized logging and much more if you're not aware of what are these fancy terms don't worry we'll cover this in the tutorial so before going ahead and implementing our microservices let's take a moment to understand what is spring Cloud spring cloud is a project under the spring projects ecosystem so it's another 01:25 project like spring boot spring data Spring Security or any other spring project but it mainly concentrates on helping us to build the reliable and robust microservices it provides us a common set of design patterns which are implemented already like the configuration Management Service Discovery circuit breakers so and there are many other patterns which are implemented into the spring Cloud project we'll have a look at it in depth in this tutorial you don't need to worry about that we're going to use spring 01:55 Cloud to mainly develop the microservices that's what you need to know as you understood what is spring Cloud now let's go ahead and let's go ahead and check what are the different Services we're going to build in this tutorial so the first service we're going to build is going to be a product service so this service provides us a API to create and view products in our application and it also acts like a product catalog where we can view all the products inside our inside of application so the next service is going 02:26 to be an order service where we can order the products which are available in the app and uh after that we also going to have an inventory service where the order service can check if the product is in stock or not before submitting the order and lastly we're also going to have a notification service where we can send email notifications after the order is placed successfully and out of these four Services we are going to mainly have the order service inventory service and the notification service talk to each other 02:57 we mainly have the in synchronous and as well as the synchronous communication as part of these three services so now let's go ahead and check the overall solution architecture of our project all right so this is how the solution architecture diagram looks like so mainly we are going to first look at the services we are developing so we have the product service which is talking to a mongodb and an order service which is talking to the mySQL database and the inventory service is also talking to the mySQL database to store all the 03:28 inventory information and we have the notific ification service which is like a stateless service which it does not have any database but it is responsible to just send out notifications to the users if you're talking about a microservice architecture you cannot call it as a microservice architecture if the services are not talking with each other right so here the order service is talking to the inventory service so whenever whenever an order is being placed we'll first check whether the inventory is available or Not by 03:54 making a synchronous communication and uh after that we are also going to send out the notification once the order is being placed successfully so for that we are going to make an asynchronous communication with the notification service if you're not sure what is synchronous and asynchronous communication don't worry we will also cover this in detail in the in this tutorial for asynchronous communication we are going to use Kafka and coming to the outside world we have the surrounding Services which enable the 04:19 microservice architecture we have the API Gateway which acts like a gateway to send the requests from the user to different services so for example if I am a user and I want to to communicate with the product service I don't want to give the host name or the IP address of the product service to communicate with it right so the API Gateway acts as like a gatekeeper to send out the requests to different Services we like so so our applications is also being secured using the authorization server called as keycloak uh we'll also have a look at it 04:50 in the detail and other than that we also have different services like urea and we are going to use grafana stack to implement observability we are going to use grafana low Kei to Aggregate and view to aggregate the logs from our microservices and uh we are going to view this logs in grafana using grafana Loki we going to use grafana tempo for distributed tracing and we are going to use Prometheus to collect metrics and uh finally we're going to use grafana to visualize the metrics of our applications of our services in a in a 05:25 beautiful dashboard finally we are going to containerize all the services using Docker and uh using we will run the all the docker containers first using Docker compose and then we will migrate this Docker compos workloads to kubernetes and again don't don't be overwhelmed with all these details we will have a look at each of them in detail in this tutorial all right so if you'll have a look at the logical architecture of each of the services we have a controller service and a repository layer for each of the 05:56 services so in the controller layer we will be uh receiving receiving the HTTP request from the from the clients and from there the business logic is being executed on the service layer and in some of the services we are also going to communicate with a message CU so that's why we have this message Q communication and mainly in the order service we are going to make use of the message CU and also the notification service and after that we are also going to store the information in the database so for that we are also going to 06:26 maintain a repository layer which mainly talks to the database so we have MySQL and also the mongodb database so both of them will follow the same pattern we'll have a repository which talks to the database this is how almost all the services are are being structured so we'll follow the same process for all the services we have all right so now it's time to coding uh the first thing I'm going to do is to create the product Service uh project I'm going to open start. spring.io project uh website this 06:57 is where we usually generate the starter project starter for all our projects so first of all for the project I'm going to create a maven project I'm going to select Maven as the build tool and of course we're going to use Java as a language and for the spring boot version as of creating this tutorial the latest spring boot version is 3.2. 07:18 4 so I'm going to select that version for the group ID I'm going to uh type in as com. te. microservices and for artifact ID I'm going to provide it as product service and the description is going to be called as product service you can type uh any description you like the package name I'm going to just provide as com te microservices and product I'm going to remove the service here I'm going to choose the packaging type as well and I'm going to choose the Java version as Java 21 coming to the dependencies first of all I'm going to add the
- Assistant