db2university.com: Get started designing, configuring, and deploying on the cloud, Part 1

Designing for resiliency, scalability, and performance to support Moodle open source software course management

This is the first in a series of articles that show you recommended techniques to design, configure, and deploy an application on the cloud. The article provides an overview of all the different steps needed to complete a 1-year long project that included enabling Moodle software to use DB2®, to configuring it, deploying it on the Amazon Cloud, working with the Rightscale platform to manage cloud instances, setting up HADR for disaster recovery, and ensuring to meet performance requirements. Future articles in the series will go into the details. The article series also discusses how openID sign-in capabilities were implemented, and how data on the site was made accessible through Android phones. The final result is the creation of db2university.com, an online educational website. Check it out!

Share:

Raul F Chong (rfchong@ca.ibm.com), DB2 Program Manager and Technical Evangelist, IBM

Photo of author Raul ChongRaul F. Chong is a DB2 program manager in the IBM Information Management Cloud Computing Center of Competence at the IBM Toronto Laboratory. Raul is a DB2 Certified Solutions Expert in both DB2 administration and application development. He has held numerous positions at IBM since 1997, and is the lead author of the book Understanding DB2 - Learning Visually with Examples 2nd Edition (ISBN-10: 0131580183).


developerWorks Contributing author
        level

13 January 2011

Also available in Chinese Spanish

An IBM survey conducted in 2010 revealed two main technology trends by 2015.

  • Cloud computing will overtake on-premise computing as the primary way organizations acquire IT resources.
  • Mobile application development for devices such as the Apple iPad and iPhone, Android devices, and more, will surpass application development on other platforms.

Online education is another trend that gives you the ability to learn at your own pace, in the comfort of your own home, or wherever you are. Moreover, thanks to mobile devices, you can participate "on the go".

In this article you are introduced to db2university.com, an online educational website that has been implemented using Moodle open source software deployed on the Amazon Cloud, and accessible from Android-based phones.

This article is the first in a series showing you cloud computing and mobile application development at work! Using these technologies in conjunction with DB2 database server, you will see the best practices that were followed to make db2university.com a reality. At the same time, you can learn about db2university.com as the place to go for excellent quality educational material about DB2 and other technologies.

Figure 1 shows you what db2university.com looks like at the time of writing. You are encouraged to register (it's free!) and test it out for yourself.

Figure 1. db2university.com home page
shows DB2 University beta web page with welcome message and registration information

Moodle open source course management system

A vast range of materials, from videos to podcasts and eBooks are available right now on the internet for self-study. However, they are often not arranged in a way that is easily consumable, and some of the information may also be obsolete. Course management systems allow instructors to create and arrange existing materials for easy consumption. The Moodle open source course management system (CMS) is used at db2university.com.

Moodle, written in PHP, is one of the best open source CMS's in the market. Martin Dougiamas at Curtin University of Technology in Perth, Australia developed the first version in 2001. Today, there are over 52,000 registered Moodle sites, and over 950,000 registered users from more than 175 countries around the world on moodle.org.

Our journey with Moodle started late in 2009. Students at California State University, Long Beach (CSULB) were assigned, as part of one of their courses, the task to enable Moodle 1.9.6 to work with DB2 Express-C. Their contribution to the community (provided as a patch) can be found at http://moodle.org/mod/data/view.php?d=13&rid=3100&filter=1.

Early in 2010, the enablement of Moodle 2.0 was started to use DB2 Express-C. Moodle 2.0 is a major revision of the Moodle software, and has fundamental changes from the previous version in the way it interfaces with databases. At the time of writing, Moodle 2.0 Release Candidate 1 has been made available to the public. This is the version enabled to use DB2 Express-C, and the one that is running at db2university.com. When the official version of Moodle 2.0 is available, db2university.com will be updated, thereby committing its contribution to the Moodle community.

Figure 2 shows different courses available at db2university.com. You can reach this page by clicking the Learn tab in the home page, which shows the implementation of Moodle. A Moodle theme was created specifically for db2university.

Figure 2. Learn tab takes you to the Moodle implementation in db2university
Screen capture lists the available courses

Courses at db2university.com are not just about DB2. They can also be about other topics, such as PHP or Ruby on Rails. But any lesson in those courses that requires interaction with a database will use DB2. Instructors for the courses are members of the DB2 community, including university professors, professionals, IBM employees, and students.

There are two main categories for courses at the site: free courses, and paid courses. The Paypal plug-in included with Moodle is used for paid courses. Figures 3 and 4 provide more details about the course DB2 Essential Training I. This course was picked as an example of what you could do with our implementation of Moodle. Note the course has many videos, transcripts (PDF files), and links to an eBook to use as reference. Not shown in the figure are links to a course forum, web pages, assignments, and exams.

Figure 3. Contents of the DB2 Essential Training I course
Initial screen for the course shows welcome message and links to information about the course
Figure 4. Contents of the DB2 Essential Training I course (continued)
Lesson 1: What is DB2 Express-C? includes links to learning objectives, instructions, videos, and reading material

There is also a course at db2university.com that teaches you how to create other courses in Moodle that you can have hosted at db2university.com. Contact us if you would like to create and host your course at db2university.com, either as a free or paid course.

The second article in this series will discuss how Moodle 2.0 was enabled to work with DB2, as well as the setup required to make it work on the cloud.


Running on the Amazon cloud

Because db2university.com is hosted on the Amazon Cloud, it can take full advantage of cloud computing benefits, including setting up DB2 HADR for disaster recovery on the cloud. The following AWS resources are being used:

  • EC2 standard large instance (64-bit, 4 ECUs, 7.5 GB of memory, 850GB instance storage)
  • EBS volumes of 50 GB size
  • S3 buckets of 3 and 1 GB size
  • CloudFront

Three EC2 instances in the US-East region have been provisioned. One of them is used to run the Moodle application and the web server, and another one to run the DB2 database server (DB2 HADR primary server). The DB2 HADR stand-by server uses a third EC2 instance in a different availability zone within the US-East region as the disaster recovery site.

Instance storage is used, with S3 and EBS volumes, as shown in Figure 5.

Figure 5. DB2 storage on the Amazon Cloud
Diagram shows EC2 instance with instance storage. S3 storage includes backup images, log archives, and EBS volume snapshots

Figure 5 also shows the following:

  • EBS volumes are used to store DB2 data and DB2 recovery logs, currently at 50GB, but RAID may be considered for future needs.
  • A different small EBS volume of 2GB is used to store the DB2 code and the DB2 configuration files.
  • Instance storage is used to temporarily store DB2 backup images, but these backups will be moved to S3 for longer retention period.
  • S3 storage is used for storing backup images and log archives for long retention periods. EBS volume snapshots are taken often, and they are stored in S3.
  • AWS CloudFront is used to allow users to download course videos and materials from an Amazon "edge" server that is closer to the location where the user lives. The files to download are first copied to a S3 bucket, and are later replicated to the edge servers.

In terms of software, this is the setup used:

  • Ubuntu Linux 10.04.1 LTS
  • DB2 Express 9.7.2 for Linux 64-bit
  • Moodle 2.0 Release Candidate 1
  • PHP 5.3.3

DB2 Express is used, as opposed to DB2 Express-C, because the DB2 HADR feature is being used, which is only available starting with the DB2 Express edition.

RightScale is ideal to manage AWS resources because it is a partner of IBM, and its software gives the ability to build environments quickly using templates and scripts.

The second article in this series will describe this setup in more detail.


Enabling openID sign-in

Research shows that people landing on a web page with a complicated or long registration process tend to walk away from the site quickly. To ensure that users stay and register to db2university.com, openID sign-in is enabled. This means that people who already have a Facebook, Google, Yahoo, ChannelDB2, and other provider accounts need not enter their registration information; db2university instead asks those providers, with your consent, to share the information, as shown in Figure 6.

Figure 6. OpenID sign-in process
shows sign-in pop-up screen where reader can choose channelDB2, Gmail, Yahoo, or Facebook

Click the Login button. A window shows you two ways to sign in.

  1. On the left side you can use your DB2 University user name and password, assuming you previously signed up to the site.
  2. Alternatively, as shown on the right side of the pop-up window, you can sign in using any of the different openID providers supported, such as ChannelDB2, Gmail, Yahoo, or Facebook. When you select one of the providers, the first time you go through this process you will get another page from your provider asking for your consent to share information between the sites. If you accept, the information is shared, and you will be automatically registered to db2university.

After this initial process, every time you want to log on to db2university.com you follow the same steps, but clicking on the provider button will automatically log you on to DB2 University.

The third article in this series will explain in detail how the enablement of the openID providers was done.

Using an Android-based phone to retrieve course marks

Moodle allows students to see their marks for assignments and exams on the web; however, using App Inventor, a mobile application was also developed to allow access using Android-based phones. The App Inventor is an easy to use application, as shown in Figure 7.

Figure 7. Use App Inventor for Android application to access db2university
4 panaes shows access code, my courses, a selected course, and assignments associated with that course

First you need to input a mobile access code, a unique keyword that you can obtain from your profile in Moodle. Next, you can choose the course you took or are currently taking, and display all your marks.

In order for this application to work, coding is required on the client side using App Inventor, and on the server side using a web service created with Ruby/Sinatra.

The fourth article in this series explains the details of this Android application.


Summary

This article introduced db2university.com, an online educational website running Moodle open source software, enabled to use DB2 on the Amazon Cloud. The article also introduced some of its features, and provided an overview of recommended methods to design, configure, and deploy an application on the cloud. More articles in this series will delve into the details of each of the sections presented in this article.

Resources

Learn

Get products and technologies

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Information management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management, Cloud computing
ArticleID=607304
ArticleTitle=db2university.com: Get started designing, configuring, and deploying on the cloud, Part 1
publish-date=01132011