The course is part of this learning path
In this course, we will learn the concepts of microservice and Spring framework.
Learning Objectives
In this course, you will gain an understanding of the following concepts, with regards to microservices:
- Performance
- Failure
- Integrity
- Service Version Management
- Common Code for Microservices
Intended Audience
- Beginner Java developers
- Java developers interested in learning how to Build and Deploy RESTful Web Services
- Java Developers who want to develop web applications using the Spring framework
- Java Developers who want to develop web applications with microservices
- Java Developers who wish to develop Spring Boot Microservices with Spring Cloud
Prerequisites
- Basic Java knowledge
Performance. Hello my friends. In this lesson, we will talk about performance tips for microservices. It includes some recommendations. The first suggestion is to use asynchronous requests. In an application, you might frequently need to interact with many microservices to compose a response. For example, you might need to fetch an online trade platform user's preferences, as well as her discount coupons details. Generally, these pieces of information are not dependent on one another and you could fetch them in parallel.
Asynchronous patterns can help you improve performance in this situation. Another suggestion is to use batch APIs. When you supply a service to return product info by product ID, you can return multiple product details by accepting multiple product IDs at once. As you see in the example shown here, multiple product IDs are given and multiple details are returned. Another piece of advice is to make your security enforcement compact and less complicated.
It's bad for performance to use security mechanisms that include lots of back and forth communication to authenticate the calling API. For example, if your microservice needs to validate a ticket from your application by calling back to the application, you've exposed a number of round trips to get your data. When you use auth implementation for authorization, you can use the caching option. It helps you reduce the load. The last piece of advice I want to give is to trace services and find out which parts cause the most latency and take action according to the trace result. All right, so let's take a short break here my friends and I'll see you in the next lesson.
OAK Academy is made up of tech experts who have been in the sector for years and years and are deeply rooted in the tech world. They specialize in critical areas like cybersecurity, coding, IT, game development, app monetization, and mobile development.