Microservices Tutorial for Beginners | Microservices Architecture | Microservices Training | Edureka
Key Takeaways
Implements microservices architecture using Spring Boot for beginners
Full Transcript
hello everyone I'm sahti from urea and welcome to today's session on microservices tutorial so thank you all the attendees for joining in today's session so first let's start by looking at all the topics we're going to cover in today's session we will start by understanding what was before microservices that is the monol architecture and then SE challenges after that we will deep dive into what are exactly microservices and then learn more about its architecture finally I will end this session by showcasing a practical implementation of microservices on Eclipse using spring boot so guys I hope that you're clear with today's agenda now many of you may think why should you learn microservices well I could justify by saying that many multinational companies such as eBay Netflix Amazon Uber use microservices in their company structure not just the multinational companies but the percentage of people using microservices has also tentatively increased looking at the job opportunities the average salary of microservices ranges from approximately $97,000 per year for a software engineer and a range of $116 per year for a senior software engineer isn't it great so now that you have a good reason to look learn microservices let's deep dive into learning more about microservices look at the scenario on the screen here Alice watches TV shows using an online media service called mediam mode.com which is similar to your Netflix or Amazon Prime so basically mediam more is an entertainment company which provides streaming media and videos online it consists of various genres of TV shows with different languages just like Netflix and Amazon Prime so in the past media more was also built as a large monolithic application where a team of developers would take lot of time to build all the features in the application on a single code base so here developers had to rewrite the code for every part of the application it's really confusing isn't it let me give you a proper definition of Monolithic architecture monolithic architecture can be defined as a framework wherein all the features of the system are put on a single code base and are under a single database so your features such as recommendations most popular content catalog are all put on a single code base and on a single database now after Decades of software development there are vast amount of codes already present out there that the developers can use as a base of their application so why would the developers want to rewrite the code again and again but here since media Mo uses the monolithic framework this raises a fantastic question about the challenges about this architecture so now let's look into the challenges of the monolithic architecture by looking at some scenarios scenario one assume that the developers wanted to make immediate changes in the application how would they do this well the monolithic application can definitely accommodate these changes but the problem here is that the developers must rebuild the code for every small change they make in any particular feature so even if they want to update a small change in a particular feature the complete system must be reframed again look at the second scenario where the developers want to update all the playlist according to the most popular TV shows and also want to simultaneously update all the videos to the HD quality in such scenarios developers cannot scale the application simultaneously instead new instances of the same application must be created every time a new feature has to be developed or deployed coming to the Third scenario consider the scenario where developers of this application are comfortable with various Technologies like Java C++ net chash Etc now in such situation even though they're comfortable with various Technologies they still have to build large and complex application on a single technology that is on the technology media was built finally consider a situation where a specific feature is not working in the application in such scenarios the company system goes down because of this problem in order to tackle this problem the application must be rebuilt retested and redeployed this means that the application has to be built from the scratch again so now all of you might be thinking how will the developers of Meo overcome these complexities well developers decided to rearchitecturing doll question what are microservices microservices is an architecture wherein all the components of the system are put into individual components which can be built deployed and scaled individually this means that each component is independent of each other okay so well Rohit just asked me a question if I could simplify the definition of microservices so Rohit let me explain you with a simple analogy you must have seen how bees build their honeycomb by aligning hexagonal wax cells they initially start with a small section using various materials and continue to build a large beehive out of it these cells form a pattern resulting in a strong structure which holds together a section of beehive here each cell is independent of each other but it is also correlated with the other cells this means that damage to one cell does not damage to the other cells so bees can reconstruct the cells without impacting the complete beehive look at the diagram on the screen each hexagonal shape represents an individual service component so similar to The Working of the bees each agile team Builds an individual service component with the available Frameworks and the chosen technology stack so the recommendation system can be built on a specific technology the video uploading team can build this feature on a specific technology and so on on just as in a beehive each service component forms a strong microservice architecture to provide better scalability that is a particular service can scale at its maximum without impacting the other services also issues with each service component can be handled individually by the agile team with no or minimal impact on the entire application so even if any one feature is down this does not close down the complete application but only that particular feature has to be rebuilt so Rohit I hope I've simplified the definition for you coming back to the scenario consider a situation when you log into your account on Netflix or Amazon Prime what do you all see you just see the recommended shows right so similar to that when Alice logs on into her account she sees a list of recommended shows but after some searching she finally gets a TV show she wants to watch now what if Alice wants a TV show with just a single click how will the developers of Media mode fulfill Alice request to fulfill Alice request developers of Media mode decided to shift their application from a monolithic architecture to microservices but before getting into how do the developers shift their monolithic framework into microservices let me brief you a little bit about different parts of microservice architecture the architecture consists of various users who send requests from various devices these requests are authenticated ated by the identity provider and are passed on to the API Gateway API Gateway thus acts as an entry point for all the client requests and passes the request to the specific microservices to be processed apart from the main components the architecture has other parts also such as static content which houses all the content from the system service discovery which acts as a guide to find the road of communication between microservices the content delivery networks which is basically a distri Ed network of proxy servers and their data centers now all of you might be thinking how will these parts work together on medam more application to process Alice requests Alice request is first passed on to the identity provider then the identity provider thus authenticates Alice request by identifying her as a regular user on media these requests are passed on to the API Gateway which acts as an entry point for Alice to forward a request to the appro appropriate microservices in this kind of framework each feature has its own working microservice handling their own data these microservices also have their own load balancers and execution environments to function properly this means that the most popular content the video uploading the search function the content catalog all have the load balancers handling the data and their execution environments to perform their functionalities so the developers are divided into small team such as content team video uploading team most trending team search team Etc each team has its own functionalities like the content team consists of millions of TV shows that the application provides the video uploading team has the responsibility to upload all the content into the application the most trending team houses the most trending shows according to the geographical location of users and so on these small team of developers relate each and every piece of content with with a metadata that describes the searched content then metadata is fed into another micros service that is the search function which ensures Alice search results are captured in the content catalog the third microservice that is the most trending microservice captures the trending content among all the MEO users according to their geographical locations the content from this microservice is what Alice sees when she first logs into Meo so these individually deed microservices are put into specific containers to join the application so what exactly are containers containers are used to deliver the code to the sector where deployment is required this means that they Plug and Play So if a micros service isn't working properly for the application then the developers can take it out and replace it with a new one but before they join the application to work together they still have to find each other to fulfill Alice's request which is basically how will they communicate with Each Other Well microservices use service discovery which acts as a guide to find the road of communication between each of them microservices then communicate with each other via stateless server either by HTTP or message pass after microservices communicate within themselves they have to deploy the static content to a cloud-based storage service that can deliver it directly to the clients via content delivery networks so sakshi has a question now what are exactly API doing that we've learned in the architecture for a microservice architecture to function the infrastructures components must be able to interact with each other so each individual microservice must be able to communicate with every other microservice in the architecture as well as with the applications and the websites they power and the databases from which they draw real time information essential for the functioning so when Alice searches for her TV show The search microservice communicates with the content catlock service in API about what is exactly Alice searching for and then these microservice compare the typed words with the metadata they already have stored in the database then the most trending microservice captures the most popular data among all the users of Med and stores it in the database once the team of developers captured the most type words by Alice the analytics team update the code and recommendations micros service and compare Alice most viewed content and the preferences to the popular content among other users in the same geographical region this means that the next time Alice logs on to the application she not only sees the most popular content but also finds a personalized playlist which contains the shows she has previously viewed this is similar to how Netflix and Amazon work isn't it so in this way Alice request is fulfilled by the development team in a quick manner as they did not have to build the complete application again and just had to update the code to deploy this new functionality now coming to the Practical implementation of microservices let's look into how you can create and run spring boot projects on eclipse for microservices for this demo I will be using Java of version 1.8 and spring tool suit which is a spring stter plugin so you can download the spring starter plugin from eclipse Marketplace so this is an example project which demonstrates the use of microservices for a site offering various TV shows this project back end is powered by three microservices the user service TV show service and the user booking service let me show you the project structure of each microservices one by one so let's start with the user service let me just open all the files okay so the user service has an autocreated ch Java file which Imports various classes and annotations we import springboard application so that it can trigger the configurations for enable auto configuration and others okay now Hara has a question on what does it exactly mean by exclude data source autoconfiguration well this means that we want to disable data source autoconfiguration autoconfiguration and others for our application now I've created another package for the controller file and in this file I'm going to import all the data from the Json file in the resources folder let me just open it okay so I've started the file by importing rest controller annotation so that we no longer have to add response body annotation to all the request mapping methods after that I've created a map object users which Maps the keys to the values so our key value will be of string type and the values would be of user type so basically I've created an object of hashmap which is a subass of map so if You observe the Json file you can see that ID name email are mapped onto various values such as John Jane asoke Etc these fields are then defined in the user. Java file under this package coming back to the controller file the post construct method is used so that bean is fully initialized and you can use the dependencies moving forward we have used parameter type reference for type casting basically the purpose of this class is to enable capturing and passing a generic type to capture the generic type and retain it at runtime you need to create a subass the resulting type reference instance can be used to obtain a type instance that carries the captured parameterized type information at runtime after that to read the Json file from the resources folder under the controller package I have first loaded the class using class loader and then read the user. Json file from the resources folder then a new object is created of file type and I've put the name as file after that all the btes are read from this object and stored in a new object named content so basically what are we doing at the end is that we're retrieving the types from the content and storing in the object users now to handle HTTP request I'm going to create the method inside the user controller class which can be called when an HTTP request is made so when I just mention the port number on the Local Host a message should return user service when I pass the request SL users on the port number 8084 the list of users should be returned from the requested method in the controller file now let's suppose I want the information of any one user then I will pass the request SL users with the parameters as username to the port number 8084 okay so there's a question from somia that how do we set the port numbers for various services to set the port numbers you just have to go to the application properties in the resources folder and type spring. application. name is equal to your service name and server. Port is equal to your port number for the user service I've put the name as user hyphen service and port number as 8084 similarly I've done for TV shows where I've chosen the port number as 8082 and for user bookings I've chosen the port number as 8 083 after this I've also created some files to handle the errors and the exceptions similar to the user service the TV shows and the user booking service also have similar project structure but have different functionality the booking service consists of all the information about bookings of users and this service works on port number 8083 coming to the TV show service this houses all the TV shows offered by the site and this application runs on port number 808 too so now that you know the project structure of all the three services let's launch these applications at Spring boot app so for that right click on the project go to run as and choose spring boot app at the end of the console you can see that the user application has started similarly launch the other two applications so right click on this project go to run as and choose spring boot app okay so the TV show service is also started again right click on this project go to run as and choose spring boot app the user booking application has also started now that our three applications have started let's go to the browser and check if they're running or not so open the browser and type Local Host 8084 you can see that a message has returned user service indic that our user service is working now to get the details of all the users pass the request SL users to this port number so let's type slash users so you can see on the screen that the list of users has been returned now let's suppose I want the details of only one user let's say John Smith so pass the name John Smith as a parameter to this request so John uncore Smith this gives us the detail of only one user that is John Smith now if I want to get a list of bookings done by various users type Local Host colon 8083 SL bookings so here you can see that chain has done only one booking John has gone for two bookings and ashoke has gone for four bookings and suppose if you want to see the bookings of ashoke type ashore Kumar so you can see see that ashoke has gone for four shows Modern Family House Sherlock and Vikings to see how the last service runs that is the TV shows let's type Local Host colon 8082 sltv shows this gives us the list of TV shows that the site offers you can see that each TV show is given an ID and has parameters such as title rating and genre so now if you want to know who has booked a TV show pass the ID of TV show and user bookings as a parameter to this port so type Local Host 8082 sltv shows SL let's say we want to know for this particular TV show copy the ID and paste it here and pass the parameter user bookings you can see that Jane has opted for this particular TV show so well that's how you can Implement microservices using eclipse and spring starter plugins so thank you guys for joining in today's session I hope that you've learned something useful with this session on microservices so thank you guys for joining in today's session have a good day
Original Description
( Microservices Architecture Training: https://www.edureka.co/microservices-architecture-training )
This Edureka's video will help you understand what are microservices and their practical implementation using Spring Boot. In this video, you will learn the following:
1. Monolithic Architecture
2. Challenges Of Monolithic Architecture
3. What are Microservices
4. Microservice Architecture Components
5. Hands-On Using Spring Boot
#Microservices #MicroserviceArchitectureTutorial #MicroservicesForBeginners #MicroservicesOnlineTraining #MicroservicesUsingSpringBoot
---------------------------------------------------------------------------------
About Microservices Architecture Training
Edureka’s Microservices Architecture training introduces you to the concept of Microservices that are small, lightweight, process-driven components. So, Microservices are the next important thing in designing scalable, easy-to-maintain applications. This not only makes application development easier but also offers great flexibility and lets you utilize various resources optimally. If you want to build an enterprise-ready implementation of the
Microservices architecture, then this course is the first step for you. In this Microservices Architecture training, we will start by giving you a deep understanding of the core Microservices concepts and principle with insight in how they have evolved. We will walk you through the complete life cycle - from design to development to testing; including cross-layer concepts such as how to secure Microservices.
------------------------------------------------------------------------
What are the Objectives of our Microservices Architecture Training?
After completing, Edureka's Microservice training, you will be able to:
1.Understand and differentiate between various Microservices Architectural styles
2.Apply Microservices Architecture principles
3.Know how to make the appropriate Microservice Architecture decision
4.Develop and test a Micros
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from edureka! · edureka! · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
ChatGPT Not Working - 4 Fixes | How To Fix ChatGPT Not Working | Why Is ChatGPT Not Working |Edureka
edureka!
Advanced Java script Tutorial | JavaScript Training | JavaScript Programming | Edureka Rewind
edureka!
Java script interview question and answers | Java script training | Edureka Rewind
edureka!
OpenAI API Tutorial using Python | How to use OpenAI GPT-3 API - Ada Babbage Curie Davinci | Edureka
edureka!
What is Unsupervised Learning ? | Unsupervised Learning Algorithms| Machine Learning | Edureka
edureka!
Top 10 Applications of Machine Learning in 2023 | Machine Learning Training | Edureka Rewind - 7
edureka!
Machine Learning Engineer Career Path in 2023 | Machine Learning Tutorial | Edureka Rewind - 6
edureka!
10 Must Have Machine Learning Engineer Skills That Will Get You Hired | Edureka Rewind - 7
edureka!
Data Structures in Python | Data Structures and Algorithms in Python | Edureka | Python Live - 5
edureka!
Python Lists | List in Python | Python Training | Edureka Rewind
edureka!
Predictive Analysis Using Python | Learn to Build Predictive Models | Python Training | Edureka
edureka!
Machine Learning Tutorial | Machine Learning Algorithm | Machine Learning Engineer Program | Edureka
edureka!
How to use Pandas in Python | Python Pandas Tutorial | Python Tutorial | Edureka Rewind
edureka!
Parameters in Tableau | Tableau Parameters Examples | Tableau Tutorial | Edureka Rewind
edureka!
Top 10 Reasons to Learn Tableau in 2023 | Tableau Certification | Tableau | Edureka Rewind
edureka!
Tableau Developer Roles & Responsibilities | Become A Tableau Developer | Tableau | Edureka Rewind
edureka!
Deep Learning With Python | Deep Learning Tutorial For Beginners | Edureka Rewind
edureka!
Realtime Object Detection | Object Detection with TensorFlow | Edureka | Deep Learning Rewind - 2
edureka!
Top 20 Tableau Tips and Tricks in 20 Minutes | Tableau Tutorial | Tableau Training | Edureka Rewind
edureka!
Climate Change Prediction using Time Series | Python Projects | Edureka | DS Rewind - 5
edureka!
ReactJS Installation Tutorial | ReactJS Installation On Windows | ReactJS Tutorial | Edureka Rewind
edureka!
Phases in Cybersecurity | Cybersecurity Training | Edureka | Cybersecurity Rewind - 2
edureka!
What Is React | ReactJS Tutorial for Beginners | ReactJS Training | Edureka Rewind
edureka!
Cybersecurity Frameworks Tutorial | Cybersecurity Training | Edureka | Cybersecurity Rewind- 2
edureka!
React vs Angular 4 | Angular 2 vs React | React & Angular | ReactJS Training | Edureka Rewind - 5
edureka!
ReactJS Components Life-Cycle Tutorial | React Tutorial for Beginners | Edureka Rewind
edureka!
Ethical Hacking using Kali Linux | Ethical Hacking Tutorial | Edureka | Cybersecurity Rewind - 3
edureka!
Types Of Artificial Intelligence | Artificial Intelligence Explained | What is AI? | Edureka
edureka!
Top 10 Applications Of Artificial Intelligence in 2023 | Artificial Intelligence| Edureka Rewind
edureka!
The Future of AI | How will Artificial Intelligence Change the World in 2023? | Edureka Rewind
edureka!
What is Artificial Intelligence | Artificial Intelligence Tutorial For Beginners | Edureka Rewind
edureka!
Google Cloud IAM | Identity & Access Management on GCP | Edureka | GCP Rewind - 5
edureka!
Google Cloud AI Platform Tutorial | Google Cloud AI Platform | GCP Training | Edureka Rewind
edureka!
Projects in Google Cloud Platform | GCP Project Structure | GCP Training | Edureka Rewind
edureka!
How to Become a Data Scientist | Data Scientist Skills | Data Science Training | Edureka Rewind - 3
edureka!
Agglomerative and Divisive Hierarchical Clustering Explained | Data Science Training | Edureka Live
edureka!
Climate Change Prediction using Time Series | Python Projects | Edureka | DS Rewind - 5
edureka!
Data Science Project - Covid-19 Data Analysis | Python Training | Edureka | DS Rewind - 6
edureka!
What is Honeycode? | Introduction to Honeycode | Edureka
edureka!
Difference between Amazon AWS and Google Cloud | GCP Training Google Cloud | Edureka Live
edureka!
DevOps Lifecycle | Introduction To DevOps | DevOps Tools | What is DevOps? | Edureka Rewind
edureka!
Introduction to DevOps | DevOps Tutorial for Beginners | DevOps Tools | DevOps | Edureka Rewind
edureka!
How to Create Login System using Python | Python Programming Tutorial | Edureka Rewind
edureka!
Python Developer | How to become Python Developer | Python Tutorial | Edureka Rewind
edureka!
How to become a Data Engineer | Complete Roadmap to become a Data Engineer| Data Engineer | Edureka
edureka!
Azure Data Engineer Certification [DP 203] | How to Become Azure Data Engineer [2023] | Edureka
edureka!
Data Analyst vs Data Engineer vs Data Scientist | Data Analytics Masters Program | Edureka Rewind
edureka!
DevOps Engineer day-to-day Activities | DevOps Engineer Responsibilities | Edureka Rewind
edureka!
How to Become a DevOps Engineer? | DevOps Engineer Roadmap | Edureka | DevOps Rewind
edureka!
How to Become a Data Engineer? | Data Engineering Training | Edureka
edureka!
How To Become A Big Data Engineer? | Big Data Engineer Roadmap | Edureka Rewind
edureka!
Python Integration for Power BI and Predictive Analytics | Power BI Training | Edureka
edureka!
Power BI KPI Indicators Tutorial | Custom Visuals In Power BI | Power BI Training | Edureka Rewind
edureka!
Apache HBase Tutorial For Beginners | What is Apache HBase? | Big Data Training | Edureka Rewind
edureka!
Big Data Hadoop Tutorial For Beginners | Hadoop Training | Big Data Tutorial | Edureka Rewind
edureka!
Big Data Analytics | Big Data Analytics Use-Cases | Big Data Tutorial | Edureka Rewind
edureka!
What Is Power BI? | Introduction To Microsoft Power BI | Power BI Training | Edureka Rewind
edureka!
Triggers in Salesforce | Salesforce Apex Triggers | Salesforce Tutorial | Edureka Rewind
edureka!
How To Become A Salesforce Developer | Salesforce For Beginners| Salesforce Training Edureka Rewind
edureka!
Java ArrayList Tutorial | Java ArrayList Examples | Java Tutorial | Edureka Rewind
edureka!
Related AI Lessons
⚡
⚡
⚡
⚡
Distributed Transactions in System Design: Why Data Consistency Becomes Hard Once Your Application…
Medium · Programming
Monolith vs Microservices: A Real-World Architectural Autopsy
Dev.to · Erwin Wilson Ceniza2
FOV in FPS Games: The Math Behind Field of View Settings
Dev.to · Alex Carter
How I Structured My Next.js 14 App Router Project — And Why It Scales
Dev.to · Mbanefo Emmanuel Ifechukwu
🎓
Tutor Explanation
DeepCamp AI