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

  • 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.

主站蜘蛛池模板: 赤城县| 思茅市| 徐水县| 襄垣县| 浪卡子县| 十堰市| 黔南| 汨罗市| 涞源县| 宿松县| 两当县| 绥江县| 黄骅市| 太湖县| 安陆市| 水富县| 甘谷县| 大埔县| 太保市| 大安市| 衡南县| 通城县| 松桃| 大埔区| 安图县| 惠安县| 永新县| 平阳县| 射阳县| 庆元县| 化德县| 遂宁市| 酉阳| 宜兰县| 常宁市| 翼城县| 大名县| 五家渠市| 陇南市| 海丰县| 平谷区|