You are on page 1of 56

IBM DB2: Using the Most Flexible Enterprise-Class Database on Amazon EC2 for Free Speaker(s): Leon Katsnelson

Mark Wilding Cloud Computing for Developers Hosted by IBM and Amazon Web Services October 1, 2009

IBM Software Available on EC2


A partnership between IBM and AWS that allows you to develop and deliver your applications on the Amazon Elastic Compute Cloud Easy to use. Start developing your applications on IBM software on Amazon EC2 in minutes No barriers. IBM is providing software at no charge for development & test of commercial applications on Amazon EC2. Pay only infrastructure charges - as little as $0.10/hour. Pay as you go. Run production versions of leading IBM software products and pay hourly only for what you need, when you need it. Portability. Use your existing IBM licenses for most IBM software products in the cloud or on premise - its now your choice. Products. Currently DB2, Informix Dynamic Server, WebSphere sMash, Lotus Forms Turbo, IBM Mashup Center, WebSphere Application Server, WebSphere eXtreme Scale, WebSphere Portal Server and Lotus Web Content Management. We have announced our intent to offer others.

Cloud Computing for Developers hosted by IBM and Amazon Web Services

IBM Use Cases


Proof-of-Concept/Development. Many projects begin by creating development and test environments. Development AMIs are available at no additional fee beyond Amazon EC2 usage fees. Steady State Usage. Migrate your existing IBM software licenses to the Amazon cloud and only pay the normal hourly charges for EC2. On-Demand Usage. Cost-effective, pay as you go licensing for select IBM software allows you to scale up or down the number of instances to meet your workload demands. This model works well for unpredictable or variable workloads Hybrid. Use a combination of steady state licenses for the predictable low water mark and on-demand licenses for the variable workloads. http://aws.amazon.com/IBM

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Can someone, please, define Cloud Computing?

Cloud Software as a Service (SaaS) Cloud Platform as a Service (PaaS) Cloud Infrastructure as a Service (IaaS)

Source: Draft NIST Working Definition of Cloud Computing v14


Cloud Computing for Developers hosted by IBM and Amazon Web Services

The DB2 strategy for Cloud Computing

Deliver key virtualization, standardization and automation technologies to support private cloud initiatives Partner with key public cloud providers (Amazon EC2) to fully integrate DB2 in to the ecosystem Provide robust DBMS for SaaS vendors Make DB2 the natural choice for:
building applications for deployment in the cloud use cloud resources for development and test using cloud as disaster recovery site

Offer terms and conditions and pricing to make DB2 the best DBMS for the Cloud
Cloud Computing for Developers hosted by IBM and Amazon Web Services

DB2: the best pricing and terms and conditions for the Cloud
Free build your own DB2 Express-C AMIs
Unlimited database size, any size instance, 32 and 64-bit, will use max of 2 cores and 2GB of memory. Upgradable with optional support and additional resources. Licensed for free production use (including commercial apps) Pay only for EC2 resources

Free pre-built Development AMIs:


No charge for DB2/SuSe. Pay only for EC2 resources.

Pay by hour Production AMIs:


Multiple instance sizes, DB2 Express or DB2 Workgroup. One bill from Amazon includes hardware resources, operating system (SLES) and DB2 Support by Amazon, backed up by IBM.

Bring your own DB2 licenses: use surplus/ELA-negotiated DB2 licenses to deploy on Amazon EC2 servers

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Creating your own DB2 AMI

Watch the video and download automated script:


http://www.channeldb2.com/vid eo/db2-expressc-on-amazonec2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

IBM Production AMIs on EC2


IBM Production Ready Amazon Machine Images

http://aws.amazon.com/IBM
Hourly Price (in USD)

Includes: EC2 resources, SLES and IBM Product not included: Amazon EBS and data transfer
Standard images High CPU images
Extra Large 7GB, 20CU Small Large Extra Large Medium 1.7GB, 1VC 7.5GB, 2VC (4CU) 15GB, 4VC (8CU) 1.7GB, 5CU

DB2 Express Edition (4GB, 4 cores) DB2 Workgroup Edition (16GB, 16 cores)
Informix Dynamic Server Express Edition Informix Dynamic Server Workgroup Edition IBM Mashup Center WebSphere Application Server WebSphere sMash Lotus Forms Turbo Lotus Web Content Management Server Standard Edition WebSphere Portal Server and IBM Web Content Management Server Standard Edition

$0.38 $1.31
$0.38 $1.31 $1.98 $0.81 $0.50 $0.88 $2.48 $6.39 $4.82 $12.64 $2.50

$0.65

$2.50
$0.65

$3.30

$3.30 $3.79 $1.48 $0.60 $1.60 $8.71 $24.35

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Ecosystem example: DB2 for SaaS/PaaS Corents SaaS-Suite on IBM DB2 Express-C AMI

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Ecosystem example: Simplifying cloud development WaveMaker

Drag and drop assembly of cloud applications using Ajax widgets WaveMaker studio runs in a web browser Integrated with other IBM Amazon Cloud offerings. Attend WaveMaker-RightScale session 4 - 4:55pm Eastern
9 Cloud Computing for Developers hosted by IBM and Amazon Web Services

Ecosystem example: Automating Cloud Operations

10,000+ users, hundreds of customers 640K+ servers launched, 25M+ server hours Scaling events: 50-3500 servers 3.5 days, 6400 cores
Cloud Computing for Developers hosted by IBM and Amazon Web Services

Building the next worlds best application Questions to answer decisions to make
Chances are your application will deal with data that has to be persisted and recalled i.e. you will need some sort of a persistent data store. What kind? How will you interact with the data, what APIs will you use? Will you have the resources to have development and test systems. Can you afford these? Will the data store sustain the workloads that you expect? At what price? Do you even know what workloads to expect? What happens when you are wrong on either high or low side? What about reliability and availability?

11

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Database decisions

A relational database for keeping track of structured data, or A key-value non-relational store What about a hybrid data store that can do both relational and non-relational data?

12

Cloud Computing for Developers hosted by IBM and Amazon Web Services

DB2: hybrid relational-XML DBMS DB2 stores XML in parsed hierarchical format create table dept (deptID char(8),, deptdoc xml); Relational columns are stored in relational format (tables) XML columns are stored natively Very fast:
No XML parsing for query evaluation! Indexed for high speed access

deptID PR27

deptdoc
<dept> <emp></emp> </dept>

DB2 Storage

Cloud Computing for Developers hosted by IBM and Amazon Web Services

No compromises in programming capabilities SQL and Xquery based APIs Java: POJO, J2EE, JPA, Hybernate, iBatis, pureQuery .NET: native .NET data provider plus extensive integration in to Microsoft Visual Studio Dynamic Languages (PHP, Ruby on Rails, Python, PERL):
Python: IBM developed and supported driver, full Django and SQLAlchemy support PHP: procedural and OO style of programming, ZEND Framework support etc. Ruby on Rails: IBM developed and supported Ruby driver and Rails adapter, the only commercial DBMS with full vendor support See examples already deployed on the cloud

Cloud Computing for Developers hosted by IBM and Amazon Web Services

No compromises in programming capabilities Web Services API for data access

REST or SOAP/XML API


Submit individual SQL statements as a web service call Call stored procedures using web services APIs

ATOM feeds for publishing data out of a database Federate data delivered via web services:
Join DB2 data with data delivered via a web service Call a web service to perform data operations:
Validate postal address List overstock items on eBay Geocode points of interest Convert prices/revenue in to different currency
Cloud Computing for Developers hosted by IBM and Amazon Web Services

Use cloud for Development and Test

DEMO: BUILD DEVELOPMENT AND TEST ENVIRONMENT IN A FEW MINUTES


Cloud Computing for Developers hosted by IBM and Amazon Web Services

Cloud Computing confusion

Use Oracle Database 11g and Oracle Enterprise Linux to build enterprise-grade solutions in the cloud, leveraging the virtually unlimited compute power and storage of Amazon Web Services (AWS).
Source: http://aws.amazon.com/solutions/featured-partners/oracle/

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Vertical Scalability Ability to use larger systems as requirements grow Example system sizes in Amazon EC2 Max CPU/Memory limit for vertical scaling
Standard Extra Large Instance 64-bit, 15GB of memory 4 Vcores*2CU/core 8 compute units Standard Large Instance 64-bit 7.5GB of memory 2 Vcores*2CU/core 4 compute units Standard Small Instance 32-bit 1.7GB of memory 1 Vcores*1CU/core 1 compute unit High CPU Medium Instance 32-bit 1.7 GB of memory 2 Vcores*2.5CU/core 5 compute units High CPU Extra Large Instance 64-bit, 7GB of memory 8 Vcores*2.5CU/core 20 compute units

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Horizontal Scalability

Clustered servers with a load balancer Load balancer provides a single application image to clients Potentially unlimited horizontal scalability

Clients

Load Balancer Application Servers

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Database Clustering in the Cloud


Cloud computing resource limitations
Cannot provision shared disks Cannot specify high-bandwidth private networks

As a result, cannot use


Technologies that require additional networking Technologies that use shared disks
(e.g. Oracle RAC, Veritas Cluster Server)

A-Z
Clients Load Balancer Application Servers Database Servers Shared Disk

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Database Scalability in the Cloud

Vertical scaling
Use larger servers until max capacity reached

Horizontal scalability solutions


Database sharding Database partitioning Master/slave replication with load balancing Active/active replication with load balancing

21 Cloud Computing for Developers hosted by IBM and Amazon Web Services

Database Sharding

Process of breaking a large database into multiple, smaller independent databases Each database is self contained and usable by the application by itself
A-I

A-Z

J-R

22

S-Z
Cloud Computing for Developers hosted by IBM and Amazon Web Services

Data Partitioning

Process of distributing data across multiple database servers (e.g. DB2 DPF) Requires a coordinating server to route queries appropriately
A-I

A-Z

J-R

23

S-Z
Cloud Computing for Developers hosted by IBM and Amazon Web Services

Master/Slave Replication

Writes sent a single master database server which replicates changes to slaves Application can redirect reads to slaves for scalability; limited by complexity of replication No guarantee of data integrity for reads
Master database Writes A-Z Slave database Reads A-Z

Slave database A-Z


Cloud Computing for Developers hosted by IBM and Amazon Web Services

Active/Active Replication

Writes are replicated to all servers but not synchronous Reads are load balanced based on state and load Easily add/remove databases on demand

A-Z

A-Z

A-Z
Cloud Computing for Developers hosted by IBM and Amazon Web Services

DB2 + GRIDSCALE for truly elastic cloud database

SOLVING ONE OF THE CLOUD COMPUTING GREATEST CHALLENGES


Cloud Computing for Developers hosted by IBM and Amazon Web Services

How xkoto GRIDSCALE-DB2 Clustering Works

Applications

GRIDSCALE Servers

Databases

DB2

DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Write Processing with xkoto GRIDSCALE-DB2 Clusters

Applications

All write SQL statements are captured and stored in the GRIDSCALE Recovery Log
INSERT INTO EMPLOYEE (ID, NAME, SALARY) VALUES (100, Smith, 35000); UPDATE EMPLOYEE SET

GRIDSCALE Servers

Databases

GRIDSCALE Recovery Log


DB2 DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Write Processing with xkoto GRIDSCALE-DB2 Clusters

Applications

Writes are broadcast to all databases servers (no master database server)
GRIDSCALE Servers

Databases

DB2

DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Write Processing with xkoto GRIDSCALE-DB2 Clusters

Applications

Each database server processes the statement independently


GRIDSCALE Servers

The first successful response is sent back to the application


Databases

DB2

DB2

30 Cloud Computing for Developers hosted by IBM and Amazon Web Services

Write Processing with xkoto GRIDSCALE-DB2 Clusters

Applications

Responses from the remaining servers are checked for consistency


GRIDSCALE Servers

Databases

DB2

DB2

31 Cloud Computing for Developers hosted by IBM and Amazon Web Services

Read Processing with xkoto GRIDSCALE-DB2 Clusters

Reads are only sent to one database server the most up to date and least busy Load balancing is based on a shortest queue algorithm and network latency Remote database servers can be write only
Databases

Applications

GRIDSCALE Servers

DB2

DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Expanding the DB2 Database Cluster

Applications

Restore existing backup to new/failed database server


GRIDSCALE Servers

Databases

DB2

DB2

DB2

Restore backup
33 Cloud Computing for Developers hosted by IBM and Amazon Web Services

Expanding the DB2 Cluster

Applications

GRIDSCALE automatically re-synchronizes the old backup


GRIDSCALE Servers

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

Databases

GRIDSCALE Recovery Log


DB2 DB2

DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Expanding the DB2 Cluster

Applications

New database server is now available for load balancing


GRIDSCALE Servers

Databases

DB2

DB2

DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

xkoto GRIDSCALE-DB2 Scale-Out Benchmark

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Contracting the DB2 Cluster

Applications

Database server is delisted at the GRIDSCALE server(s) Server resources are immediately returned to Amazon EC2 and are no longer charged for
Databases GRIDSCALE Servers

DB2

DB2

DB2 DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

DB2 High Availability and Disaster Recover (HADR)

ELIMINATING DATABASE OUTAGES


Cloud Computing for Developers hosted by IBM and Amazon Web Services

xkoto Eliminating DB2 Database Outages

Applications

Application sends a read

GRIDSCALE Servers

Databases

DB2

DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Eliminating DB2 Database Outages

Applications

Database server fails; read is automatically re-routed


GRIDSCALE Servers

Databases

DB2

DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Eliminating DB2 Database Outages

When the database server is brought back online, GRIDSCALE automatically re-synchronizes it while the application continues
INSERT INTO EMPLOYEE (ID, NAME, SALARY) VALUES (100, Smith, 35000); UPDATE EMPLOYEE SET

Applications

GRIDSCALE Servers

Databases

GRIDSCALE Recovery Log


DB2 DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Eliminating DB2 Database Outages

Applications

Once the database server is up-to-date, GRIDSCALE adds it back to the cluster
GRIDSCALE Servers

Databases

DB2

DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Performing Planned Maintenance

Applications

Maintenance tasks can be done through GRIDSCALE and applied to all DB2 servers (e.g. schema changes)

GRIDSCALE Servers

Databases

DB2

DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Performing Planned DB2 Maintenance

Applications

Maintenance can also be done in a rolling fashion, one DB2 server at a time without application outages All write SQL statements are captured and stored in the GRIDSCALE Recovery Log

GRIDSCALE Servers

Databases

DB2

DB2

Fixpak, reorg, backup etc.


Cloud Computing for Developers hosted by IBM and Amazon Web Services

Performing Planned DB2 Maintenance

Applications

Maintenance can also be done in a rolling fashion, one database server at a time without application outages All write SQL statements are captured and stored in the GRIDSCALE Recovery Log

GRIDSCALE Servers

Databases

DB2

DB2

Fixpak, reorg, backup etc.


Cloud Computing for Developers hosted by IBM and Amazon Web Services

GRIDSCALE + DB2 Cloud Architectures With GRIDSCALE DB2 database can be deployed in various combinations in the cloud or on premise
Applications Applications

Databases

Databases

DB2

DB2

DB2

DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

GRIDSCALE-DB2 Cloud Architectures

Cloud resources can be used for extra capacity or for DR purposes


Applications Applications

Databases

Databases

DB2

DB2

DB2

DB2

DB2

Cloud Computing for Developers hosted by IBM and Amazon Web Services

DB2 High Availability and Disaster Recovery

Reducing the Cost of Disaster Recovery

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Inexpensive Disaster Recovery with HADR and Cloud Computing


Disaster Recovery is a necessity but its not always cheap Options for Disaster Recovery:
1. Set up server at a data center ($$) 2. Ship a system to a collocation vendor ($$) 3. Cloud now a viable option!
Applications

DB2s HADR is a great choice for inexpensive DR to the Cloud


Robust and easy to use Can be set up in minutes with DB2 and a Cloud Provider
DB2

Production

49

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Using Amazon EC2 Cloud as a Disaster Recovery Site Using DB2 HADR and Automatic Cloud Reroute
Automatic Client Reroute transparently transfers application connections to a standby server in the case of a primary server outage
Applications

Production

DR on Cloud

DB2

DB2

The set up can take as little as a few minutes using EC2 tools and DB2s HADR
50

The standby server can be an instance on Amazon EC2


Cloud Computing for Developers hosted by IBM and Amazon Web Services

Setting up DB2 HADR from On Premise to the Cloud


4. 5. Backup the DB and restore it on the DR Server Prepare the DR Server to be the HADR Standby

1. 2. 3.

Provision an EC2 instance for the DR site Configure a secured connection to the DR Server (e.g., VPC) Prepare the Production Server to be the HADR Primary

6. Start up HADR

Applications Production DR on Cloud

DB2

DB2

(<- VPC or ssh ->)


51 Cloud Computing for Developers hosted by IBM and Amazon Web Services

DB2 High Availability and Disaster Recover (HADR)

DEMO: REDUCING THE COST OF DISASTER RECOVERY INFRASTRUCTURE


Cloud Computing for Developers hosted by IBM and Amazon Web Services

Conclusion

DB2 offers very flexible and unique pricing that ranges from free to, pay by the hour, to use existing licenses. DB2s hybrid database approach is very unique and allows developers to choose trusted familiar technology for all Cloud Computing data persistence needs DB2 is well suited to address the very common Cloud Computing use case i.e. Development and Test Elasticity is the major reason for considering Cloud Computing and DB2 is unique in its ability to deliver an elastic database environment on the cloud:
Virtually unlimited compute capacity on demand Pay only for what you use

Cloud is a perfect solution for implementing cost effective disaster recovery sites. DB2 has both built in and partner created disaster recovery infrastructure that is unmatched in the industry
Cloud Computing for Developers hosted by IBM and Amazon Web Services

Next Steps

Explore IBM DB2 Development AMI at http://developer.amazonwebservices.com/connect/entry.jspa?ext ernalID=2840 or Build your own DB2 Express-C AMI http://www.channeldb2.com/video/db2-expressc-on-amazon-ec2 Get an account on RightScale.com and create your own application deployment using one of the DB2 templates from the partner directory. Try Ruby on Rails DB2 templates. Create a DB2 instance on the Amazon EC2 cloud and experiment with using it as a DB2 DR server Contact xkoto and evaluate using GRIDSCALE to:
create an elastic database cluster on the Amazon EC2 cloud spill over extra DB2 capacity to the Amazon EC2 cloud create DB2 DR nodes on the Amazon EC2 cloud

Cloud Computing for Developers hosted by IBM and Amazon Web Services

Thank you for attending.

Please share your feedback for todays sessions


http://survey.awslab.com

All sessions from todays Virtual Event will be posted for on-demand viewing along with supportive materials
http://www.ibm.com/developerworks/offers/cloudcomputing/

We want to continue to hear from you! Stay connected through our Cloud Computing Central Community
55 Cloud Computing for Developers hosted by IBM and Amazon Web Services

You might also like