Mysql Cluster Web e WP 067589
Mysql Cluster Web e WP 067589
April 2010
MySQL Cluster for Web and E-Commerce
Applications: Growing Revenues and
Enhancing Customer Loyalty
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
Introduction ......................................................................................... 1
3
4
7
9
9
9
11
12
13
14
15
17
19
19
21
21
21
22
22
24
25
26
The Increasing Demands of Web and E-Commerce Applications ......
Using Databases to Achieve High Availability and Scalability.........
Introducing the MySQL Cluster Carrier Grade Edition Database........
Identifying Target Applications for MySQL Cluster .........................
Use Cases for MySQL Cluster in Web and E-Commerce Applications
MySQL Cluster for E-Commerce Applications ................................
MySQL Cluster for Social Networking Applications ......................
MySQL Cluster for Online Content Delivery..................................
MySQL Cluster for Service Access, Authorization,
and Monetization...........................................................................
Advantages of MySQL Cluster for Web and E-Commerce
Applications......................................................................................
Achieving High Availability with MySQL Cluster............................
Achieving High Performance and Linear Scalability with
MySQL Cluster..............................................................................
Flexible Data Access.....................................................................
Simplified Management and Monitoring........................................
Complementary MySQL Technologies for Web and E-Commerce
Applications.......................................................................................
Using the MySQL Pluggable Storage Engine Architecture to
Meet Diverse Application Needs ...................................................
Using MySQL Clusters Flexible Replication for Online
Applications...................................................................................
MySQL Cluster Case Studies in Web and E-Commerce
Applications.......................................................................................
E-Commerce Case Study 1: Shopatron........................................
E-Commerce Case Study 2: Leading European Online Mail
Order Company.............................................................................
Social Networking Case Study: Zillow.com...................................
Online Content Delivery Case Study: kurier.at..............................
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
Service Access and Authorization Case Study: Bredbandsbolaget
(B2)/Telenor .................................................................................. 26
27
27
Conclusion ........................................................................................
Appendix A: Additional Resources....................................................
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
Introduction
As organizations bring more of their operations to the Web, from e-commerce storefronts to
content delivery services and user collaboration, the pressure to keep systems running
continuously has never been higher. Services must be delivered with the highest and most
predictable levels of availability and performance, sustained even under the heaviest peak
loads, to ensure a quality customer experience and to cement loyalty.
The most successful businesses built on the Web live on the principle of failing fast, scaling
fast. This principle dictates that the operational environment will be a key differentiator in the
success of service adoption and monetization over the Web. Services are required to fail over
and scale transparently without any disruption to the consumer. The ability to handle explosive
growth in user volume, transactions, and storage capacity is critical to delivering online
services over a Web-based platform.
For many online applications such as e-commerce, information and access to it forms not only
the infrastructure of the application but also the entire revenue model of the business. With the
emergence of highly participative Web 2.0 technologies, new generations of online
applications are dependent on having fast and constantly available access to data. Such data
enables the online experience of users to reflect, in real time, their own preferences, history,
and requirements as well as ensuring a seamless and reliable experience as services are
consumed and transactions are committed over the Web.
MySQL offers a range of technologies to deliver high availability (HA) and scalability, and one
that has become increasingly relevant to specific use cases in Web and e-commerce
applications is the MySQL Cluster database.
MySQL Cluster Carrier Grade Edition has proven itself as the HA database of choice for
mission-critical telecommunications applications where 99.999 percent availability and
real-time performance are key requirements. MySQL Cluster is now seeing rapid adoption by
1
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
providers of Web applications and services in areas such as e-commerce, social networking,
content delivery, and real-time data analytics. These services demand databases
characterized by their ability to support
! 99.999 percent availability to minimize both planned and unplanned downtime
! Extreme levels of real-time read/write performance with predictable ultralow-latency
response times
! Dynamic scalability to handle the most-unpredictable volumes of users and transactions
The purpose of this white paper is to explore the increasing demands being placed on
databases to support Web and e-commerce applications. It presents an overview of the
MySQL Cluster database, demonstrating capabilities designed to meet the needs described
above. It also discusses sample workloads and real-world use cases, enabling you to
understand the types of Web applications that benefit from the use of MySQL Cluster.
2
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
The Increasing Demands of Web and E-Commerce Applications
lor nearly two decades, the promise o the internet has been to enable small startup companies to
compete with large global businesses oer the \eb, driing competition and choice or consumers.
loweer, it has been only the reduction o inrastructure costs-enabled by the rise o open source
sotware technologies running on commodity hardware systems-that has made this promise a reality.
Online businesses can dierentiate themseles at multiple leels, such as the serices and products
oered, pricing, ulillment, and brand reputation. All o these, howeer, are meaningless i the
inrastructure used to power the \eb application, such as the e-commerce engine, is oline or
response times are unacceptably slow.
By building its infrastructure on MySQL Cluster, go2 has achieved a more stable environment, improved its user experience,
and can now efficiently scale its platform with the growth of the mobile Web.
Dan Smith, Cofounder and CEO, go2 Media
As a result, any proider o an online application needs to ocus on the aailability and the
perormance o the serice it is deliering, which, in turn, is a unction o the inrastructure used to
delier the serice. An additional dimension to consider is both the capital and operational costs o the
serice, because this has a direct impact on ROI.
1here hae been many studies oer the years to assess the costs o downtime, and it has become clear
that such costs are highly dependent on actors such as the type o application, the industry, and the
number o users or transactions aected. Looking speciically at e-commerce applications used in
online retail businesses begins to reeal the true inancial impacts o downtime, with recent studies
1
calculating a cost to the business o >30,000 per minute, or >1.8 million per hour, in lost reenue.
Direct reenue loss arising rom the inability to process orders is only one aspect o the total reenue
impact caused by systems downtime. 1o gain a complete picture, it is also necessary to consider the
ollowing actors:
! Damage to the brand image
! Impact on customer relationships, satisaction, and loyalty
! Loss in employee productiity
! Potential regulatory issues i customer or inancial data is corrupted or lost
1o delier a highly aailable \eb-based serice, an organization must consider multiple actors during
technology selection:
1
blog.dssdatacenter.com,2009,0,1,a-pragmatic-iew-o-downtime-cost
3
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
! Ability to minimize both planned and unplanned downtime
! Instant detection o ailure eents
! last system recoery
! ligh throughput and scalability, with consistently short response times
Only when all these actors are considered is it possible to select technologies that can achiee the
leels o uptime and perormance demanded by \eb and e-commerce applications.
ligure 1 plots aailability measures expressed as percentages against real-world downtime experienced
by users:
Figure 1. This chart maps availability against downtime.
Len higher leels o aailability are possible with proprietary systems, such as serers and custom
middleware, that proide ull ault tolerance, but the cost and complexity o implementing such
solutions oten proe to outweigh any possible business beneits.
In summary, an inrastructure that deliers extreme leels o aailability and scalability with
instantaneous response and low cost proides a compelling business dierentiation or an online
business.
Using Databases to Achieve High Availability and Scalability
\hether you`re racing to introduce a new serice or trying to manage an aalanche o data in real time,
your database has to be scalable, ast, and highly aailable to handle eer-changing market conditions
and demanding customer requirements.
4
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
A database designed or \eb-based applications such as e-commerce must support a real-time lie data
experience. It must be able to couple the adantages o relational databases with the responsieness
demanded by online \eb applications.
Data and transactional states are usually the hardest parts o an online application to make highly
aailable. Implementing a database that is itsel highly aailable makes it easier or the application to
become highly aailable as well. 1his approach permits delegating the complexity o data management
and transactional states to the database layer. 1he clear adantage o this design is that the database will
always be more competent, eicient, and reliable mechanism in handling these duties than other
system components.
1he essential capabilities o the database to be used to delier lA, perormance, and scalability are
discussed below.
Minimizing Planned and Unplanned Downtime
A system architected or lA has been designed speciically to minimize downtime by proiding
resilience to system components that ail or are taken oline or maintenance. It is important to
recognize that downtime can be diided into planned and unplanned downtime, as 1able 1 shows:
TABLE 1. DIFFERENTIATING PLANNED FROM UNPLANNED DOWNTIME
PLANNED DOWNTIME UNPLANNED DOWNTIME
Hardware upgrades Hardware component failure
Software upgrades Software bugs and crashes
Bug fixes Operator error and malicious code
Backup routines Datacenter failure (physical disaster)
1o create an lA enironment or \eb-based applications, it is important to select only those
databases that are designed to minimize both planned and unplanned downtime.
Combining technologies such as clustering, redundancy, online operations, and geographic replication
can enable applications to meet ,and oten exceed, 99.999 percent aailability, totaling just ie minutes
o downtime per year, by minimizing both planned and unplanned downtime.
Fast Failover and Recovery
1he goal o any technology used to maximize system uptime must be to instantly detect ailures and
then ail oer to clustered systems, typically in less than one second, and then continue deliering
serices and processing transactions without any impact on the user. Multiminute ailoer times cannot
be tolerated by applications such as e-commerce storeronts and payment processing engines.
5
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
Database recoery is another element that is critical in deliering lA. It is all ery well to ensure that
the online application continues to proide serices in the eent o a ailure or a maintenance
operation, but i the remaining actie system is unable to sustain millisecond response times and
manage high throughput, the original objecties o designing or lA are compromised.
lor this reason, it is important to select databases that enable either replacement systems or recoered
systems to quickly rejoin and resynchronize with the actie database cluster so that normal system
resource leels are re-established to meet the perormance requirements o the serice. Database
recoery also needs to be automatic, without requiring manual interention by administrators or
complex programming logic embedded in the applications.
We have experienced two instances of hardware failure over the past couple of years. MySQL Cluster was able to instantly fail
over, avoiding any service interruption to our users. When we added replacement hardware, MySQL automatically
resynchronized it with the rest of the cluster, with no intervention from my team. It is an awesome technology.
Dave Dalrymple, VP Engineering, Shopatron Inc.
Performance
As with aailability, there are multiple dimensions to achieing high perormance o \eb and
e-commerce applications.
lrom the user perspectie, the serice they are using must be able to proide immediate
responsieness as it handles requests and perorm transactions, such as placing orders, oer the \eb.
1o achiee this, the database must be able to do the ollowing:
! Lnsure consistently low leels o latency as users interact with the serice in real time.
! Support peak leels o throughput, typically measured as the olume o simultaneous users and
transactions per second.
! Support constant updates ,writes,. Online applications, especially those related to e-commerce and
session management, hae ery high update ,write, demands on their underlying database, so the
database must be able to handle such transaction-intensie enironments and not be limited to basic
SLLLC1s that may be typical o nontransactional \eb applications.
! Delier predictability o perormance, regardless o the load on the system, so that low latency and
high throughput rom the database can be maintained.
As with lA, deliering low latency, high throughput, and predictable response times can help ensure
customer satisaction, resulting in higher loyalty and reenue.
Scalability
It is impossible to predict how successul a new online serice can become. A serice that starts out
appealing to seeral hundred users can quickly spiral to attract millions o online deotees through the
increasingly iral nature o communications enabled by \eb 2.0 technologies. Similarly, e-commerce
applications may start by oering just a ew products or sale online, but rapid expansions o product
6
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
catalogs and recommendations, pricing promotions, and user adoption can require the enironment to
scale rapidly to support increasing sales olumes.
Scaling Out
In traditional enterprise I1 enironments, scaling was achieed by deployment o applications and
databases to larger symmetric multiprocessing ,SMP, serers, but it has long been understood that such
a design approach is completely inappropriate or scaling \eb-based applications. 1he cost o such
solutions, coupled with their inability to eer scale suiciently to handle exploding \eb olumes, has
drien the rise o scale-out` architectures, where the processing and database load is deployed and
scaled oer low-cost commodity serers.
1o achiee eicient leels o scalability, it is thereore necessary to select databases that can be
distributed across multiple systems to handle the rapid increases in capacity and perormance
demanded by online systems. Len or scaling across many systems, it is also critical that the
underlying database can continue to support the ery high leels o write scalability demanded by the
application.
Weve always known that our capacity to handle rapid Web traffic growth would be critical to the success of Zillow. We selected
MySQL Cluster as a low-cost, high-throughput database with easy scalabilityand it has delivered. MySQL Cluster has
enabled us to manage our growth smoothly and cost-effectively and intelligently plan for future expansion.
Brian Milnes, Director of IT Operations, Zillow.com
Scaling Up
Recent adances in microprocessor design hae resulted in CPUs that boast multiple cores and threads.
1o take adantage o these new processing resources, the database must be multithreaded, enabling it
to be scaled up een within low-cost commodity systems.
Scaling Online
Coupling scalability with lA is especially critical or online applications such as e-commerce engines.
I a serice has to be restarted to recognize and use new serers deployed into an inrastructure, the
serice will experience downtime. 1hereore, databases must be selected that enable the inrastructure
to be scaled online with no interruption to either the application or the users. Such online scaling
ensures that the serice can accommodate the most-unpredictable workloads typical in online
applications without disrupting application aailability.
Introducing the MySQL Cluster Carrier Grade Edition Database
MySQL Cluster is a real-time transactional database combining the lexibility o a highly aailable
relational database with the low 1CO o open source.
7
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
leaturing a shared-nothing distributed architecture with no single point o ailure ,see ligure 2,,
MySQL Cluster is designed to delier the 99.999 percent aailability demanded by \eb and e-
commerce applications.
MySQL Cluster`s real-time design deliers predictable millisecond response times with the ability to
serice tens o thousands o transactions per second. Support or in-memory and disk-based data,
automatic data partitioning with load balancing, and the ability to add nodes to a running cluster with
zero downtime enable linear database scalability or handling the most-unpredictable \eb-based
workloads.
MySQL Cluster Carrier Grade Ldition is already proen in the toughest telecommunications
enironments, deliering higher database throughput and shorter response times at a tenth o the cost
o proprietary, clustered, shared-disk databases
2
, with the added beneit o running on commodity
hardware and operating systems. Customers include Alcatel-Lucent, B1 Plusnet, Cisco, Deutsche
1elekom, Lricsson, 1elenor, and U1Starcom.
Figure 2. The MySQL Cluster architecture eliminates any single point of failure.
1o learn more about the MySQL Cluster architecture, see the MySQL Cluster : Architecture and
New leatures \hitepaper,` at mysql.com,why-mysql,white-
papers,mysql_wp_cluster_architecture.php.
2
mysql.com,why-mysql,case-studies,mysql-cs-alcatel.php
8
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
Identifying Target Applications for MySQL Cluster
It is important to recognize that because MySQL Cluster is a distributed shared-nothing database,
certain ranges o application characteristics represent ideal candidates or it. Other applications are
better sered by other storage engines aailable with MySQL Serer, due to speciic requirements o
the applications. 1able 2 identiies the key characteristics to consider when deciding whether MySQL
Cluster represents a good it or a particular application.
TABLE 2. IDENTIFYING THE OPTIMAL APPLICATION FIT FOR MYSQL CLUSTER
GOOD FIT FOR MYSQL CLUSTER COMPLEMENT WITH OTHER MYSQL STORAGE ENGINES
Fast write throughput with low-latency response Database size of more than 2 TB
99.999 percent availability with subsecond failover and
automatic recovery
Rows demanding more than 8 KB of memory and 128 fields
Unpredictable scalability demands Requirement to store objects larger than 2 MB
Mainly primary key access, or subcomponents of multifield
primary key
Full table scans with complex joins
Simple table joins Foreign key support
By coupling MySQL Cluster with additional MySQL technologies, it is possible to use MySQL Cluster
within applications that may not, at irst glance, represent a good it. 1hese are discussed in the
MySQL Cluster Case Studies in \eb and L-Commerce Applications` section later in this white paper.
Use Cases for MySQL Cluster in Web and E-Commerce
Applications
1he ollowing section presents potential use cases or MySQL Cluster, which may requently be part o
a broader range o MySQL storage engines typically deployed within \eb and e-commerce
applications. 1hese examples are by no means exhaustie but are designed to present potential areas in
which MySQL Cluster brings unique alue to \eb-based applications.
MySQL Cluster for E-Commerce Applications
L-commerce applications hae the most-stringent requirements or lA and real-time responsieness,
so speciic modules o these applications can beneit most directly rom the capabilities o MySQL
Cluster.
9
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
Figure 3. This figure illustrates the anatomy of an e-commerce application.
In ligure 3, the database architecture has been standardized on MySQL, with a ariety o MySQL
storage engines proiding speciic unctionality or each module o the e-commerce application:
1. 1he master MySQL Serer coordinates the arious data management unctions o the application.
2. MySQL Serer with the MyISAM and Archie storage engines supports and captures user
behaior while browsing and searching products. 1hese lookup actiities are load-balanced across
the MyISAM slaes to ensure ast read scalability and lA.
3. MySQL Cluster manages user data or registration, access, authentication, and accounting. 1he
MySQL Cluster data nodes are also responsible or managing session state, including the shopping
basket as well as product codes and product aailability. User orders and payments are captured in
MySQL Cluster and then replicated to InnoDB tables or inoicing and shipping.
4. MySQL Serer powers the content management, and InnoDB replicates product content to the
master serers.
5. As users browse the product catalog, click-stream data is captured and stored in the Archie
storage engine. 1he data is then loaded into MyISAM tables that the business intelligence serer
uses or analysis. Product recommendations can then be loaded back into the MyISAM tables that
the browse and search modules o the application use. 1he application then displays the results to
the user or cross-sell and up-sell purposes.
Based on the example aboe, the ollowing modules represent the best candidates to be managed by
MySQL Cluster:
10
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
TABLE 3. FOR THE PREVIOUS EXAMPLE, THE BEST CANDIDATES FOR MYSQL CLUSTER MANAGEMENT
APPLICATION TYPE DATA ACCESS METHOD DATA CHARACTERISTICS DATA REQUIREMENTS
User data Primary keyuser ID Read- and write-intensive
(activity accounting, purchase
history, order status)
HA, real-time access
Product codes and
availability
Primary keyproduct
code
Read- and write-intensive HA, real-time access, scalability for
simultaneous users and updates
Session management Primary key (session
ID, user ID)
Write-intensive Subsecond failover, write scalability,
real-time data access
Orders and payments Primary key (user ID) Read- and write-intensive HA, subsecond failover, write scalability,
real-time data access
In addition to the use cases aboe, MySQL Cluster can be used within a broader set o data
management requirements or applications such as payment processing. 1his is the most complex
element o any e-commerce application, requiring the coordinated low o transactions across a
complex network o processes and systems.
1ypically, a single transaction touches systems holding user data and product catalogs and inoles
external proiders such as credit card companies, issuing banks, merchant banks, and payment
authorization engines. 1he transaction-and its state-must be persisted across each o these systems
and is thereore ideally suited to MySQL Cluster, which can coordinate the low o data across these
systems without corruption or loss due to system ailures.
MySQL Cluster enables us to incrementally scale our database infrastructure to meet our growth needs, which we could not
have done with our legacy system. Furthermore, this scale-out architecture gives us the flexibility to allocate development and
administrative resources to where they are needed most.
Project manager, European e-commerce company
MySQL Cluster for Social Networking Applications
Social networking is arguably the poster child o the \eb 2.0 reolution. lor example, lacebook has
witnessed stunning growth since its initial launch, in 2004. Only ie years later, it sered 400 million
users, 200 million o which accessed the serice eery day, collectiely uploading a billion images per
11
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
month
3
. lacebook is a large MySQL customer, relying on MySQL to enable its inrastructure to keep
pace with these huge demands.
\hereas lacebook is a dedicated social networking site, many other organizations hae integrated
social networking into their core online applications as a means to oster community building and
collaboration among members.
1he modules in 1able 4 represent the best candidates to be managed by MySQL Cluster:
TABLE 4. FOR THE PREVIOUS EXAMPLE, THE BEST CANDIDATES FOR MYSQL CLUSTER MANAGEMENT
APPLICATION TYPE DATA ACCESS METHOD DATA CHARACTERISTICS DATA REQUIREMENTS
User profile Primary keyuser name Read-intensive HA, real-time access
Status updates Primary keyuser name Write-intensive HA, real-time access
MySQL Cluster for Online Content Delivery
In comparison to other solutions, MySQL Cluster is superior to other databases in terms of maintenance, safety, stability,
scalability, and reliability.
Jo Rogner, Technical Manager, KURIER.at
Content management systems ,CMSs, are critical or \eb properties to manage the worklow needed
to collaboratiely create, edit, reiew, index, search, publish, and archie arious kinds o digital media.
loweer, MySQL Serer is the recommended database or core CMS unctions, ensuring that user
access and monetization ,subscriptions, are modules that can be eectiely managed by MySQL
Cluster.
1able 5 characterizes the components o a CMS:
TABLE 5. THE COMPONENTS OF A CMS
APPLICATION TYPE DATA ACCESS METHOD DATA CHARACTERISTICS DATA REQUIREMENTS
User data and user
authorization
Primary keyuser ID Read-intensive HA, real-time access
Content catalog Primary keysubject, Read-intensive HA, real-time access, scalability for
3
acebook.com,press,ino.phpstatistics
12
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
author simultaneous users
Session management Primary key (session
ID, user ID)
Write-intensive Subsecond failover, write scalability,
real-time data access
Online transaction
processing (OLTP)
Primary key (user ID) Read- and write-intensive HA, subsecond failover, write scalability,
real-time data access
MySQL Cluster for Service Access, Authorization, and Monetization
Online application proiders are dependent on reaching new customers and building new reenue
streams by deploying large-scale serices oer ixed and wireless networks.
All these serices are highly dependent on technologies such as IP management, Lightweight Directory
Access Protocol ,LDAP,, and centralized authentication, authorization, and accounting ,AAA,
protocols, enabling users to connect and consume network serices and network administrators to
capture usage inormation. Beore clients can start to access and consume serices on a network, they
must be authenticated to the network and then authorized to use the serices to which they are
entitled. 1heir consumption o network resources then needs to be captured ia the accounting
processes. Collectiely, AAA is a cornerstone o today`s network security, management, and in many
cases, monetization.
MySQL Cluster delivers the high availability that enables us to guarantee continuous broadband internet access and VoIP
services to our subscribers. This has had an immediate impact on significantly improving customer satisfaction and has reduced
the cost of operating our network.
Lars-Ake Norling, B2, Telenor
1o ensure that AAA serices unction, user data accessed by the authentication and authorization
processes and user actiity recorded in the accounting details need to be persisted to back-end AAA
data stores.
\ith the online user population continuing to explode as bandwidth increases, communication costs
decrease, and serices aailable oer ixed and wireless networks prolierate, the back-end data stores
o AAA and LDAP serices are now more mission-critical than eer.
As these networks grow, limitations can occur that add administratie oerhead, inhibit lexible scaling,
and aect the timely synchronization o data across the AAA and LDAP enironments.
13
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
1o address these challenges, MySQL has collaborated with the leading AAA
4
and LDAP serer
5
endors to integrate MySQL Cluster into their solutions to proide a robust back-end data store
designed to meet the perormance and aailability requirements o online applications.
Components o an AAA and LDAP inrastructure that can be managed by MySQL Cluster are
characterized in 1able 6:
TABLE 6. THE COMPONENTS OF AN AAA AND LDAP INFRASTRUCTURE THAT MYSQL CLUSTER CAN MANAGE
APPLICATION TYPE DATA ACCESS METHOD DATA CHARACTERISTICS DATA REQUIREMENTS
User authentication Primary keyinternal
LDAP user identifier
Read-intensive HA, real-time access, high scalability for
simultaneous user access
User authorization Primary keyinternal
LDAP user identifier
Read-intensive HA, real-time access
User accounting Primary keyinternal
LDAP user identifier
Write-intensive Subsecond failover, write scalability,
real-time data access
LDAP access and
updates
Primary keyinternal
LDAP user identifier
Read-intensive (write volumes
growing)
HA, scalability, real-time data access
Advantages of MySQL Cluster for Web and E-Commerce
Applications
1able details the \eb- and e-commerce-related capabilities o MySQL Cluster:
TABLE 7. MYSQL CLUSTER MEETS THE TOUGHEST CHALLENGES OF WEB-BASED APPLICATIONS
REQUIREMENT OF ONLINE APPLICATION MYSQL CLUSTER CAPABILITY
High reliability and HA ! Support for atomic, consistent, isolated, durable (ACID) transactions
! Distributed shared-nothing architecture
! Synchronous data replication
! Automated subsecond failover
4
lor more inormation, see Deliering Scalable & lighly Aailable Authentication & Accounting
Serices`: mysql.com,why-mysql,white-papers,mysql_wp_ha_auth_account.php.
5
lor more inormation, see Guide to Scaling OpenLDAP with MySQL Cluster`: mysql.com,why-
mysql,white-papers,mysql_wp_openldap-scaling-guide.php.
14
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
! Automatic recovery and data synchronization
! Local and global checkpoints to disk for durability
! Geographic replication between clusters
! Online upgrades
! Online add nodes
! Online backup
! HA consulting
! 24/7 technical support
! Professional training and certification
Performance and scalability ! Hybrid in-memory and disk-based storage
! Parallel server architecture for high read/write performance
! Automatic data partitioning enabling load balancing
! Distributed database for scaling out
! Multithreaded data nodes for scaling up
! Online add nodes for on-demand scaling
Interoperability ! Worlds most popular open source database
! Support for multiple hardware platforms and operating systems
! SQL and native APIs: Java/JPA, C++, LDAP, HTTP for data access
! Support for full range of MySQL Connectors
Low TCO ! Open source freedom, standards, and economics
! Low-cost service offerings
! Ability to run on commodity hardware, including rackmounts and blades
! Elimination of costly shared storage
! Simplified monitoring and management
Achieving High Availability with MySQL Cluster
1he architecture o MySQL Cluster is designed to delier 99.999 percent aailability, which includes
regularly scheduled maintenance operations as well as system ailures ,planned and unplanned
downtime,.
1his leel o aailability is achieed ia a distributed shared-nothing architecture and by synchronous
replication o data, which automatically propagates transaction inormation to all appropriate data
nodes, beore completion o the transaction. I one or more database nodes ail during a transaction,
the application will simply retry the transaction and the remaining data nodes will successully satisy
the request.
1he adantage o synchronous replication is that it eliminates the time shared disk architectures
consume in haing to re-create and replay log iles or the application to ail oer.
15
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
MySQL Cluster detects any ailures instantly, and control is automatically ailed oer to other actie
nodes in the cluster without interruption o serice to the clients ,see ligure 4,. In the eent o a
ailure, the MySQL Cluster database nodes can automatically restart, recoer, and dynamically
reconigure themseles-all completely transparently to the application.
Figure 4. With synchronous replication and subsecond failover, MySQL Cluster minimizes downtime.
I all nodes ail due to a power ailure or a multisystem hardware ailure, MySQL Cluster will ensure
that an entire system can be saely recoered to a consistent state. It does so by maintaining a series o
checkpoints on the local disks o each data node, giing durability to the database.
1o urther support continuous operation, MySQL Cluster Carrier Grade Ldition can add nodes online
to a running cluster by automatically repartitioning data as new node groups are added, ensuring that
the cluster will maintain continuous operation and application connectiity. MySQL Cluster also
enables online updates to a lie database schema, in addition to upgrades to and maintenance o the
underlying hardware and sotware inrastructure.
1he ability to withstand site ailures by replicating clusters across multiple remote locations is an
important capability or many global online serices. Geographic replication ,see ligure 5, is a eature
o MySQL Cluster, commonly implemented in order to
! Achiee higher aailability within the datacenter or across a geographic wide area network ,\AN,
! Proide lower-latency data access in dierent geographies
! Replicate data to another near-real-time database or complex data analysis, without haing an
impact on the perormance o the main, real-time production database
16
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
Figure 5. Geographic replication provides multisite protection for critical online applications.
1hrough the capabilities described aboe, MySQL Cluster is able to eliminate both planned
maintenance and unplanned downtime in order to delier the 99.999 percent aailability demanded by
\eb-based applications.
Achieving High Performance and Linear Scalability with MySQL Cluster
In addition to 99.999 percent aailability, high perormance is a critical requirement or
accommodating the massie olumes o database requests and transactions typically associated with
\eb-based serices, especially e-commerce applications. Database perormance requirements are
typically tens o thousands o operations per second, with a consistent response time latency o just a
ew milliseconds.
As a distributed database, MySQL Cluster employs a parallel serer architecture with multiple actie
master nodes. 1his ensures that transactions ,both reads and writes, can be load-balanced and
automatically scaled across multiple SQL serers simultaneously, with each SQL node able to access
and update data across any node in the cluster.
MySQL Cluster also oers a lexible architecture with the ability to store indexes as well as data in
memory or on disk. As a result o this in-memory characteristic, MySQL Cluster can limit disk-based
I,O bottlenecks by asynchronously writing transaction logs to disk, thereore maintaining real-time
perormance.
MySQL Cluster .0 was recently benchmarked with the DB12 test suite ,see ligure 6, and achieed
251,000 transactions per minute ,1PM, with just our data nodes
6
. Lach transaction inoled
approximately 30 database operations, and MySQL Cluster was able to sustain approximately 125,000
6
blogs.sun.com,hasham,entry,mysql_cluster__perormance_benchmark
17
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
operations per second, with an aerage response time o only 3 milliseconds. 1his perormance
increase represented a 4x improement in scalability oer preious ersions o MySQL Cluster.
Figure 6. MySQL Cluster achieves more than 250,000 TPM, or 125,000 operations per second, with an average latency of only 1.5 milliseconds.
!"#$% !"#$%&'()%")$%!*+,-%+$#.$#%)"/$%0(1%2)1&(33$/%")%$(4'%5'*124(3%1$#.$#6%02&'%1$.$#(3%"7%&'$%1$#.$#%2)1&()4$1%81$/%
(1%3"(/%9$)$#(&"#1%&"%&'$%!*+,-%:381&$#%/(&(;(1$<%=)%(3&$#)(&2.$%/$53"*>$)&%4"83/%81$%>83&253$%4"))$4&2")1%7#">%$(4'%
!*+,-%+$#.$#%)"/$6%0'24'%0"83/%'(.$%#$183&$/%2)%&'$%81$%"7%7$0$#%!*+,-%+$#.$#%)"/$1<
In addition to scaling perormance, MySQL Cluster can be deployed into a range o scaling scenarios.
1he distributed architecture enables it to be easily scaled across multiple low-cost serers. Using the
latest multithreaded data nodes, MySQL Cluster can be used in serer architectures equipped with
multiple cores and threads. MySQL Cluster also supports the addition o nodes to a running cluster
without interruption rom the standpoint o the applications or users, enabling it to handle the most-
unpredictable and olatile workloads demands o \eb-based applications.
\ith support or as many as 255 nodes, organizations hae the lexibility to start small and make
incremental inestments to increase capacity as serice adoption and e-commerce reenue streams
grow. 1his eliminates the need or a large initial hardware and sotware inestment in what tends to be
oer-powered and costly conigurations.
1hrough the combination o a distributed, parallel serer architecture coupled with in-memory index
and data support and a choice o scaling options, MySQL Cluster is highly suited to demanding,
transaction-intensie e-commerce and \eb-based applications.
MySQL Cluster has enabled us to meet our demands for scalability, performance, and continuous uptime, at a much lower cost
than proprietary technologies. We would be dead in the water without it.
Richard McCluskey, Senior Engineer, go2 Media
18
Oracle White PaperMySQL Cluster for Web and E-Commerce Applications
Flexible Data Access
Application deelopers can easily integrate new and legacy applications, using their preerred database-
independent method. MySQL Cluster Carrier Grade Ldition proides multiple data access methods
that work together. 1hese include SQL and natie APIs such as C--, Jaa, LDAP, and \eb serices.
Designed or Jaa deelopers, the new MySQL Cluster Connector or Jaa implements a high-
perormance, easy-to-use natie Jaa interace and OpenJPA plug-in that directly maps Jaa objects to
relational tables stored in the MySQL Cluster database.
\ith the elimination o data transormations into SQL, users get lower data access latency and higher
throughput. In addition, Jaa deelopers hae a more natural programming method or directly
managing their data, with a complete, eature-rich solution or object-relational mapping. As a result,
the deelopment o Jaa applications is simpliied, with aster deelopment cycles resulting in
shortened time to market or new serices.
Simplified Management and Monitoring
According to industry research, staing and downtime comprise almost 50 percent o database 1CO
.
At the same time, I1 budget and staing leels are declining or lat, whereas demand or I1 serices
continues to increase. Simpliied management and monitoring tools or MySQL Cluster Carrier Grade
Ldition help address these challenges by
! Maximizing administrator productiity with tools or managing database clusters more eiciently
! Minimizing database downtime caused by human error
! Doing proactie monitoring o real-time usage statistics to ensure seamless database operations
Management and monitoring tools or MySQL Cluster Carrier Grade Ldition sere to reduce database
1CO and create a more agile, highly aailable I1 enironment by slashing management complexity,
increasing administrator eiciency, and reducing the risk o downtime.
MySQL Cluster Manager
MySQL Cluster Manager simpliies the creation and management o MySQL Cluster Carrier Grade
Ldition by automating common management tasks. As a result, DBAs and systems administrator are
more productie, so they can ocus on strategic I1 initiaties that support the business and respond
more quickly to changing user requirements. At the same time, risks o database downtime preiously
attributable to manual coniguration errors are signiicantly reduced.