官术网_书友最值得收藏!

  • PHP Microservices
  • Carlos Pérez Sánchez Pablo Solar Vilari?o
  • 320字
  • 2021-07-09 18:50:04

Design and architecture to build the basic platform for microservices

Creating an application based on microservices is not like a monolithic application. For this reason, we have to pide our functionalities into different services. To do this, it is important to follow an adequate design and structure each of the microservices according to its requirements.

The design takes care of piding the application into logical parts and groups them according to their existing relationship. The architecture takes care of defining which concrete elements support each of the microservices, for example, where the data is stored or the communication between the services.

Throughout the book, we will follow the given structure for each microservice. In the following image, you will see the structure of one of the microservices, the rest of them are similar; however, some parts are optional:

All the requests for our microservices come from a REVERSE PROXY as this allows us to balance the load. Also, we use NGINX as a gateway for the API built in PHP. To reduce the load and increase the performance of PHP and NGINX, we can use a CACHE layer.

In case we need to execute big, resource consuming tasks, or the tasks do not need to be executed in a concrete time window, our API can use a QUEUE system.

In case we need to store some data, our API is responsible for managing the access and saving the data in our DATA STORE.

Note

In this book, we will be using containerization, a new virtualization method which spins ups containers instead of full virtual machines. Each container will have only the minimum resources and software installed to run your application.

We can use Telemetry (it is a system that gets the stats from the container) and autodiscovery (it is a system that helps us to see which containers are working properly) to supervise the container ecosystem.

主站蜘蛛池模板: 夏津县| 韶山市| 安徽省| 天门市| 安福县| 准格尔旗| 宣化县| 留坝县| 元江| 莱州市| 库尔勒市| 泰兴市| 景谷| 辽阳县| 商丘市| 靖边县| 繁峙县| 松阳县| 禹城市| 来宾市| 万源市| 巴中市| 连州市| 宝兴县| 孟州市| 荆州市| 古蔺县| 洛宁县| 永泰县| 肥东县| 萝北县| 左云县| 固安县| 兴和县| 万荣县| 仪陇县| 天长市| 嘉义县| 墨竹工卡县| 若尔盖县| 崇阳县|