Deploying MediaWiki On IBM DB2 in The Cloud Presentation

26
Deploying MediaWiki on IBM DB2 in the Cloud Leons Petrazickis IBM Toronto Laboratory [email protected]

description

 

Transcript of Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Page 1: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Deploying MediaWiki on IBM DB2in the CloudLeons Petrazickis

IBM Toronto [email protected]

Page 2: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

What We Want

RightscaleRightscale

Amazon EC2Amazon EC2

DB2 serverMediaWiki server

Page 3: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

What is Cloud Computing?

● Illusion of infinite resources available on demand● Infrastructure – Infinite servers

– e.g. Amazon EC2

● Platform – Infinite computing capacity– e.g. Google AppEngine

● Software – Infinite scalability– e.g. SalesForce.com

Page 4: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Traditional Server

Page 5: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Google Server

Page 6: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Google RackOne serverDRAM: 16GB, 100ns, 20GB/sDisk: 2TB, 10ms, 200MB/s

Local rack (80 servers)DRAM: 1TB, 300us, 100MB/sDisk: 160TB, 11ms, 100MB/s

Cluster (30+ racks)DRAM: 30TB, 500us, 10MB/sDisk: 4.80PB, 12ms, 10MB/s

Page 7: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Google Data Center● Containerized data center since 2005

● 1160 servers per standard shipping container

Page 8: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Business Case for Cloud

● Cheaper than traditional approaches– No initial capital expense– Only pay for what you use

● Best practices without the learning curve● Instant scalability

– Bring up 10 more web servers because everyone linked to you at once

– Bring up 1000 test servers to test a networking app, shut them down right after

Page 9: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Vertical Scalabilityon Amazon EC2

Small Instance•32-bit, •1.7GB of memory, •1 virtual core * 1CU

Small Instance•32-bit, •1.7GB of memory, •1 virtual core * 1CU

Large Instance•64-bit, •7.5GB of memory, •2 virtual cores * 2CU/core ( 4 CU)

Large Instance•64-bit, •7.5GB of memory, •2 virtual cores * 2CU/core ( 4 CU)

Extra Large Instance•64-bit, •15GB of memory •4 virtual cores * 2CU/core (8 CU)

Extra Large Instance•64-bit, •15GB of memory •4 virtual cores * 2CU/core (8 CU)

single database server

scalability limitsingle database server

scalability limit

Page 10: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Good and Bad Uses

Good

● Proof of Concept

● Development and Test

● Public facing web presence

● Departmental systems

● Applications with highly variable workloads

● Seasonal applications

● Disaster recovery and backups

Bad

● Highly transactional workloads

● Data with high security/privacy demands

● Applications with complex regulatory requirements

Page 11: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

What is DB2?

● IBM DB2 V9.7 database server● Free DB2 Express-C edition

– http://ibm.com/db2/express/

● Transactional, ACID-compliant● Stored procedures in both SQL and Java● pureXML, Full Text Search, etc

Page 12: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Database Architecture in the Cloud

load balancer to create a single

system image for the cluster

load balancer to create a single

system image for the cluster

Page 13: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

No Oracle RAC in Cloud

dataNo “shared disk” in

the CloudNo “shared disk” in

the Cloud

All servers must have access to data

All servers must have access to data

No low latency communications in

the Cloud

No low latency communications in

the Cloud

Oracle RAC does not work in the

Cloud

Oracle RAC does not work in the

Cloud

Page 14: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Master/Slave Replication in Cloud

data

Read requests go to slaves

Read requests go to slaves

Write requests go to master

Write requests go to master

data

data

Master replicates data to slaves

Master replicates data to slaves

No guarantee of data

integrity

No guarantee of data

integrity

Routing logic in the application

Routing logic in the application

Page 15: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

DB2 and GRIDSCALELoad Balancing in Cloud

data

Read requests are balanced across cluster

Read requests are balanced across cluster

data

data

No data integrity

issues

No data integrity

issues

transparent to the

application

transparent to the

application

Write requests go to ALL servers

Write requests go to ALL servers

GRIDSCALE DB2 load balancer

Page 16: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

DB2 Data Partioning Featurein the Cloud

● Database Sharding:– Shared Nothing database architecture– Data is partitioned across a number of DB2 nodes

with each node managing only its own portion of data

● Parallel Processing: DB2 DPF splits complex queries and parallelizes their execution across DB2 nodes in a DPF cluster. Results are recombined and returned to the calling application

Page 17: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

DB2 Data Partioning Featurein the Cloud

● Shared Nothing architecture fits well in to the Cloud provisioning model

● Capacity can be scaled up/down by adding/removing independent nodes to the cluster

● Execution of complex queries automatically parallelized across a cluster

● Partitioning and parallelization are transparent to an application

● Designed to process complex queries over very large data sets

Page 18: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

DB2 High Availability Disaster Recovery in Cloud

Application sends a read

Database

GRIDSCALE Servers

Applications

DB2 DB2

Page 19: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

DB2 High Availability Disaster Recovery in Cloud

Database

Applications

GRIDSCALE Servers

Database server fails; read is automatically re-routed

DB2DB2

Page 20: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

DB2 High Availability Disaster Recovery in Cloud

Databases

Applications

GRIDSCALE Servers

INSERT INTO EMPLOYEE (ID, NAME, SALARY) VALUES (100, ‘Smith’, 35000); UPDATE EMPLOYEE SET …

GRIDSCALERecovery Log

When the database server is brought back online, GRIDSCALE automatically re-synchronizes it while the application continues

DB2DB2

Page 21: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

What is MediaWiki?

● Powers Wikipedia– since 2002

● Countless other websites:– Ubuntu Help

– Folding@Home

– FileZilla Documentation

– Mozilla Developer Center

– Super Mario Wiki

– etc.

Page 22: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

What is MediaWiki?

● Written in PHP

● Traditionally runs on MySQL

● Ported to IBM DB2 among others

● Open source – community contributions welcome

Page 23: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Why database abstraction?

● MySQL

mysql_query(); mysql_affected_rows();● SQL Server

mssql_query(); mssql_rows_affected();● IBM DB2

db2_exec(); db2_num_rows();● Incompatible PHP APIs for every database

– Everything a function in global namespace

Page 24: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Why database abstraction?

● MySQL

SELECT * FROM table LIMIT 10;● SQL Server

SELECT TOP 10 * FROM table;● IBM DB2

SELECT * FROM table

FETCH FIRST 10 ROWS ONLY;● Incompatible SQL syntax

– No single standard that just works

Page 25: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

MediaWiki Solution

● One abstract class that defines the database API– DatabaseBase

● Child classes that handle specific databases– DatabaseMySQL

– DatabaseIBM_DB2

– etc.

Page 26: Deploying MediaWiki On IBM DB2 in The Cloud Presentation

Resources

● Leons Petrazickis– http://lpetr.org/blog/

[email protected]

● DB2 in the Cloud– [email protected]

● Amazon Web Services– http://aws.amazon.com/

● RightScale– http://www.rightscale.com/

● IBM Cloud– http://www-949.ibm.com/c

loud/developer/