Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Carlos Perez Sanchez, Pablo Solar Vilarino

Rating No ratings yet

Transit from monolithic architectures to highly available, scalable, and fault-tolerant microservices Key Features Build your own applications based on event-driven microservices and set them up on a production server. Successfully transform any monolithic application into a microservice. Monitor the health of your application, prevent downtime, and reduce costs. Book Description The world is moving away from bulky, unreliable, and high-maintenance PHP applications, to small, easy-to-maintain and highly available microservices and the pressing need is for PHP developers to understand the criticalities in building effective microservices that scale at large. This book will be a reliable resource, and one that will help you to develop your skills and teach you techniques for building reliable microservices in PHP. The book begins with an introduction to the world of microservices, and quickly shows you how to set up a development environment and build a basic platform using Docker and Vagrant. You will then get into the different design aspects to be considered while building microservices in your favorite framework and you will explore topics such as testing, securing, and deploying microservices. You will also understand how to migrate a monolithic application to the microservice architecture while keeping scalability and best practices in mind. Furthermore you will get into a few important DevOps techniques that will help you progress on to more complex domains such as native cloud development, as well as some interesting design patterns. By the end of this book you will be able to develop applications based on microservices in an organized and efficient way. You will also gain the knowledge to transform any monolithic applications into microservices. What you will learn Set up a development environment using the right strategies and tools. Learn about application design and structure to start implementing your application. Transform a monolithic application into m

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A practical field guide for experienced PHP developers who need to move a real application out of a monolithic codebase and into a containerized, event-driven microservice architecture. It is best suited to readers who already know PHP well and want an end-to-end path from local development through deployment, security, and cloud operations. 【Book Arc】 - **Opening (~0%–10%)**: Defines what a microservice actually is — an isolated, independently deployable entity that communicates over a network — and frames the core trade-off: network latency and operational complexity replace the simplicity of a single codebase. - **Early (~10%–35%)**: Builds the working environment and base platform. Covers Docker and Vagrant setup across operating systems, Git workflow basics, and the NGINX + PHP-FPM core, then introduces service registration, telemetry, and reverse proxies (Fabio/NGINX) with ContainerPilot and Consul. - **Middle (~35%–55%)**: Moves into application design and quality. Discusses shared database versus database-per-service, caching strategies (Redis, HTTP headers), domain-driven design and bounded contexts, CI/CD pipelines (Jenkins, Bamboo, Travis), and test-driven development as a fit for microservice-sized projects. - **Late (~55%–85%)**: Covers the operational concerns of a production system — security (JWT, ACL, environment variables, common web vulnerabilities), deployment, and the concrete migration of a monolithic application into microservices. - **Ending (~85%–100%)**: Closes with scalability strategies, best practices and conventions, and the cloud/DevOps landscape, including cloud providers and the DevOps techniques needed for more complex domains. 【Key Takeaways】 - **A microservice is an isolated entity with a concrete proposal** (Opening): it works with other services through an agreed channel, much like an encapsulated object running on a separate machine. This definition matters because it sets the boundary for everything that follows. - **Network latency is the hidden enemy** (Opening): communication happens through API calls over the network, and response times vary with load and machine state. Design decisions must account for this rather than assuming local function-call speed. - **The base platform is NGINX + PHP-FPM, orchestrated with Docker** (Early): PHP-FPM offers a small memory footprint and high performance under load, while NGINX serves as a light web server and reverse proxy. ContainerPilot registers services in Consul, sends telemetry, and performs health checks, forming a kind of auto-healing system. - **Database choice is a genuine architectural fork** (Middle): database-per-service keeps persistent data private and accessible only via its API, enabling loose coupling and letting different services use different storage engines (relational for users, NoSQL for location). A shared database remains an option, and the book covers both. - **Caching can live inside a service or between services** (Middle): Redis is used to store rarely changing data such as secrets, while HTTP headers (Expires, Last-Modified, Etag, Cache-Control) handle browser-side caching outside the application's control. - **DDD bounded contexts give microservices their logical boundaries** (Middle): following Evans and Plöd, each microservice or team owns one bounded context, and a context map documents the contracts between them — especially useful when migrating from a monolith. - **TDD is not just unit tests** (Middle): it encompasses analysis, design, development, and testing, and it maps naturally onto microservices because each functionality is already broken into small, independently testable pieces. - **Security and deployment are first-class chapters, not afterthoughts** (Late): JWT, ACL, environment variables, file permissions, and defenses against SQL injection, XSS, and session hijacking are treated alongside deployment and migration planning. 【Reading Tips】 - **Deep-read the environment and base-platform chapters** (Early): the Docker, Vagrant, NGINX/PHP-FPM, and ContainerPilot setup is the foundation every later chapter assumes. Skim the OS-specific installation steps if you already run Docker. - **Treat the design chapters as decision frameworks, not recipes** (Middle): the shared-database versus database-per-service discussion explicitly says there is no rule of thumb, so read for the trade-offs rather than a single answer. - **Use the migration chapter as a checklist** (Late): it walks through extracting a domain (for example, taxi tracking) from a monolith, including the database extraction and code changes required. - **Skim the CI/CD tool comparisons** (Middle): Jenkins, Bamboo, Travis, and PHP CI are surveyed, but the sample project settles on Jenkins, so focus there if you want the hands-on path. - **Keep the security chapter nearby during implementation** (Late): its best-practices list is short and concrete enough to use as a review checklist before deployment. 【Coverage Limits】 The excerpts cover the book's structure, environment setup, design trade-offs, and several operational topics in reasonable detail, but they do not include the full text of the security, deployment, migration, scalability, or cloud/DevOps chapters. Specific code examples beyond the NGINX telemetry script and HTTP request handling are not available in the source material.
Excerpt 1
ns based on microservices in an organized and efficient way. You will also gain the knowledge to transform any monolithic applications into microservices. Wh...
View in text
Excerpt 2
er for Windows requires at least a Pro/Enterprise/Education version and the majority of computers are sold with a different version, we will explain how to i...
View in text
Excerpt 3
p s ://l u m e n . l a r a v e l . c o m /. Zend Expressive Lumen is the equivalent of Laravel and Zend Expressive is for Zend Framework. It is a microframew...
View in text
Excerpt 4
ou will have access to the Jenkins UI. Continuous delivery Continuous delivery is the continuation of the continuous integration and the main goal is to be a...
View in text
Excerpt 5
o check the output generated by getRandomCode. assertJson() Working with microservices, you will probably be working very closely with JSON requests and resp...
View in text
Excerpt 6
he fractal library creates a data array from our collection Our controller returns our transformed collection as JSON [ 157 ] Microservices Development Async...
View in text
Excerpt 7
with Monolog (PSR-3 interface) integrated; this log library allows you to use different log handlers. In the Lumen framework, you can set up the amount of er...
View in text
Excerpt 8
> 'users', 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => \App\Model\User::class, 'passwords' => [ 'users' => [ 'provider' => 'users', 'tab...
View in text
Tags
AI categories
PhpBackendDevOps
ISBN: 1787125378
Publisher: Packt Publishing
Publish Year: 2017
Language: English
Pages: 382
File Format: PDF
File Size: 10.9 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…