Image of a cloud on a computer with servers in the background
May 11, 2023

Cloud Orchestration: Basics for PHP Applications

AWS

Cloud orchestration may be a “down the road” initiative for PHP teams just starting their cloud journey. However, cloud orchestration for PHP applications isn’t the complex initiative it used to be. In fact, it’s one that most teams should bake into their first deployments to the cloud.

In this blog, I walk through some cloud orchestration basics, including core definitions, the benefits of cloud orchestration, commonly used technologies, and how teams can lean on ready-to-go cloud images, orchestration templates, and products from Zend to realize the benefits of cloud orchestration for their PHP apps.

Back to top

What Is Orchestration?

Simply put, orchestration is the process of describing the various resources that make up a computing system.

Generally speaking, orchestration systems:

  • Describe complete systems. This means that everything required for the system to run is present. As an example, for a PHP application that uses Redis for session clustering, MariaDB for data persistence, RabbitMQ for handling asynchronous message processing, PHP nodes to process RabbitMQ messages, PHP nodes to handle HTTP traffic, and a load balancer to route traffic, orchestration would define and coordinate all of these services.
  • Favor automation. Everything described during orchestration should be repeatable and result in the same state when complete.
  • Can be versioned. This can be done either in the descriptions themselves (providing a version identifier), and/or using a version control system. As such, orchestration tends to favor configuration, and push any binaries or scripts needed to automate the system into the resources they describe. If a bug is uncovered after deploying, DevOps should be able to roll back to the previous version.

Do PHP Applications Need Orchestration?

Well, if the example detailing that orchestration describes complete systems looks familiar to you, even if you don't use every portion of it, then the answer is yes! In fact, the following basic scenario is not uncommon:

  • A load balancer, handling SSL negotiation, and reverse proxying to:
    • Two or more PHP nodes.

Orchestration can help simplify deployment and management of a basic example like that, all the way up to applications with dozens or hundreds of microservices all coordinating with each other. How you handle that orchestration, however, will depend on where you plan to deploy and how.

Back to top

What Is Cloud Orchestration?

Cloud orchestration automates the management of workloads on private and public clouds, streamlining connections and operations to be scalable, repeatable, and cost-effective. 

Cloud orchestration is frequently achieved via the use of cloud orchestration tools, like Puppet, Chef, Ansible, and Terraform. 

Over the past fifteen years, we, as PHP developers, have become fairly familiar with enterprise cloud providers, from the venerable Amazon Web Services (AWS), to Microsoft Azure, Google Cloud Platform, and more.

Most of these offer "compute cloud" or "cloud machine" services, which allow launching virtual machine images on their service. Over time, each has provided a marketplace to allow vendors to create ready-to-use machine images that customers can launch and customize to run their own applications.

On AWS, this is the Elastic Compute Cloud (EC2); on Azure, it's their Virtual Machines product; Google has its Compute Engine.

As these evolved, DevOps developed tools like Chef, Puppet, and Ansible to manage their computational clusters. These tools are primarily interested in how to provision an individual machine, but can be coerced into managing clusters.

A newcomer has since become a standard for cloud orchestration in the DevOps ecosystem: Terraform. From its own documentation, "Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently." It is provider agnostic, and has plugins available for provisioning systems like Chef, Puppet, and Ansible; as such, you can continue using what you know, but use Terraform to coordinate between all the resources.

What Is the Difference Between Cloud Orchestration and Cloud Automation?

The difference between cloud automation and cloud orchestration can be easy to miss, however both describe unique concepts within cloud computing. 

Cloud automation refers to the process of automating tasks and workflows, whereas cloud orchestration refers to a broader concept that includes both automation, but also the coordination of workflows across cloud resources. In other words, cloud orchestration typically includes management of cloud automation tasks. 

Back to top

Cloud Orchestration and Containers: A Match Made in Heaven 

When virtual machines were first commoditized, they were an answer to both production and development needs, as developers could literally develop in the same environment as production. Over time, however, many of us noted that (a) they consumed a LOT of disk storage, particularly if you were using a bunch of them, and (b) the bigger the image, the slower to start.

Linux containers have been around for a long time, but were an arcane solution that was difficult to understand and utilize. In the past five to ten years, Docker arose to make them easier to understand, and, more importantly, build and consume. Docker images, particularly once cached locally, are lightning fast to start, and, because they often can share layers (snapshots of state), tend to use less storage as well. Since they are idempotent in nature, the goal is one service per image, which means you generally need to orchestrate many containers to create a full application or system.

Docker has many different orchestration systems:

  • Compose, which runs on a single physical machine.
  • Stack/Swarm, which orchestrates across multiple machines, but generally requires manual intervention to start and stop the system.
  • Kubernetes (k8s), which can describe entire systems, and include features such as monitoring, logging, and autoscaling.
  • Helm, which is an abstraction layer over k8s.

The beauty of Docker is in its orchestration capabilities, and it is a fantastic platform both for development (as it provides the same environment as production) and large production applications. The various orchestration tools provide the tools you need to describe, automate, and version your applications.

Back to top

Cloud Orchestration Benefits for PHP Applications

As more and more PHP applications get deployed, either partially or fully, to the cloud, PHP teams around the world are looking for ways to increase efficiency of their deployments. While cloud deployment brings a number of benefits to PHP teams, cost can quickly become an obstacle. That’s why many companies look to PHP orchestration to improve the scalability and performance of their PHP applications – and, consequently, lower their cloud costs.

There are other benefits, as we describe below, but ultimately these boil down to the same benefit: improving efficiency to reduce costs.

1. Enhanced Operational Efficiency

By automating manual or otherwise repetitive tasks like configuration management, provisioning, and other operations processes, IT teams can instead turn their focus to more important priorities. And, by automating these tasks, teams can make those results faster and reduce the potential for human error.

2. Flexibility and Scalability

Deploying to the cloud makes provisioning resources based on need a necessity. With cloud orchestration, teams can scale their resources up or down based on demand for their applications, or even specific services within their applications. This dynamic approach allows teams to enjoy the benefits of cloud deployment, without the exorbitant costs.

3. Better, Faster, and More Resilient Applications

Automating deployment and configuration of cloud resources allows for better user experiences. Because services and applications are automatically scaled up and down to fit need, services and applications perform better, are available to users faster, and are more resistant to outages and downtime. 

Back to top

How to Make Your PHP Cloud Orchestration Project a Success 

For PHP teams, employing cloud orchestration to its full benefit can be a challenge – especially when you consider you may have to become an expert in a handful of open source technologies along the way.

The good news is that there are PHP-specific templates, containers, cloud images, and even products available that can make cloud orchestration a faster, and less painful experience – and they’re all available from the PHP experts at Zend.

Zend offers several ways to expedite your cloud orchestration journey, including:

Try ZendPHP for Free

Even better? You can try ZendPHP and ZendHQ free for 30 days. See trial details via the link below. 

Start TRIAL

 

Additional Resources

Editor's Note: This blog was originally published in 2021 and has been updated to reflect the reality of cloud orchestration in 2023.

Back to top