 during this time. The next next next next next next next next next next next next next сервиси можуть бути зроблені і додавлені вдовжнені з іншого. Усі сервиси нормальній мають дитабайси, щоб бути зроблені з інші сервиси. Давайте взагалі взагалі дивимося на цю фігю. Ми маємо два кліонів. У смартфоні, у мобілу епі та у браузері. У браузері додає фронтинт виплікацій, що знає в браузері, який треба надати і наволює їх нав formats. У мобілу епі та виплікацій, виплікацій виплікацій. М salvation of the gateway між країним. В exact. Якщо ви мstarterаєш кілька сервисів з іншого, він просто чає в Morro. У мобілу епі та виплікацій. В цей час, ви цілько відповідаєш, We have 3 services and each of them has a sound database. Sometimes these services will have to collaborate. And this figure leaves the open question of how we will do it. Let's investigate a couple of examples. And we start from a simple one. We have an application that requests quotes from the service and prints them out. We start from the frontend application that is written in JavaScript. It takes the API Gateway variable that contains the API Gateway address, constructs the URL, and invokes the random quote endpoint. The result is written in a quote block. Now let's go to the API Gateway. API Gateway is also written in JavaScript. It is Node.js. The JavaScript dedicated for server-side execution. It takes the quotes API environment variable and constructs the URL that leads to the real endpoint of a quote service. We can see that the invoked API endpoint is also a bit different. Just quote. So the API Gateway invokes the endpoint and returns the received results plus the current time. Now we go to quote service. As we can see, it's written in Python. I guess it is for demonstration that the software can be created using different technologies. The service could have been easily written using the same Node.js. Here is the implementation of our endpoint. It selects the random quote and returns the quote and author in JSON format. I find the solution easy to understand, but the real-life examples are not that simple. Let's see another example. We will not investigate the quote itself as it requires the knowledge of various frameworks such as Java Spring Framework, Angular Framework, RabbitMQ, and many others. Just take a look at the architecture. So we have the front-end application that is written using the Angular framework. The application uses the API Gateway to invoke the services. The API Gateway uses the Discovery Service to find out where the required services reside. Take a note that the services must register themselves to the service registration and discovery cluster. Also, you can see that the service registration and discovery cluster checks the health of the services, probably using the health endpoint monitoring pattern. It promotes resiliency. Now the API Gateway invokes the requested service. As we can see, there are two microservices that collaborate. For that purpose, we use Message Broker Pattern and the RabbitMQ Middleware that I presented in previous lectures. All the communication that is necessary to request a service is presented in this sequence diagram. The application calls the API Gateway that asks for location of the service from the service registration and discovery service. Later, API Gateway invokes the actual microservice and returns the result. Is it complicated? I guess a bit. But I find it cool how different technologies and frameworks can work together providing scalability, resiliency, and many other things. So the microservices inherit all the benefits of service-oriented architecture. It enables the continuous delivery and deployment of large complex applications and it improves fault isolation. It is because the small parts of the application, the microservices can be easily added, changed, or removed. Also, the microservice approach eliminates any long-term commitment to a technology stack. Let's summarize the web architectures we talk about using this figure that shows the evolution of the web architectures. Until the last century, the monolithic, coupled web applications dominated. You may imagine such the application as a webshop application constructed on a WordPress platform. Almost anything was contained in a single application and usually it was running on a single server. From the year 2000 or so, service-oriented architectures started to gain popularity. These applications were loosely coupled and could enjoy a lot of benefits we talk about. Still, some monolithic parts remained and we couldn't enjoy scalability, resiliency, independent development, and other things at full scale. From the year 2010, the microservices emerged to provide all benefits I mentioned in the last sentence. You may ask, why don't we create web applications based only on microservices? As we already have seen, microservice architecture may be quite complex for both creation and management. There are a lot of simple projects where a monolithic solution would do just fine. Let's summarize this large topic. Service-oriented architecture is an architecture that structures the application of a set of loosely-coupled, collaborating services. Microservices is a special case of service-oriented architecture, where the services are almost completely de-coupled and autonomous. Service-oriented architecture and microservices provide a lot of benefits. Scalability, resiliency, independent development is among the most important. Of course there are shortcomings. This architecture is not appropriate for real-time applications. It is not a good idea to try to make a shooter-multiplayer game using this architecture, because HTTP requests are expensive. Also, service-oriented architecture and microservice architecture implementations might be quite complex. That was just a short introduction to the world of web architectures. Hope you enjoyed it. Thank you for watching.