{"id":12969,"date":"2022-06-24T07:33:41","date_gmt":"2022-06-24T07:33:41","guid":{"rendered":"https:\/\/blog.cloudthat.com\/?p=12969"},"modified":"2024-06-25T10:58:01","modified_gmt":"2024-06-25T10:58:01","slug":"best-architectural-approaches-to-deploy-wordpress-application-on-azure-cloud","status":"publish","type":"blog","link":"https:\/\/www.cloudthat.com\/resources\/blog\/best-3-architectural-approaches-to-deploy-wordpress-application-on-azure-cloud","title":{"rendered":"Best 3 Architectural Approaches to Deploy WordPress Application on Azure Cloud"},"content":{"rendered":"<table style=\"height: 193px;\" border=\"0\" width=\"454\">\n<tbody>\n<tr>\n<td>\n<h2><span style=\"color: #000080;\"><strong>TABLE OF CONTENT<\/strong><\/span><\/h2>\n<\/td>\n<\/tr>\n<tr>\n<td><a href=\"#overview\">1. Overview<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#wordpressonaks\">2. WordPress on Azure Kubernetes Service<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#azuredatabase\">3. WordPress on AKS with Azure Database for MySQL<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#webappcontainers\">4. WordPress on Webapp for containers<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#finalverdict\">5. Final Verdict<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#aboutcloudthat\">6. About CloudThat<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2 id=\"overview\"><strong>Overview:<\/strong><\/h2>\n<p><span style=\"color: #000000;\">Emerging Cloud Computing technologies are majorly developing advanced applications with modern technologies. Microsoft Azure is at the forefront and provides various cloud services like Azure VM, Azure Storage (blob, fileshare), Azure Function App, Azure Data Factory, and many more.<\/span><\/p>\n<p><span style=\"color: #000000;\">One of the challenging things for a cloud architect is to make architecture decisions that are optimized, cost-effective and resilient. The goal is to make you aware of the parameters to consider while choosing the right decisions based on different approaches. We will discuss various options by looking at real-life examples of deploying a WordPress application on the Azure cloud, which will be highly available and scalable.<\/span><\/p>\n<h2 id=\"wordpressonaks\"><strong>Approach 1: Highly Available and Scalable WordPress on Azure Kubernetes Service<\/strong><\/h2>\n<h3>Services to use:<\/h3>\n<p><span style=\"color: #000000;\">Azure Kubernetes Service, a.k.a. AKS<\/span><\/p>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/arch1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13046\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/arch1.png\" alt=\"Architecture diagram\" width=\"626\" height=\"321\" \/><\/a><\/p>\n<h3>Azure Kubernetes Service AKS:<\/h3>\n<p><span style=\"color: #000000;\">AKS is managed Kubernetes service provided by Azure, where they manage the master node for Kubernetes by themselves, which offers benefits such as auto upgrades, self-healing, and patching. This reduces the time-sink for the developers to handle debugging. Other than that more like optimizing resource utilization and scaling massively at speed with ease.<\/span><\/p>\n<p><span style=\"color: #000000;\">Let us talk about details on Kubernetes, which we can use to deploy our WordPress application.<\/span><\/p>\n<h3>Deployments<\/h3>\n<p>A<span style=\"color: #000000;\"> Deployment provides details that can update Pods and Replicasets declaratively. You describe the desired state and create a new replica set that removes all the existing configured resources and adopts a new one.<\/span><\/p>\n<h3>ReplicaSet<\/h3>\n<p><span style=\"color: #000000;\">Replicaset is used to maintain a stable set of Pods running at any time and assure the availability of the desired number of identical Pods.<\/span><\/p>\n<h3>Service<\/h3>\n<p><span style=\"color: #000000;\">A Service is a way to expose your pods to network service. It resolves the problem of modifying the mechanism for service discovery by giving their IP addresses and DNS name for the set of Pods with load balancing capability.<\/span><\/p>\n<h3>Ingress<\/h3>\n<p><span style=\"color: #000000;\">An API object that helps you to manage access from the external world to services in the cluster such as HTTP, where it also provides features such as SSL termination, Path-based routing, and load balancing.<\/span><\/p>\n<p><span style=\"color: #000000;\">In simple terms: It will help the service to expose via HTTP and HTTPS to the external world with rules that can be controlled for routing.<\/span><\/p>\n<h3>Persistent Volumes<\/h3>\n<p><span style=\"color: #000000;\">A Persistent Volume (PV) is a chunk of storage in a cluster that can be provisioned using storage classes such as node and pod as cluster resources. They are plugins like Volume with lifecycle, which pods use independently using PV. It can be implemented by capturing the configuration of NFS, iSCSI, or a cloud-provider-specific storage system<\/span><\/p>\n<p><span style=\"color: #000000;\">A Persistent Volume Claim (PVC) is the request of storage by pod, just like Pod use node resources while PVCs use PV resources. Where Pods can have specific CPU and memory and claims can have the exact size and access modes such as ReadWriteOnce, ReadOnlyMany or ReadWriteMany.<\/span><\/p>\n<p><span style=\"color: #000000;\">Here is a<a href=\"https:\/\/blog.cloudthat.com\/a-beginners-guide-to-kubernetes-with-real-time-example\/?utm_source=blog-website&amp;utm-medium=text-link&amp;utm_campaign=a-beginners-guide-to-kubernetes-with-real-time-example\/\" target=\"_blank\" rel=\"noopener\"><strong> Beginners Guide to Kubernetes with real-time examples.\u00a0<\/strong><\/a><\/span><\/p>\n<h3>Storage options for applications in Azure Kubernetes Service (AKS)<\/h3>\n<p><span style=\"color: #000000;\">Here we can use Persistent Volume and Persistent Volume Claims to manage our WordPress web data and MySQL data for our storage requirements.<\/span><\/p>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/arch2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13047\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/arch2.png\" alt=\"Architecture diagram\" width=\"484\" height=\"373\" \/><\/a><\/p>\n<p><span style=\"color: #000000;\">With Azure, we can have two options for Storage Classes:<\/span><\/p>\n<h3><strong>Azure Disks<\/strong><\/h3>\n<p><span style=\"color: #000000;\">Can be created as Kubernetes DataDisk\u00a0resource where<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">Azure Premium storage, backed by high-performance SSDs(suitable for production workloads)<\/span><\/li>\n<li><span style=\"color: #000000;\">Azure Standard storage, supported by regular HDDs.<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">T<\/span><span style=\"color: #000000;\">he Limitations are that it can be mounted as ReadWriteOnce only available to a single pod.<\/span><br \/>\n<span style=\"color: #000000;\"> To avoid this limitation in providing access to multiple Pods, one should use Azure FIles<\/span><\/p>\n<h3><strong>Azure Files<\/strong><\/h3>\n<p><span style=\"color: #000000;\">They are mounted as SMB 3.0 shares backed by an Azure Storage account to pods. It lets you share data across multiple nodes and pods and can use:<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">Azure Premium storage, backed by high-performance SSDs, or<\/span><\/li>\n<li><span style=\"color: #000000;\">Azure Standard storage backed by regular HDDs.<\/span><\/li>\n<\/ul>\n<h2 id=\"azuredatabase\"><strong>Approach 2: <\/strong><strong>Highly Available and Scalable WordPress on Azure Kubernetes Service with Azure Database for MySQL<\/strong><\/h2>\n<h3>Services to use:<\/h3>\n<ol>\n<li><span style=\"color: #000000;\">Azure Kubernetes Service, a.k.a. AKS<\/span><\/li>\n<li><span style=\"color: #000000;\">Azure Database for MySQL.<\/span><\/li>\n<\/ol>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/arch3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13048\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/arch3.png\" alt=\"Architecture Diagram\" width=\"626\" height=\"342\" \/><\/a><\/p>\n<p><span style=\"color: #000000;\">Here, we will use the same components for WordPress(pods) mentioned above. However, Instead of MySQL on Pods, we will use Managed service by Azure, that is, Azure Database for MySQL.<\/span><\/p>\n<h3>Azure Database for MySQL<\/h3>\n<p><span style=\"color: #000000;\">It is a fully managed relational database service offered by MS Azure that works on MySQL community edition. In contrast, you can have a single or Flexible server as per your choice, which can handle critical production workloads with optimum performance and dynamic scalability.<\/span><\/p>\n<h2 id=\"webappcontainers\"><b><span style=\"font-size: 16.0pt; line-height: 107%;\">Approach 3: Highly Available WordPress on Webapp for containers with Azure Database for MySQL<\/span><\/b><\/h2>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/arch4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13049\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/arch4.png\" alt=\"Architecture Diagram\" width=\"568\" height=\"540\" \/><\/a><\/p>\n<h3>Web App for Containers<\/h3>\n<p>I<span style=\"color: #000000;\">t is served as PAAS offering on App service looking more towards developers who want more control over not just on code with different runtime framework tooling and packages to opt to be installed on containers. Allows forgetting all the worries of managing and maintaining container orchestration which runs. With such advantages, it also provides building CI\/CD for packaging code and dependencies for containers using various DevOps tools such as Azure DevOps, Jenkins, or Maven, along with webhooks on App service for automated deployments.<\/span><\/p>\n<p><span style=\"color: #000000;\">Here we can also leverage the power of Azure managed database service i.e., Azure Databases for MySQL.<\/span><\/p>\n<p><span style=\"color: #000000;\">Below is an example of simple continuous integration:<\/span><\/p>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/arch5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13050\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/arch5.png\" alt=\"Architecture Diagram\" width=\"660\" height=\"346\" \/><\/a><\/p>\n<h2 id=\"finalverdict\"><strong>Final Verdict<\/strong><\/h2>\n<p><span style=\"color: #000000;\">Here are the judging criteria for all the three approaches discussed above to select the most suitable Architecture:<\/span><\/p>\n<p><a href=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/wordpress1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12970\" src=\"https:\/\/d1f7lmxeo98xps.cloudfront.net\/resources\/wp-content\/uploads\/2022\/11\/wordpress1.png\" alt=\"Architectural Decisions\" width=\"798\" height=\"544\" \/><\/a><\/p>\n<p><span style=\"color: #000000;\">Above all the approaches, I think the best suitable architecture would be the 3rd approach, Azure Webapp on containers with Azure Databases for MySQL. It is because it is easier and simpler to deploy and work with than the other two. It may cost you more. However, the features it provides are worthwhile. On the other hand, it does not need to have any Kubernetes expertise, which could be an advantage.<\/span><\/p>\n<p><span style=\"color: #000000;\">The above three approaches have their own pros and cons. Your decision is based on flexibility, manageability, fault tolerance, and scalability. The 3rd approach, which is Azure Webapp on containers with Azure Databases for MySQL, could be that it is far easier and simpler to deploy and work with than the other two. It may cost you more. In the 2<sup>nd<\/sup> approach, you get the power of the Kubernetes engine and Azure Managed Database which will ide resiliency and the 1<sup>st<\/sup>\u00a0approach is more suitable for Kubernetes experts where they can manage stateful states for MySQL databases while providing elasticity and scalability at convenience.<\/span><\/p>\n<p><span style=\"color: #000000;\">Let me know in the comments which approach you like most and why it is worthy of choice.<\/span><\/p>\n<p><span style=\"color: #000000;\">I may not have mentioned Azure VM in this blog because of the production workload and more focused on containerization technology which helps us use resources optimally. Still, you can select that using Azure VM Scale Sets and Azure Application Gateway for high availability.<\/span><\/p>\n<h3 id=\"aboutcloudthat\"><strong>About CloudThat<\/strong><\/h3>\n<p id=\"About CloudThat\"><span style=\"color: #000000;\"><a href=\"https:\/\/www.cloudthat.com\/\" target=\"_blank\" rel=\"noopener\"><strong>CloudThat<\/strong><\/a>\u00a0is\u00a0the official Microsoft Gold Partner,\u00a0AWS (Amazon Web Services) Advanced Consulting Partner, Google Cloud Partner, and Training Partner helping people develop knowledge of the cloud and help their businesses aim for higher goals using best-in-industry cloud computing practices and expertise. We are on a mission to build\u00a0a robust\u00a0cloud computing ecosystem by disseminating\u00a0knowledge on technological intricacies within the cloud space.\u00a0Our blogs, webinars,\u00a0case studies, and white papers\u00a0enable all the stakeholders in the cloud computing sphere.<\/span><\/p>\n<p><span style=\"color: #000000;\"><a href=\"https:\/\/www.cloudthat.com\/\" target=\"_blank\" rel=\"noopener\"><strong>CloudThat<\/strong>\u00a0<\/a>is a\u00a0<span class=\"TextRun BCX0 SCXP93070984\" lang=\"EN-IN\" xml:lang=\"EN-IN\" data-usefontface=\"true\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXP93070984\">house\u00a0of\u00a0All-Encompassing\u00a0IT\u00a0Services\u00a0on the cloud offering\u00a0<span class=\"TextRun BCX0 SCXP59000031\" lang=\"EN-IN\" xml:lang=\"EN-IN\" data-usefontface=\"true\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXP59000031\">Multi-cloud Security &amp; Compliance, Cloud Enablement Services, Cloud-Native Application Development, and System Integration Services.\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXP59000031\" lang=\"EN-IN\" xml:lang=\"EN-IN\" data-usefontface=\"true\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXP59000031\"><span class=\"EOP SCXP258354852 BCX0\"><span class=\"EOP SCXP66056781 BCX0\"><span class=\"EOP SCXP242272637 BCX0\"><span class=\"TextRun SCXP239778695 BCX0\" lang=\"EN-IN\" xml:lang=\"EN-IN\" data-usefontface=\"true\" data-contrast=\"none\"><span class=\"NormalTextRun SCXP239778695 BCX0\">Explore our\u00a0<strong><a href=\"https:\/\/www.cloudthat.com\/consulting\/\" target=\"_blank\" rel=\"noopener\">consulting here<\/a>.<\/strong><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n","protected":false},"author":219,"featured_media":13018,"parent":0,"comment_status":"open","ping_status":"open","template":"","blog_category":[3608,3607],"user_email":"prarthitm@cloudthat.com","published_by":"324","primary-authors":"","secondary-authors":"","acf":[],"_links":{"self":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/12969"}],"collection":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/users\/219"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/comments?post=12969"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/12969\/revisions"}],"predecessor-version":[{"id":42736,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/12969\/revisions\/42736"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/media?parent=12969"}],"wp:term":[{"taxonomy":"blog_category","embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog_category?post=12969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}