Home » Blog

New tutorial: High Availability in WordPress (Part II)

 |  Post a comment

We’re continuing to update our tutorials to ensure you have the latest tricks and “how to’s” for AWS services. Now it’s the turn of high availability in WordPress. In the previous version of this tutorial, we looked at the different AWS methods and services for achieving high availability. Here in this updated version, we’ll focus on a specific solution: using GlusterFS to unify instance content.

In this part we’ll explain how to move take WordPress one step further. From a single EC2 and RDS instance we’ll move to a High Availability (HA) platform. Up until now we had the following infrastructure: infraestructure » Read more: New tutorial: High Availability in WordPress (Part II)

New tutorial: Highly Available WordPress (Part I)

 |  Comments (2)

Unfortunately, things fail from time to time, including our applications’ servers. A connectivity problem at the datacenter, a natural disaster or a hardware issue can render our blog offline. Since we cannot predict the future nor prevent failures from happening, we are leveraging the power of the cloud in order to save ourselves from them and keep our services working despite them: we’re designing our infrastructure with failure in mind so nothing fails.

Key concepts

It’s important that our platform isn’t dependant on any specific component in order to work or else service will be interrupted should that component fail. We have to identify our platform’s components and isolate them as much as possible: if our front web servers depend on some specific database server, then everything in our application depends on it and it becomes a dreadful single point of failure. On the other hand, if we design in a way in which we don’t depend on specific machines, we can have more than one of them serving each of our application’s layers and we won’t see any issues as a result of a single machine failing.

ha
» Read more: New tutorial: Highly Available WordPress (Part I)

Cloud Architecture 101: Scalability DON’TS

 |  Post a comment

We hear a lot of talk about the scalability, resilience and fault tolerance of cloud platforms, but it’s all hearsay if the overlying applications are not designed with failure in mind.

An example of scalability in AWS

This post lists the common errors made (the big DON’TS) when planning a fault-tolerant, scalable application and offers some simple tips on how to avoid them.

» Read more: Cloud Architecture 101: Scalability DON’TS

Tutorial Update: Creating a CDN for WordPress with CloudFront and S3

 |  Post a comment

We already improved our WordPress performance and content loading speed using Elasticache in a previous tutorial. Now we’re going one step forward by locating those contents closer to our users in order to enhance response time even more by creating a Content Delivery Network using Amazon’s S3 and CloudFront services.

A Content Delivery Network is a fleet of servers distributed around the world which contain copies of our content. This way users visiting our site receive a response from the server closest to their location, decreasing data travel distance and intermediaries, resulting in faster access to the content. In order to enable our WordPress to take advantage of this, we’ll be making the following changes:

  • We’ll store our site’s images outside the web server that’s hosting WordPress, offloading any work related to image serving from our EC2 instances and allowing browsers to download them at the same time they download the text content. To do so, we’ll create an Amazon S3 bucket.
  • We’ll configure a CloudFront distribution that will cache our images from S3 to the edge locations Amazon has set up for us (see global infrastructure).
  • We’ll install a WordPress plugin that will handle the uploading of our pictures to S3 giving us a CloudFront link to them.

On the left, an American user is accessing our blog directly. On the right, the same user accesses it through CloudFront
On the left, an American user is accessing our blog directly. On the right, the same user accesses it through CloudFront

» Read more: Tutorial Update: Creating a CDN for WordPress with CloudFront and S3

Tutorial: Using CORS with CloudFront and S3

 |  Post a comment

CORS, or Cross-Origin Resource Sharing, is a mechanism that allows a browser to show the resources of a domain that are referenced from a different domain. This applies, for example, to Javascript scripts linked to an external service or, as we’ll explain, to resources that belong to our application but that are served from a different domain, such as a Content Distribution Network (CDN).

For security reasons and adhering to the same origin policy, browsers can block these kinds of external references if they are requested client-side (for example, from Javascript) and refuse to execute Javascript or embed images from other domains. Thanks to CORS, we can inform the browser that the interaction between domains is both intentional and safe.

graficocors

Requests and HTTP headers

CORS implementation is based on the use of requests and HTTP headers. Typically, the client launches an OPTIONS request to determine the CORS capacity of the secondary domain and from that point on, it will include the Origin header, indicating the main domain, to the GET, PUT and POST requests.

» Read more: Tutorial: Using CORS with CloudFront and S3