A visit to the Angry Birds store in the Amazon cloud
Read Replicas
In Amazon's cloud, the store relies on the Amazon Relational Database Service (RDS), which greatly simplifies setting up, operating, and scaling relational databases [4]. It can be configured via the AWS Management Console, the interface for AWS. For read-intensive queries – and they occur far more frequently than writes – admins can, for example, call Create Read Replica
to create multiple slave database instances (Figure 2). These instances rely on the master-slave MySQL replication model; however, Rovio uses the read replicas exclusively for generating reports.
The read slaves prevent database locks and deadlocks occurring when generating reports by introducing a kind of load balancing. Updates to the database are thus first written to the master instance and are then distributed asynchronously to the read slaves.
Caching
Caching relieves the load on the Magento database. The store achieves high availability, while at the same time minimizing database queries through the use of Varnish Cache [5]. The service is responsible for load balancing: it removes overloaded servers that respond slowly, or not at all, from load balancing and automatically replaces them with new instances. The AOE developers have also made pages statically cacheable in a large part of the Rovio store. Intelligent use of the browser cache and a reverse proxy cache means that clients handle some of the work. Shopping carts, the checkout process, payment functions, and user profiles are dynamically generated by the store.
If 5,000 visitors really do visit the store at the same time, the Varnish cache only queries the back end once per page or cache lifetime (TTL); it otherwise delivers cached content to the visitors. Varnish only allows dynamic requests through to Magento, which boosts speed all told about 400-fold. The application also offers potential for optimization: Reducing the log level, disabling logging functions, and regularly cleaning data (logs, expired cache content) also provide a speed boost.
To relieve the main database, the store's developers initially worked with a separate database until eventually replacing the cache back end with Redis. The NoSQL database stores key-value pairs directly in memory and thus accelerates the requests.
Setting Up Amazon's Databases
Configuring Amazon's database services is a fairly easy process using the Management Console. New instances are easily started, and the database is easily selected (Figure 3).
Security Groups control access to the instances, thus ensuring the necessary security. Admins can use the Groups parameters where needed to modify individual database configuration parameters. Once AWS is set up, it defines database parameters, such as the host, user, and password specifically for the environment (production or staging) and then enables the database for online access. For Magento, it ultimately does not matter whether its own database runs in a virtual environment such as Amazon RDS or on a dedicated server.
Importing data to the cloud is handled by a MySQL client, as you might expect. The system is limited by the partly static nature of the database. It cannot dynamically field surprising visitor storms, even though the application servers scale automatically. It is thus important to compute your needs correctly on a project-specific basis, because changes in the operation involve some downtime. The available instance sizes offer 5 to 3,370GB of storage with selectable CPU power and RAM.
New to Amazon is an option for guaranteed I/O performance [6], which does cause additional cost but offers significantly improved performance. Standby replicas [7] ensure more reliability and seamless operation without downtime; Amazon creates standby replicas automatically in separate data centers, which it refers to as Availability Zones (AZ). They allow you to handle and compensate for planned maintenance windows for the database. If the main data center fails, the standby database in another zone automatically steps in (hot standby), so that operation continues without intervention.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.
-
DebConf24 to be Held in South Korea
Busan will be the location of the latest DebConf running July 28 through August 4
-
Fedora Unleashes Atomic Desktops
Fedora has combined its solid distribution with rpm-ostree system to make it possible to deliver a new family of Fedora spins, called Fedora Atomic Desktops.
-
Bootloader Vulnerability Affects Nearly All Linux Distributions
The developers of shim have released a version to fix numerous security flaws, including one that could enable remote control execution of malicious code under certain circumstances.