AWS Partner Network (APN) Blog

Agile Programmatic Content Management with Contentful and AWS

Contentful-AWS-Partners
Contentful
Connect with Contentful

By Diego Aguilar (Audible), Arjun Ganesh (Contentful), Ulrich Hinze (AWS), Stefan Schneider (AWS).

Contentful’s programmatic content management in conjunction with AWS continuous integration/continuous development (CI/CD) services allow you to update websites with a high agility.

Increasing the rate of content velocity by updating websites and mobile apps in a fast and secure way is pivotal for many businesses. The headless content management system, Contentful, a software as a service (SaaS)solution for AWS customers, is an excellent architecture to achieve this agility.

Customers tend to have two key roles in their digital teams that maintain marketing, eCommerce websites, or mobile apps. They may be content editors – Team members in this role generally create, develop, and manage various types of content. Content can change frequently depending on go-to-market (GTM) motions and campaigns. The may be developers and system administrators – Team members in this role build the components required to visually render the content. This can be user experience (UX) components, frontend design and coding, content modeling, or managing roles. They tend to make more structural updates.

Contentful enables editors to create or update content at a high velocity without depending on engineers on a regular basis. Editors can work independent of the frontend technology or the digital channel used to deliver this content. They can also change content based on A/B testing and experimentation to keep content current and optimal to drive conversions.

The continuous integration/continuous development (CI/CD) services from AWS are a match for the agile content development framework of Contentful. This enables developers and DevOps engineers to update their environment with the same agility in the AWS cloud. This article provides a reference architecture for the left update loop as shown in Figure 1.The two development loops using Contentful

Figure 1 – Improvement cycles

Audible is a Contentful customer that is implementing this reference architecture. Content editors at Audible curate new content often and have regular updates that need to be propagated quickly. They use Contentful to drive their content operations and workflows. This provides governance and control in addition to facilitating reuse of content across multiple digital properties and channels. In some cases, there will be structural changes to the frontend code or components used to reflect significant content changes. This is important to allow for experimentation. For example, updates to the web framework, UX design, order of page components or updates for JavaScript for multiple tools used for tracking the web application users. Contentful’s programmatic API embeds easily into the CI/CD frameworks of modern web applications on AWS.

Automation is the key for fast changes

Contentful users often need to react quickly to seasonal demands like Black Friday or Cyber Monday events. Audible, for example, runs 2 changes peer week on average. Contentful’s customers manage their websites with the help of the Contentful API and define it in the programming language and framework of their choice. The code may need to be compiled, configured, and deployed into the web server infrastructure as shown in figure 2.CI/CD Architecture with Contentful Figure 2 – Contentful CI/CD architecture

The code gets edited through the developer’s favorite integrated development environment (IDE) or in AWS Cloud9. AWS Cloud9 is a browser based integrated IDE that lets you write code and allows you to collaborate in a team.

The code basis is the backbone of the web presence. New versions and new flavors get presented by different code versions. The code needs to be stored in a safe and a reliable way, since it will define what the audience will see. The interaction of the frontend code and the backend content happens through Contentful programming.

AWS CodeCommit is a fully managed source code control services that hosts private GIT repositories. AWS CodeCommit is suited to store the code and simplifies agile CI/CD. AWS CodeCommit is close to the Contentful SaaS APIs hosted on AWS. This means that it gets hosted in the same region. Downloading the code can happen using the least latency through a secure communication. Figure 3 shows how AWS CodeCommit supports versioning, which allows you to create test branches and consolidate versions. GitHub is an alternative to AWS CodeCommit being used by many partners.

Using CodeCommit to obtain agile changes for frontend architecture

Figure 3 – CI/CD workflow

A developer will implement the required changes for the runtime environment of the web presence. Once this is done, the developer will commit the changes to AWS CodeCommit. Figure 3 shows how any changes in AWS CodeCommit will trigger an action in AWS CodePipeline. AWS CodePipeline is a CI/CD service which automates and monitors complex build and deployment processes. It supports managing staging and test deployments and provides notifications to operators in case of unforeseen events. Figure 4 is showing how AWS CodePipeline will trigger a build operation in AWS CodeBuild.

Using AWS CodeBuild to generate front end deployments in an agile fashion

Figure 4 – Code building pipeline

AWS CodeBuild will manage the scripts to embed your application into a container. AWS CodeBuild will write the generated artifacts to Amazon Simple Storage Service (Amazon S3). AWS CodeBuild scripts may then upload the final image into the container repository Amazon Elastic Container Registry (Amazon ECR) where they are automatically scanned for vulnerabilities before being available for testing.

The final tool to implement a CI/CD pipeline is AWS CodeDeploy. It manages the deployment of production or test systems.

Contentful on AWS customers may want to pick Amazon Elastic Compute Cloud (Amazon EC2 instances), AWS Lambda functions containers in Amazon Elastic Container Service(ECS) for the runtime environment. We have chosen Amazon ECS containers for this reference architecture. Features of Amazon ECS containers include the support for long-running, complex applications with the simplicity in building scaling and highly available applications.

AWS Cloud9, AWS CodeCommit, AWS CodePipeline and AWS CodeBuild provide the continuous development part of CI/CD. For a Contentful developer, the process helps provide a highly available build infrastructure by default and scalability for teams. Any number of parallel builds can be handled on demand, in parallel. The code is well integrated with the Contentful application. Changes can be deployed with minimal latencies.

A scalable and highly available run time environment

Customers will want to test their runtime in staging environments. AWS CodeDeploy and AWS CodePipeline can be used to create test environments.

For reduced latencies and government legal requirement, some large customers may want their content management system close to them. Amazon S3 can automatically replicate assets into a remote region to meet these requirements.

The name resolver Amazon Route 53 supports this global concept by geographical affinity routing. Amazon Route 53 works as well with the regional load balancers to provide the best experience to the customers.

Regional load balancers work jointly with AWS Application Auto Scaling to deploy new containers when required in the Amazon ECS. Amazon ECS will use AWS Fargate service to run as many containers as required in multiple Availability Zones. AWS availability zones within a region are insulated from failures in other Availability Zones. Auto-scaling with Amazon ECS warrants scalability and reliability. It is a good security practice to add an AWS WAF, a web application firewall, which checks against web exploits, to protect your load balancers.

Audible’s content management system

Audible is using this reference architecture except for AWS CodeBuild. The CI/CD tool pipeline is very similar. It allows Audible to obtain quick turnaround times for their code changes. Audible is redeploying their web infrastructure in average twice a week. Audible standardized their infrastructure as code with Terraform; other AWS customers do this with AWS CloudFormation.

The reference architecture in Figure 2 works for installations of all sizes. Audible’s system is a large implementation which uses Amazon ElastiCache for Redis and Amazon Route53 private hosted zones. Amazon ElastiCache for Redis, which helps Audible to cache read queries from Contentful and Amazon Route53 private hosted zones to shield their internal directory structures from the public Internet.

Conclusion

This reference architecture allows AWS customers to use Contentful as an agile content management system, which allows for quick changes as fast as they are needed. The API driven content management from Contentful allows a deep integration with the CI/CD tools from AWS. Contentful editors can react quickly to change requests from their marketeers and content managers.

A case study was performed on the solution with Audible, a Contentful customer, as detailed in the article, Audible sparks listener imagination with Contentful case study!

.


Contentful – AWS Partner Spotlight

Contentful is an AWS Advanced Technology Partner and AWS Competency Partner that provides a headless content management system

Contact Contentful | Partner Overview | AWS Marketplace