HTAP Summit 2024 session replays are now live!Access Session Replays

Unlike commercial sites, government and public organization websites prioritize constant accessibility over peak performance. Facing around-the-clock citizen access demands, Nagoya City’s websites, such as Kokoro’s Bandaid (a mental health consultation portal), Gatekeeper Training (a mental health training portal), and Nagoya Food Education Plaza, needed a solution to guarantee website resilience despite typically not experiencing high traffic spikes.

Figure 1. Kokoro’s Bandaid

AJU Independence House Wadachi Computer House (AJU) is responsible for developing and operating these websites. To seek a reliable solution to ensure citizens could access services and information anytime, AJU adopted TiDB Serverless, a fully managed Database as a Service (DBaaS) solution from PingCAP as the backend database.

How did AJU implement high availability by moving to the cloud? Why did they choose TiDB Serverless over the standard MySQL? We delve into these questions with Makoto Mizutani, the migration project leader, and Lepe Alberto, AJU’s technical consultant.

The Challenge: Building an Unstoppable Website in the Cloud

According to Mr. Mizutani, the websites for Nagoya City needed to be unstoppable with the following requirements:

  • Always available: The websites must be 24/7 operation without downtime 
  • Resilience to failures: The websites must respond to failures with swift recovery capabilities.
  • Strict security requirements: The servers must be deployed within Nagoya City data centers with fire extinguishing systems and access management.
  • Cloud-based: With the widespread adoption of cloud technology, the Ministry of Internal Affairs and Communications started to recommend cloud-based options. Traditional rental web servers for WordPress did not meet this requirement. 

When migrating to the cloud, they initially compared AWS and Google Cloud, ultimately choosing AWS.

The team used Docker Swarm to cluster WordPress on Docker containers across three availability zones to enhance WordPress’s availability. This ensures that even if one WordPress instance fails, the others remain unaffected to maintain overall operation.

However, achieving high availability for WordPress requires the database it connects to also have high availability.

The Solution – From Amazon Aurora MySQL to TiDB Serverless

Initially, Mr. Mizutani and his team chose Amazon Aurora MySQL, a trusted database service from AWS, as their backend database. It offers sufficient performance and stability for many applications. 

However, TiDB Cloud, a MySQL-compatible database service on AWS, caught Mr. Alberto’s eye because of its cost-effectiveness. Upon further testing, they chose TiDB Serverless, the serverless option of TiDB Cloud, for the following reasons:

  • MySQL compatibility: TiDB Serverless is MySQL compatible, making migration a breeze for their developers.  
  • Fast response: TiDB Serverless is hosted within the same AWS Tokyo region as the websites. This ensured minimal latency and a seamless user experience.
  • Horizontal scalability: TiDB Serverless elastically scales up or down based on the workload, so there are no concerns over resource limitations.
  • High availability and ease of use: With TiDB Serverless, data is redundantly copied between storage nodes and placed in different availability zones to protect against machine or data center failures. It also features a simple management interface. 
  • Reasonable pricing: TiDB Serverless adopts a consumption-based pricing model that aligns with AJU’s needs for a cost-efficient solution. This model ensures AJU only incurs costs when its website is accessed, unlike AWS Aurora, where expenses accrue regardless of access. This key distinction can lead to significant savings, especially when website traffic is variable or unpredictable.

Before settling on TiDB Serverless, they also compared it with TiDB Dedicated, the dedicated tier of TiDB Cloud with which they can specify the number of nodes for performance. With TiDB Serverless, nodes automatically adjust based on demand, which makes it sufficiently capable of meeting AJU’s requirements.

Migrating to TiDB Serverless 

One issue with adopting TiDB Serverless was the difference in version between the MySQL supported by WordPress and the MySQL version compatible with TiDB Serverless.WordPress supports MySQL version 8.0 and above, and TiDB Cloud is compatible with version 5.7. This required template changes on WordPress to accommodate this version difference.

Mr Alberto took the lead in this task and managed to accommodate the version difference by changing the templates on WordPress.  

The cloud migration of the three websites began in April 2023, followed by the testing of TiDB Cloud in May and the integration of TiDB Serverless in June. The team successfully completed the migration in September.

Social Mission Takes Flight with PingCAP’s Support

Mr. Mizutani envisioned migrating Nagoya City’s websites to the cloud and bringing AJU’s website and email servers under the same umbrella. 

“Next year marks the 40th anniversary of AJU, where we offer opportunities for able-bodied and disabled individuals to work together. Many workplaces for the disabled involve manual labor, and there are few opportunities for intellectual work like at AJU,” Mr. Mizutani shared, “we want to continue to inspire others to follow suit.” 

PingCAP, the company behind TiDB Serverless, connected with AJU’s mission. Recognizing the unique value AJU brings, they went above and beyond, offering complimentary technical support beyond the usual scope.

“AJU Independence House is an organization aiming for the independence of people with disabilities. We believe we are a unique entity among organizations using TiDB. For example, Wadachi Computer House, part of AJU, provides a workplace for individuals with severe disabilities, including those who have acquired disabilities later in life and are learning IT skills from scratch to engage in work.

In progressing projects with members from diverse backgrounds, TiDB Serverless has been incredibly helpful as a solution that meets our requirements, allowing for easy and affordable use without the need for specialized database knowledge. We are very grateful for the meticulous support provided by PingCAP

Makoto Mizutani

Migration Project Leader, AJU

Original Publisher: Publickey -「止まらないWebサイトを構築せよ。名古屋市からの要請にWordPressとDocker Swarm、そしてTiDB Serverlessの組み合わせで対応」
Published Date: Jan 22, 2024

Spin up a Serverless database with 25GiB free resources.

Start Right Away