Wednesday, March 5, 2008

MySQL - An IT Tipping Point

A ''tipping point'' is a concept, product or idea that becomes a hot commodity that attracts everyone's attention, interest or inspiration. There are always specific reasons and factors that are not easily identifiable why one product becomes a tipping point and others do not. Products not considered a tipping point usually never become a tipping point and ofter never understand why they didn't. There are tons of examples of this. VHS versus Beta, MP3 players versus iPods, Blue Ray versus HD DVD. The list is endless.

MySQL is "the" hot tipping point product in the IT industry. MySQL is an incredibly popular open source part of the LAMP stack. There are additional open source products like PostgreSQL, MaxDB, Firebird, Ingres, Apache Derby, etc. No database in the industry is creating the buzz, excitement and interest that MySQL does. People can debate the feature/functionality, performance, etc. between the different databases. Make any comparison you want, none of the other databases that are compared to MySQL are going to be the "tipping point" MySQL is.

MySQL is a very unique organization with employees that believe in disrupting the industry with innovativeness and new ways of doing things. MySQL employees have been raised with the concept of open source, sharing and caring about their contributions to open source. I do not believe their are many companies in the world that have the "global team" concept that MySQL does. I interact with MySQL team members in Sweden and Germany as easily as team members in my home city. It is the uniqueness of the MySQL employees that are creating the tipping point.

Web 2.0 environments are increasing exponentially in popularity and MySQL is in the center of the storm of this exciting growth. MySQL has the potential to be the center of innovativeness in Sun the way NeXT was the center of innovation in Apple. Sun has a very powerful engine for future growth in MySQL. There is one thing MySQL has that no other database has. It has the tipping point.


Installing MySQL Administrator on Linux

Installing the MySQL GUI tools are pretty easy on Linux (Fedora - 2.6.18-1.2798.fc6) but there are a few prerequisites for setting them up. The following listed RPMs are required. I did a google search and then performed a quick download of them.
  • libsigc++20-2.0.6-1.i386.rpm
  • glibmm-2.4.7-1.rhfc3.nr.i386.rpm
  • gtkmm24-2.8.5-1.i386.rpm
Load the RPMs. MySQL Administor is loaded in /usr/bin by default.
# rpm -i libsigc++20-2.0.6-1.i386.rpm
# rpm -i glibmm-2.4.7-1.rhfc3.nr.i386.rpm
# rpm -i gtkmm24-2.8.5-1.i386.rpm
# rpm mysql-gui-tools-5.0r12-1fc5.i386.rpm
# rpm mysql-administrator-5.0r12-1fc5.i386.rpm

Go to the Desktop Applications Menu and select the Programming Tab. You will see the MySQL Administor Icon. Select this icon and it will startup up MySQL Administrator in a windows environment. Then have fun! :)

Sunday, March 2, 2008

MySQL Priority Poll

This poll did not get a lot of voters but I thought I would post the results to show you the priority of the individuals that did vote.

Poll: What is your highest priority with MySQL?
  • Performance Tuning 20%
  • Backup and Recovery 20%
  • Monitoring and Management 16 %
  • High Availability 16%
  • Scalability 12%
  • Storage 10%
  • BI and Reporting 3%
  • Business Strategy 3%

Choosing a MySQL Configuration Strategy

MySQL configurations cover the range from developers installing a simple MySQL database for a LAMP application to the largest Internet companies using MySQL to deliver web content.
There are two different profiles that cover this range for installing, configuring and managing MySQL database servers:
  1. Profile 1: Individuals or small organizations that wants to use MySQL to create a simple database for web applications and the LAMP stack.
  2. Profile 2: Individuals or organizations that are looking at creating larger MySQL databases or may be creating a large number of MySQL databases.
Profile 1:
For this profile, the person can be a non-DBA. This profile can use the default install using the Windows Installation Manager or the Unix or Linux RPMs. The GUI interfaces will take you through a very simple install. MySQL database servers do not take a lot of resources to run. The template files (my.small, my.medium, my.large) can show startup files that contain larger configurations. This is a simple environment to install and manage. I have seen non-DBAs and developers use this environment for years and it works great for them.

This type of DBA is typically using some simple GUI interfaces, doing backups with mysqldump and taking a simple approach for managing MySQL databases. MySQL's basic configuration can make it very popular for the small and medium sized organization.

Profile2:
This profile involves more complex and larger MySQL databases. This environment often benefits from installing and configuring using best practices. This environment is more successful with someone that has DBA experience or training. Implementing a MySQL environment with the MySQL Optimal Configuration Architecture (MOCA) where a DBA organizes a database for performance, high availability, ease of management becomes important for this environment being successful.

Dependent on the size and complexity of the MySQL environment, the DBA for this environment may be more concerned with one or more of these areas:
  • How the MySQL servers will be monitored and managed. Using the MySQL Enterprise Monitor, open source monitors or 3rd party monitors becomes important.
  • What backup strategy to use: Snapshots, InnoDB Hot Backup, Replication, etc.
  • High Availability (MySQL cluster, other clustering strategies).
  • How to balance I/O by spreading data across multiple disks, storage arrays, etc.
  • Performance Tuning.
  • The establishment of database standards, guidelines and best practices (MOCA).
  • Change control.
  • Having to much coffee.
  • Managing test, development and production databases. Developing rollout strategies.
  • Security, auditing, Sarbanes-Oxley, COBIT, ITIL.
  • Information Lifecycle Management
These two profiles show two ends of the spectrum for MySQL database administration.



Friday, February 29, 2008

Best Environments for Running MySQL

Its interesting when you look at MySQL database environments. Extremely popular in the MySQL world is to use commodity hardware and implement the LAMP stack.  Smaller projects and startup companies love this environment.  A simple example, a company needs to set up a web application, they buy some commodity hardware, set up replication and scale horizontally.  Everybody loves this and it works great.

This environment requires floor space, cooling, electrical outlets, etc.  As new MySQL database servers get built, the environment needs to consider how this database environment will scale.  Organizations may take a step back and start looking at scaling with blade servers or large host systems to run large numbers of MySQL databases.

Database servers are I/O intensive.  Growing with cheap disks does not always scale with systems that have large I/O requirements.  Striping and mirroring starts to become more important.  So storage scalability and more expensive storage solutions become a consideration as I/O increases.

It will be interesting as Sun leads MySQL into more enterprise environments how the hardware and scalability strategies will evolve.

Thursday, February 28, 2008

Learning MySQL DBA Best Practices

It is a challenge for new MySQL DBAs to learn best practices for managing database servers. There are no books that teach you everything you need to know. Key knowledge areas new MySQL DBAs need to learn:
  • Best practices for installation and configuration.
  • How to monitor and manage a database.
  • How to monitor for tuning.
  • Best practices for backup/recovery.
  • Best security practices.
  • What audit controls need to be put in place.
  • Disaster planning.
  • Growth projections and scalability planning.
  • Change management.
Sources I would recommend a new DBA start with:
  • Google - do searches on best DBA practices, etc.
  • Read information on the MySQL Optimal Configuration Architecture (MOCA) and the Optimal Flexible Architecture (OFA - Oracle related). Both give examples of things to consider when planning databases.
  • Go to conferences and download presentations from previous conferences.
  • Find a mentor.
  • Larger environments look at Sarbanes-Oxley, COBIT and ITIL in terms of best practices for managing IT infrastructures. Waters get deep here for new DBAs.
  • http://www.planetmysql.org

Tuesday, February 19, 2008

Maximize your ROI at the MySQL Conference

The MySQL conference is coming up. It's one of highest ROIs you can get for your training dollar. Just like anything else you do that is successful, plan on how you can maximize your attendance at a conference.

If you don't attend conferences on a regular basis here are a few things you can do to maximize your experience:
  1. Volunteer! Best way to meet new people and feel a part of the conference.
  2. Join! There are often Special Interest Groups (SIGs) or other groups within a conference that try to bring people with common interests together.
  3. Introduce yourself! Try to meet as many people as you can at the conference. Challenge yourself to meet as many people as you can as possible. Ask them questions like: What's the best presentation you've attended so far? Are there any speakers you really like and would recommend to someone new to a conference attend? What area are you focusing on at the conference? A conference is the best way to work on your communication and networking skills. Buy a book on networking and try some of the techniques. If you are new to the conference no one knows you, what do you have to lose? Ask them about what environments they are running? What challenges are they having with their technology?
  4. Attend get togethers! Every conference has breakfast, unconference and birds of a feather meetings and other ways to network. If one doesn't work out, don't get discouraged. Remember you don't know anyone there how can you make a mistake.
  5. Business cards. Bring business cards and everyone you meet give them a business card. Who knows, someone might even give you there card. :)
  6. Prepare! Get organized. There are tons of great books, blogs, and Internet information on 10 ten tips for introducing yourself, networking and socializing. Try them.
  7. Submit! Submit a presentation. Awesome way to expand your comfort level and for people to get to know you. Most important thing people want at a conference is to learn from other people's experiences. You don't have to be a top expert. Do not underestimate what you have to say?
I consider myself a pretty social person. However, I remember when I first starting going to conferences it was pretty lonely. I wasn't comfortable walking up and talking to people. The first birds of a feather meeting I went to, I walked in the door, everybody looked up at me, I froze and I walked out. I realized I was too shy but was too embarrassed to walk back in. It can get really lonely if it seems everybody else knows each other.

Since then I have ran different areas of a conference, been on expert panels, given key note presentations and been on board of directors for conferences. All of these things occurred because I was willing to push myself past my comfort zone and began to submit papers for presenting and to join different groups at conferences.

Networking is always rated first or second in terms of benefits for people that attend conferences. If you would like to increase your networking skills I would recommend you read the book "Million Dollar Networking" by Andrea Nierenberg. This will give you a lot of great ideas, recommendations and things to say to greatly increase your networking skills. You are going to spend thousands of dollars to attend the conference, why not spend another $30 and maximize the networking you can do.

Everybody attending a conference has been in your shoes. Go introduce yourself to volunteers or speakers. Ask them about ways to maximize the time at the conference and what speakers they like to see. All volunteers I guarantee you want you to have fun and enjoy the conference and they know what its like to go to a conference for the first time. Most importantly, find out if any MySQL instructors are around, they are some of the coolest, most enjoyable and high energetic people you'll find at the conference. :)

Monday, February 18, 2008

The Right Strategy for Customers

There have been significant trends and changes in the IT industry. Some of them include:
  • Main Frame systems
  • Client/Server
  • Distributed systems
  • Multi-tiered platforms with application servers
  • Open Source
It's important to understand each of these is a technology to help meet business goals. Open source is currently an area of high growth and interest in the industry. The cost benefits provide organizations with a lot of flexibility in how they put their infrastructures together. Global markets and competition are putting even more pressure on IT organizations to make the right decisions.

I was talking to a friend about what organizations are doing with open source strategies. The result of the conversation ended with it is not about an open source strategy. It is more about developing the "right customer strategy" and if and how open source can play a role in helping a customer meet their business objectives and goals.

I've always felt as a DBA/manager, the more options I have the better decisions I can make. Including open source solutions in the decision process helps make sure customers are looking at their overall strategy in addressing challenges they are facing. No one technology solution is the best solution for every problem that exists. Oracle Enterprise Edition, Oracle Standard Edition, Oracle Express, MySQL, Oracle Application Server, Apache, JBoss, BEA, Eclipse, JDeveloper, Linux, PHP, Ruby on Rails, etc. all have features that can leverage what customers are trying to do. I have nothing against Windows or IBM it has just been my preference to work with Oracle and MySQL environments. Oracle and BEA have played well in the large enterprise commercial environments. MySQL has played well in Internet and web applications. For anyone to say other vendors do not provide a good solution is pretty closed minded. What I like to do is understand what a customer is trying to do and weigh the pros and cons and let them make the decision that is best for customer.

Most companies are running different types of applications.
  • Java and SOA are extremely scalable and powerful solutions that are great when those benefits are needed.
  • Ruby on Rails and PHP are great for web based applications that do not need a lot of database features.
There are current and future costs and ramifications associated with hardware, database, application server and application development decisions. With all the options out there customers need to make sure they align their purchases with their business objectives.

Trends for DBAs

I grew up in the old days when the primary tools used to manage databases was Unix shells scripts and my development tool was vi. This was back in the day when if you showed other DBAs a script for monitoring and tuning, they would respond to it the way cavemen would look at fire. Those days are long gone.

Whether it is open source, vendor or 3rd party tools DBAs need to use software to help them manage their environments. Whatever the tool: Nagios, Mon, Zenoss, Cacti, MySQL Enterprise Monitor, etc. it is important to use tools to manage a database environment. In the monitoring and management side this includes the entire infrastructure which includes the application server and applications environment. As a DBA it is very important to be in a proactive environment where the administration infrastructure is scalable as more database instances and database schemas are added to the environment. The negative ramifications of using scripts and not software to monitor and manage a database environment include:
  • The more manual scripts (Unix, Perl, etc.) the more you are building a high maintenance environment that has to be supported.
  • As your environment changes with different software, application servers, applications, etc the more the scripts need to be modified.
  • New DBAs usually will not want to bet their jobs on someone else's scripts. Working scripts often get thrown away by new DBAs which will replace existing scripts with their own scripts.
  • Manual scripts are not as scalable as using software.
  • Using manual scripts are not cost-effective compared to using software for monitoring and management.
  • Manual scripts are more error-prone than using software.
  • Manual script environments are usually more reactive versus proactive. Reactive environments are not conducive to high availability.
Companies are looking more for DBAs that can help make strategic decisions, understand the business, have strong communication and management skills and understand how to manage databases from an enterprise perspective. This is different that the traditional heads down, perform technical tasks and write scripts type of DBA.

Sunday, February 17, 2008

Leveraging MySQL Environments for Scalability

One of the biggest mistakes organizations make when they look at MySQL, they look at just the MySQL Database Server. There are a lot of tools available in MySQL environments that can offer tremendous scalability to MySQL database servers while keeping the total cost of ownership down. Some of my favorites include:
  • Memcache - Memcache is a high performance distributed caching system. This offers tremendous benefits to dynamic web appliations. This caching system can take large loads off the database server and distribute across low-cost servers with a global cache. Most large scale MySQL database environments use memcache.
  • Replication - MySQL replication supports the distribution of MySQL across multiple low cost servers. Replication can be implemented with no additional license fees.
  • LAMP - Linux, Apache, MySQL, PHP/Perl/Python (LAMP) is a low cost proven platform for implementing web applications.
  • Monitoring - Nagios, Mon, Zenoss and Cacti are excellent monitoring tools for MySQL database environments. Zabbix is a product I have not looked at but their website information on their product definitely got my attention. The MySQL Enterprise Monitor is a licensable product but it can be used at a fraction of the cost of other database vendor monitoring tools and 3rd party solutions.


MySQL Migration Toolkit








The MySQL Migration Toolkit is a nice easy to use Wizard GUI tool for migrating databases to MySQL. The following site http://www.mysql.com/products/tools/migration-toolkit/ has some really nice tutorials for how to migrate the following databases to MySQL:
  • SQL Server
  • Oracle
  • Access
The MySQL Migration Toolkit will facilitate the migration of the following database schema objects:
  • Tables
  • Indexes
  • Views
  • Assists with Stored Procedure Migration
  • Assists with Trigger Migration
Some features that stand out about the MySQL Migration Toolkit:
  • The MySQL Migration Toolkit allows direct server to server migration. The migration tookkit can run remotely.
  • Data can be transfered online or a snapshot of the data can be stored for executing a transfer offline at a later time. A backup can be created of the stored data as well.
Migrating Access to MySQL
MySQL is an excellent migration strategy for organizations using Access. Migrating to MySQL provides the following benefits to existing Access environments:
  • Extremely low startup costs.
  • Ability to leverage the LAMP stack and Web 2.0.
  • Portability to major releases of Linux, Unix and Mac OS platforms.
  • Increased operational flexibility from a closed proprietary environment to open source.
  • Significantly increased scalability.
Migrating SQL Server to MySQL
MySQL is an excellent migration strategy for organizations using SQL Server. Migrating to MySQL provides the following benefits to existing SQL Server environments:
  • Extremely low startup costs.
  • Ability to leverage the LAMP stack and Web 2.0.
  • Portability to major releases of Linux, Unix and Mac OS platforms.
  • Increased operational flexibility from a closed proprietary environment to open source.
  • Relatively low cost increased scalability compared to SQL Server scalability costs.
Oracle and MySQL Environments
I believe Oracle and MySQL play well together more than any other two RDBMS systems.
  • MySQL does well in the small and medium database range and supports the LAMP stack and Web 2.0.
  • For web applications that do not leverage a lot of database features. Using MySQL at the lower end can greatly reduce the total cost of ownership.
  • Oracle and MySQL can play very well together to maximize what a customer needs to do while minimizing cost.
  • Oracle offers tremendous scalability and an incredible amount of features to address complex problems in large organizations.
  • MySQL offers relatively low cost increased scalability compared to Oracle scalability costs. No costs associated with using partitioning and replication. MySQL Cluster is a fraction of the cost of running Oracle RAC.

Saturday, February 16, 2008

MySQL and Oracle Parallels

When I look at the current and future releases of MySQL I see a lot of parallels to Oracle releases. Although MySQL and Oracle have taken different approaches there is a thread of commonality.
  • MySQL 4 and Oracle 6 releases were acceptable releases for their time but their features limited the software from having a larger impact in the database market. I always joke that Oracle Version 6 made Sybase and Oracle 7 along with Sybase 10 helped destroy Sybase.
  • MySQL 5 and Oracle 7 took the database releases so they could take new large steps in the database market.
  • MySQL 6 and Oracle 8 are releases that take the database software for each company to gigantic new levels in terms of scalability and the ability to handle significantly larger systems. In terms of performance, high availability and reduces administration.
I believe the future of MySQL with version 5 and the upcoming version 6 is very bright.

MySQL in the Enterprise

In the last few months MySQL has taken serious steps to have it play a larger role in the enterprise. For MySQL to take the next steps the following needs to occur on the technology side:
  • Help customers understand the scalability of MySQL.
  • MySQL needs to expand in the small to medium size data warehouse market. MySQL excels on delivering large volumes of Internet content at high speed. High read rates are what you need to make a data warehouse work. Using MySQL replication, organizations can scale horizontally at inexpensive incremental rates.
  • MySQL needs an inexpensive striping and mirroring storage strategy to help organizations that can't afford an expensive EMC or Veritas solution. Hmmm, I wonder if there is a company out there who could help MySQL's storage strategy? :-)
  • Organizations need to realize there are commercial open source solutions like Pentaho that can deliver business solutions, BI and reporting capabilities in the small and medium sized database environments. There are open source commercial solutions that can help MySQL environments deliver medium sized enterprise solutions. Saving 6 and 7 figures on licensing of software can provide a lot of flexibility in terms of hardware and software options.
  • Organizations new to MySQL need a better understanding of how OS snapshots and InnoDB Hot Backup can be used to provide hot backups in OLTP environments.
  • More MySQL DBAs that have an enterprise perspective. Oracle DBAs are the perfect source. Too many organizations look at MySQL and do not understand how to set it up properly to leverage what it can do.
  • Organizations like Google, Yahoo, YouTube, Flicker, etc. know how to build highly scalable MySQL environments. Products like Memcache can greatly benefit MySQL scalability. Scaling MySQL is still a skill not known to a lot of companies.
  • MySQL and industry analysts need more bench marks on exactly where MySQL reaches it's limit on the OLTP side. The knowledgeable industry expert understands MySQL has proven to deliver high read rates. For customers to feel comfortable using MySQL in more OLTP environments, customers need to understand where MySQL tops out on the OLTP side.

Pentaho's Bee

Has anyone else been mesmerized by looking at the bee on Pentaho's website. Something about that bee is pretty interesting. I wish they'd take it further and create a screen saver where you can configure multiple bees on your desktop. I'm not even a bee fan.

Oracle and MySQL - A winning team

Oracle is definitely the Mercedes Benz of database servers. We can debate the merits of different databases but in terms of the most features, Oracle definitely stands alone. Excellent high availability features such as RAC, Data Guard and Streams offer excellent enterprise solutions. So for running enterprise business applications such as PeopleSoft, JD Edwards, Siebel and the Oracle EBusiness Suite the Oracle Database Server is in a class by itself.

When you look at all the applications running in an organization, what percentage are enterprise class applications that require an Oracle database server. I would say the major percentage of applications running in an organization do not need an enterprise database server like Oracle. This is where MySQL plays nice. Heterogeneous environments running Oracle and MySQL will run at a fraction of the costs of running Oracle-SQL Server, Oracle -DB2 or SQL Server-DB2. Also MySQL being a friendly open source company does not bring in the religious issues Oracle DBAs would have with SQL Server or DB2. Some examples of how Oracle and MySQL would be a cost effective solution:
  • Greatly reduced software costs. For example backup and recovery is free in Oracle (Recovery Manager - RMAN). In a heterogeneous environment, a company can buy a great online backup solution such as InnoDB Hot Backup that is roughly $1000 per server. If running Oracle with SQL Server or DB2 the 3rd party backup solutions or vendor add-ons can easily run into six figures.
  • If an organization has already purchased Oracle Grid Control it would be very easy to have Oracle Grid Control monitor MySQL database servers.
  • Oracle SQL Developer could easily support MySQL database environments. Someone told me they got Oracle's SQL Developer to hook into MySQL easily. I'll have to try and find time to test this.
  • Oracle JDeveloper can deploy into JBoss environments and other open source application servers.
  • Oracle's stored procedure language PL/SQL is very close in syntax to MySQL's stored routine language. You could easily write a parser in Perl that would address most of the syntax differences.
If I could ask Larry one question it would be if he regrets not trying to go after MySQL. I wonder if the Oracle acquisition team was so focused on the business applications market they did not look into the database market as closely as they should have. If Oracle had purchased MySQL could a strategy have been developed to use MySQL to keep SQL Server out of the lower end database market. Would the purchase price of MySQL have generated a significant ROI to justify the purchase by being able to help keep SQL Server out of Oracle's lower end market? Hmmm. Too bad, I guess we'll never know.

Understanding the Total Cost of Ownership for Databases















Vendors often talk about the Total Cost of Ownership (TCO). A MySQL environment offers significantly reduced overall costs and greatly reducing the total cost of ownership. When purchasing a database companies look at the license numbers of the database but often underestimate the surrounding costs of running a particular database. Overall TCO also includes the following costs:
  • Hardware
  • Application Servers
  • GUI development tools
  • Monitoring tools
  • Administration costs
  • 3rd party software
  • Technical skills
  • Scalability
MySQL offers a TCO that is a fraction of other database vendors. The following are some examples of how the costs of running a MySQL environment are significantly reduced:
  • Hardware: MySQL database servers take significantly less hardware resources compared to Oracle DB2 or SQL Server. There is also more flexibility in choosing Windows, Linux, Unix or Mac OS platforms.
  • Application Servers: MySQL environments usually use Apache or JBoss run at a fraction of the costs of running application servers from IBM, Oracle, BEA and Microsoft.
  • Monitoring Tools: MySQL environments use tools like Nagios, Mon, Zenoss, Cacti are free or a fraction of the costs compared to vendor or 3rd party tools that often have licenses in the 6 and 7 figure range.
  • GUI Development Tools: MySQL environments often run SQLYog, Navicat, MySQL Query Browser that are free or run at a fraction of the cost of 3rd party tools for the larger database vendors.
  • GUI Admin Tools: MySQL Administrator, phpMyAdmin and Enterprise Monitor are free or run at a fraction of the cost of 3rd party tools for the larger database vendors.
  • BI and Reporting: BI Open Source tools from companies like Pentaho run at a fraction of the costs of BI solutions from the major vendors.
  • Scalability: Features like partitioning and replication are free in MySQL. So as your environment grows there are no additional license costs. MySQL Cluster is a licensable feature but it also is a fraction of the clustering solutions from the larger database vendors. Database servers are going to grow, so its great to know that a MySQL environment allows you to use free features or features that do not have large incremental increases the larger your databases grow.
When looking at a database vendor make sure and consider the overall Total Cost of Ownership and not just the costs of running a database server.

Database Market Share


Mark Twain once said, "Figures often beguile me, particularly when I have the arranging of them myself; in which case the remark attributed to Disraeli would often apply with justice and force: "There are three kinds of lies: lies, damned lies and statistics."



Whenever I look at statistics and numbers I not only take them with a grain of salt but I also try to understand how they arrived at the numbers. When you look at the analyst's reports on the top database vendors it is often based on total revenue or licensable revenue. So how does open source numbers come into play. The same industry analyst's that show MySQL as having very small market share based on revenue also state estimates of between 8 - 10 million MySQL instances are currently running. Analysts also estimate MySQL binaries are downloaded 40 - 50 thousand times a day.

MySQL is encountering incredible growth but the growth is often hidden in the way numbers are collected. There is a lot of momentum and energy around open source, it will be interesting to see how the industry analysts use numbers to track this growth.

Friday, February 15, 2008

George Trujillo at RMOUG Oracle Conference in Denver

I attended the RMOUG Oracle Users Conference in Denver, CO this week. RMOUG is an excellent local Oracle users group conference to attend. I delivered a presentation on:

Understanding the MySQL Architecture for Oracle DBAs
  • This is a fast paced presentation focused on showing Oracle DBAs and Developers key features and benefits of using MySQL and the LAMP stack for projects. Topics will focus on: best practices for configuring a MySQL database server, understanding key differences between Oracle and MySQL and OFA versus MOCA. Attendees will also be introduced to MySQL replication and Cluster configurations. This is an excellent bootstrap presentation for developers and DBAs that may be looking at using MySQL and the LAMP stack for future projects.
  • Audience: Developers and DBAs
  • Summary: A bootstrap presentation focused on showing Oracle DBAs and developers key features of MySQL and the LAMP stack.
I delivered it entirely from an Oracle perspective, using Oracle examples and it was very well received. I love delivering this presentation because I always get some great comments from Oracle DBAs who are really surprised how much MySQL can do. I show them MySQL replication and I alway get at least a couple of wows.

I also delivered the following presentation:

Demystifying Middleware Technologies
  • This presentation is designed to demystify popular Middleware technologies and explain how these technology components work together. Topics include: J2EE, Application Servers, Web Services, XML, Application Frameworks, WSDL, BPEL, SOA and business rule engines. Attendees will learn how each of these different Middleware components work together in application servers. This is an important presentation for developers and DBAs who would like to learn more about the middle-tier.
I'm very comfortable in the Java and SOA world so I had a lot of fun with this presentation. Not sure why, I delivered the first presentation with energy and fire and the second presentation as a fire side chat. It may have been due to the high octane coffee I had at the coffee stand in the Colorado Convention center. :)

Wednesday, January 30, 2008

Partitioning a Powerful Tool for DBAs

Partitioning tables and indexes in a database is one of the most powerful features that can help the performance and manageability of a database with large tables. With a large database, there are usually only a handful of very large tables. These large tables typically get most of the I/O activity and have the biggest impact on performance and management.

Partitioning tables and indexes breaks a big problem (large tables) into a number of smaller manageable pieces (table partitions). When a table is partitioned, it is broken into separate physical chunks of data (partitions). For example, there is a large sales table with 10 million records. When generating a monthly or quarterly report, enough records are accessed so an index scan is not efficient, so a full table scan has to be performed. So every month more records get added to the table and every month the monthly report takes longer to run because it is generating a full table scan to go through the data.

An example of how partitioning can have an impact: a sales table can be divided into partitions (i.e. monthly increments) based on the sales date (partition key). So one table partition will have January's data, another partition can have February's data and so on. When a monthly report is generated, an I/O scan will occur on one month of data instead of the entire table. The table partitioning is transparent to the applications. While processing the SQL statement, the optimizer understands the table is partitioned and checks to see if individual partitions can be scanned instead of the entire table.

Partition Pruning
Partition pruning allows a query to run on specific partitions instead of an entire table. Leveraging this benefit requires understanding the data and how the data is accessed to determine the best partitioning method and what column(s) should be the partition key. The partition key is the column(s) used to divide the data into separate partitions. Sufficient time needs to be spent determining the correct column(s) to define as the partition key and defining the correct partition type for the table.

Partitioning offers a number of advantages:
  • Partition pruning allows I/O to be performed on smaller data sets instead of the entire table. As tables grow larger, it can be a big advantage to perform partition scans.
  • Being able to perform administration operations at the partition level versus the table level. This can decrease maintenance times and improve availability.
  • Partitioning is transparent at the application level. Applications (SQL and stored procedure code) will not be impacted by going to a partitioning solution. The optimizer will consider partition pruning (selecting individual partitions) during the optimization phase of processing a SQL command if the partition key column(s) is used in the WHERE clause.
  • Supports information lifecycle management so as data gets older it can be truncated or deleted in older partitions and not impact the more current partitions.
  • Partitioning on indexes breaks one big index into smaller indexes which can significantly reduce I/O on the indexes.
Some examples of using partitioning:
Here are two examples where partitioning can have a positive impact.
  1. A key transaction table is expected to grow by 30% over the next year. It may not be acceptable for the I/O performance to decrease as more data is added to a table. Being able to internally break a table into separate chunks of data that contain data for an individual month or region can offer significant advantages. Monthly reports or regional reports can perform partition scans on specific months or regions and not have to perform full table scans.
  2. A table needs to store data for 13 months. Every month when the oldest partition expires it can be truncated instead of going through and deleting all the old records that have expired.
Different types of partitioning
Range or list partitioning is good to use when there are recognized patterns for how the data is accessed or organizing the data into defined data sets makes sense from an administration perspective. Hash and key partitioning is good to use when someone is just as likely to access one record as another or there is not a clear recognized way to divide the data but there are so many records in a table the benefits of partitioning can be leveraged.
* RANGE
* LIST
* HASH
* KEY
* Composite partitioning- RANGE AND LIST partitions can be sub-partitioned by HASH or KEY.
- RANGE-HASH
- RANGE-KEY
- LIST-HASH
- LIST-KEY

Code examples:
In this example, we have selected the sdate column as the partition key. The table will be broken into separate data chunks (partitions) based on the VALUES LESS THAN clause. Here we have stated that all data before January 1, 2008 will go in the first partition. Partition ranges are not inclusive. Which means Partition Jan2008 will store records where the sdate value is 2008-01-01 or greater and less than 2008-02-01. For 2008 the data is broken into monthly increments. The partition key is defined by the columns listed in the partition clause. The values in the partition key columns determine which partitions the records will be put in.

Range Example:
Range partition example has one partition for dates before 2008 and monthly partitions after that. The MAXVALUE keyword will accept any records with a sales date that is 2008-04-01 or greater. Once we get into May, a new partition for the new month can be created.
CREATE TABLE sales (
invoice_id INT NOT NULL AUTO_INCREMENT,
sdate DATE NOT NULL,
samt DECIMAL (10,2) UNSIGNED NOT NULL,
region_id INT (3),
cust_id INT,
INDEX ( invoice_id),
INDEX ( sdate) ) ENGINE=innodb
PARTITION BY RANGE (to_days(sdate)) (
PARTITION before2008 VALUES LESS THAN (to_days('2008-01-01')) ,
PARTITION Jan2008 VALUES LESS THAN (to_days('2008-02-01')) ,
PARTITION Feb2008 VALUES LESS THAN (to_days('2008-03-01')) ,
PARTITION Mar2008 VALUES LESS THAN (to_days('2008-04-01')) ,
PARTITION plast VALUES LESS THAN MAXVALUE );

List Example:
List partition example partitions based on the region_id column. The value for the region_id will determine which partition the data goes into.
CREATE TABLE sales (
invoice_id INT NOT NULL AUTO_INCREMENT,
sdate DATE NOT NULL,
samt DECIMAL (10,2) UNSIGNED NOT NULL,
region_id INT (3),
cust_id INT,
INDEX ( invoice_id),
INDEX ( region_id) ) ENGINE=myisam
PARTITION BY LIST (region_id) (
PARTITION North VALUES IN (1, 2, 5, 6),
PARTITION South VALUES IN (7,8,15,16 ),
PARTITION West VALUES IN (20, 21, 22, 23, 24),
PARTITION East VALUES IN (30, 31, 32, 34, 35) );

Hash example:
Hash table example generates 16 partitions that will be used to try and evenly divide the data. Hash partitioning uses the modulus operator to distribute the data.
CREATE TABLE download(
id INT NOT NULL,
pname VARCHAR(60),
ddate DATE NOT NULL,
pcode INT,
region_id INT ) ENGINE=myisam
PARTITION BY HASH(region_id)
PARTITIONS 16;

Key partition example:
Key table table breaks the data into 16 partitions. With key partitioning, the MySQL server will use an internal algorithm to try to evenly distribute the data.
CREATE TABLE download(
id INT NOT NULL,
pname VARCHAR(60),
ddate DATE NOT NULL,
pcode INT,
region_id INT ) ENGINE=innodb
PARTITION BY KEY (id)
PARTITIONS 16;

Composite Partitioning
If the number of records that go into a range or list partition are still too too big, then a composite partitioning can be performed. Range or list partitioned tables can have a lower level of partitioning performed. This is called sub partitioning.

RANGE-HASH partitioning
This RANGE-HASH partitioning will have four has subpartitions for every range.
CREATE TABLE sales (
invoice_id INT NOT NULL AUTO_INCREMENT,
sdate DATE NOT NULL,
samt DECIMAL (10,2) UNSIGNED NOT NULL,
region_id INT (3),
cust_id INT,
INDEX ( invoice_id),
INDEX ( sdate) ) ENGINE=innodb
PARTITION BY RANGE (to_days(sdate))
SUBPARTITION BY HASH( region_id)
SUBPARTITIONS 4(
PARTITION before2008 VALUES LESS THAN (to_days('2008-01-01')) ,
PARTITION Jan2008 VALUES LESS THAN (to_days('2008-02-01')) ,
PARTITION Feb2008 VALUES LESS THAN (to_days('2008-03-01')) ,
PARTITION Mar2008 VALUES LESS THAN (to_days('2008-04-01')) ,
PARTITION plast VALUES LESS THAN MAXVALUE );

This RANGE-HASH partition table defines the number of subpartitions to be defined for each range. Different numbers of subpartitions can be defined when different months can have different volumes of sales. So it may be necesssary for some some ranges to have a larger or smaller number of partitions.

CREATE TABLE sales (
invoice_id INT NOT NULL AUTO_INCREMENT,
sdate DATE NOT NULL,
samt DECIMAL (10,2) UNSIGNED NOT NULL,
region_id INT (3),
cust_id INT,
INDEX ( invoice_id),
INDEX ( sdate) ) ENGINE=innodb
PARTITION BY RANGE (to_days(sdate))
SUBPARTITION BY HASH( region_id) (
PARTITION before2008 VALUES LESS THAN (to_days('2008-01-01'))
( SUBPARTITION s0,
SUBPARTITION s1 ),
PARTITION Jan2008 VALUES LESS THAN (to_days('2008-02-01'))
( SUBPARTITION s3,
SUBPARTITION s4 ),
PARTITION Feb2008 VALUES LESS THAN (to_days('2008-03-01'))
( SUBPARTITION s5,
SUBPARTITION s6 ),
PARTITION Mar2008 VALUES LESS THAN (to_days('2008-04-01'))
( SUBPARTITION s7,
SUBPARTITION s8,
SUBPARTITION s9,
SUBPARTITION s10),
PARTITION plast VALUES LESS THAN MAXVALUE
(SUBPARTITION s11,
SUBPARTITION s12)
);

To leverage partition pruning, the partition key column (sdate) needs to be in a WHERE clause, for the optimizer to consider performing partition scans. For example, the following query will only access data that is in the Jan2008 instead of the full table. So if we use the partition key in the WHERE clause then monthly and quarterly reports will perform partition scans and not full table scans.

SELECT * FROM sales
WHERE sdate BETWEEN '2008-01-01' AND '2008-01-01';

A few points about partitioning in MySQL 5.1
This is the first release of partitioning in MySQL so the focus is on key features of partitioning. It's a little tough due to some of the restrictions (listed below) but they are offset by the fact that MySQL offers partitioning for free. This can be an expensive license for other database vendors. This allows MySQL users the ability to leverage the great benefits of partitioning without any additional licensing costs.

People always ask me how big should a table be before we start considering partitioning. I then give my favorite answer, "it depends". Once a table gets to the size that the following become issues, it is time to consider partitioning:
  • Full tables scans are too expense.
  • Maintenance operations on an entire table take too long.
  • Availability is being impacted by the table being too large.
  • ILM can be leveraged by going to partitioning.

Some restrictions of using partitioning in MySQL 5.1
  • Partitioned tables must be partitioned on the partition key using an integer or must contain an expression that evaluates to an integer expression (key partitioning is an exception to this). Partition pruning can still be performed on date columns if you use the TO_DAYS() or YEAR() functions.
  • There can be a maximum of 1024 partitions.
  • Foreign keys are not supported.
  • If a table contains a primary key, the columns in the partition key must be part of the primary key.

Monday, January 28, 2008

Don't Underestimate MySQL

A lot of the popularity of MySQL is its ease of installation and how easy it is to use out of the box. Anyone can install MySQL pretty easily. That is the danger of MySQL. Because MySQL is so easy to install, people can forget or not realize that MySQL is a full blown database server. MySQL:
  • Needs to be installed properly.
  • Needs to be tuned like any other database server the more it is used.
  • Proper management practices need to be put in place.
I've taught the Oracle 10g DBA Workshop I and the MySQL Database Administration classes. I will tell you that the MySQL DBA class is every bit as technical and complex as the Oracle DBA class. The point is there is a lot to learn about MySQL if you are going to use it in a production environment. As a MySQL DBA you are going to have to configure, tune and manage MySQL as a database server similar to how other database servers are managed. MySQL's performance, scalablity, security and ease of administration are dependent on how MySQL is configured.

The most common mistake I see among DBAs that come from other database vendor environments is that they underestimate how much MySQL can be configured and that its architecture and tools are different than other databases. Storage engines, sql modes, MySQL memory caches and buffers, SQL and PL/SQL processing, replication, etc. all need to be understood to maximize how MySQL can be used. Even the hardware purchases are different in a MySQL environment.

MySQL is growing in popularity as an enterprise solution. So if you are an Oracle, SQL Server, DB2, Sybase, Informix DBA, do not underestimate how much you can do with MySQL. If you are going to manage MySQL databases in a production environment you should be taking the DBA, Performance Tuning and High Availability classes to learn the core fundamentals of MySQL.

Monday, January 21, 2008

Stored Procedures in MySQL

Stored procedures were introduced in the MySQL database server in version 5.0. It has been interesting to see the growth of stored procedures in the MySQL community because it is completely different with how stored procedures grew in the Oracle community.

Stored Procedures in Oracle
Stored procedures were introduced in Oracle 7, back in the client/server glory days. DBAs and developers using Oracle Forms and Reports seen the immediate benefit of using stored procedures in the database and PL/SQL stored procedures became very popular. A large part of this was due to developers considered themselves "database developers" so they tried to always leverage the features in the database. The PL/SQL language has grown through all the releases of Oracle and now in Oracle 11g Database Server, PL/SQL is still extremely popular and experienced Oracle DBAs and developers find tremendous benefits in writing stored procedures.

Stored Procedures in MySQL
I have not seen a great adoption of stored procedures in MySQL. I believe one of the reasons is due to the community of developers writing code for MySQL and open source applications. The core developers who write applications for MySQL are using Perl, Python, Ruby on Rails and PHP. They think first of how to write applications leveraging the benefits of the language they are working with and not the database. They write feature and GUI rich applications that run in the middle tier. So it is not natural for most of they to look and leverage the features in the MySQL database server. As web applications grow larger and access larger data sets this approach can effect performance as applications grow popular.

Remember the Wisdom of the Ancient Ones
If you study history or watch the history channel you are probably aware that long time ago, there were a group of ancient ones who had acquired great knowledge that has slowly been lost through the ages. They were called the Main Framers. One of the core beliefs of these ancient ones was that the closer you put your applications to the data the faster they run if they are data intensive. Slowly with the growth of client/server and then multi-tiered applications, this great wisdom has been slowly forgotten over time. There are new generations of developers who now even question if the people known as the Main Framers even really existed or if it is a myth.

The Benefits of using Stored Procedures
When writing data intensive algorithms, the most efficient place to run this code is in the database server. Runtime environments leverage the execution of the application code, not the database code. It does not make sense to access data, send it across the network, then filter and massage it in the middle tier application code. It is best to run this data intensive code in the database server, filter it and massage it in the database server and send what needs to be displayed to the middle tier. This approach will reduce network traffic and leverage what the database server and the middle tier each do best.

Growth of Stored Procedures in MySQL
Version 5 of MySQL introduced stored procedures with basic functionality. In version 6 of MySQL and future releases you can expect to see a lot of enhancements that will continue to leverage running data intensive code in the database server.

It would be wise for open source developers to look at how they can filter and massage data in the database server and send to the middle tier only the data they need to process and display for their application.

MySQL - A change agent for open source




















The 1st Edition of "The MySQL Story" was handed out during the MySQL meeting in Orlando when the Sun acquisition of MySQL was announced. MySQL is a very cool company with employees that have a very unique, committed and passionate perspective to open source.

MySQL employees are taught to be "disruptive", to shake the world with new ideas and innovativeness. With a strong believe and commitment to open source, MySQL AB has created a company where everyone believes that there is a greater good that can be accomplished by working together, collaborating together, sharing and freely exchanging ideas. I believe a lot of the great company "team" attitude and commitment to work together is fostered by the belief in open source.

If Sun truly wants the MySQL acquisition to succeed, I strongly recommend Sun to let the core values of MySQL to survive and to try not to change MySQL but to support MySQL so the MySQL database server can grow better and stronger and help open reach new levels of success. Open success succeeding is a win for every individual and startup company on the Internet.

I find it interesting all the doomsayers predicting all the things that could go wrong with this MySQL acquisition and can MySQL go head to head with Oracle. You always hear this from the industry analysts never from MySQL employees. Oracle is like an aircraft carrier task force and MySQL is like a small speed boat. All MySQL employees know this and love MySQL being a speed boat. All the doom sayers and preachers of gloom need to relax a little bit or maybe that helps get readers. Open source believers believe in "open source". They are not religious zealots for Ruby on Rails, PHP, MySQL, Linux or any other component of open source. They are committed to open source. MySQL understands as well as any, open source group. I can't predict the future, you will always see MySQL at the front of the battle lines for open source. I suggest everybody sit and wait to see how the MySQL database server grows under this acquisition. You don't kill the goose that lies the golden eggs. Be a little patient, you may be pleasantly surprised with how well this acquisition goes.

MySQL employees have the opportunity to be a "Tipping Point" for open source. MySQL employees are currently at the tip of the blade not the bleeding edge. Their vision can be a tremendous change agent for the IT industry. If the MySQL people focus on being great leaders and help define future directions of open source and continue to build new versions of the database open source can count on, then all will be good in the world of open source. Everyone on the Internet: Internet companies such as Google, Yahoo, YouTube, MySpace, bloggers, startup companies, individuals building their first website, hosting companies should all be rooting for the Sun acquisition of MySQL to be successful.

Friday, January 18, 2008

Database, Application and Middleware Wars

The changing dynamics of the IT industry is going to increase in the next year versus slowing down.
  • Oracle's acquisitions in the last few years in the middleware space has the potential to significantly increase it's power to challenge IBM in the middleware space.
  • Oracle's acquisitions in the application space the last few years allows Oracle to go toe to toe with SAP in the business applications space.
  • Sun's backing and support brings a lot of power to MySQL and the web platform of LAMP.
  • The open source world and Internet are changing how people think daily.
  • The innovativeness of the world wide web is creating new companies at an unbelievable rate. The creativity of this space is going to change the world in ways we can't even imagine.
I almost see this as Oracle having two big aircraft carrier task groups one facing IBM and the other facing SAP. MySQL is like a very fast attack boat that now has a powerful nuclear submarine flying the Sun flag to protect it. Microsoft is another big aircraft carrier task group that everybody is wondering where it is going. The database, application and middleware battles that will occur over the next year is sure to change the face of the IT industry more than we can possibly imagine. This does not even include all the Internet companies like Google, MySpace, YouTube and others that are changing the world everytime we blink. Or maybe more importantly all the new little startups on the Internet that are being born every day.

I look at this like back in the day when DEC was the second largest computer company in the world and everyone was wondering if they could catch IBM. If back then you had said that in the future a PC company is going to purchase DEC, people would have thought you were crazy. I have the great luxury of traveling in the Oracle and open source worlds. In the Oracle world, I see the incredible power Oracle technology brings to large companies that have complex problems to solve. In the open source world my mind is literally boggled every week with all the incredible, incredible creativity and innovativeness that I see in Internet companies. If you look around everyone can see that rate of change in the world is accelerating. The Internet is spawning new change agents in the world at an exponential rate.

Thursday, January 17, 2008

Open Source continuing to change the world

MySQL by the pure volume of downloads is considered the most popular database for the Internet. MySQL and open source are changing the world as well. The first .com explosion had startup companies throwing a lot of money at traditional hardware and proprietary software. While today, most start ups are running open source solutions like MySQL, Linux, Apache, Perl/PHP, etc. This allows startup companies to have more operational flexibility in their beginning stages. This significantly reduces the startup capital to build the IT infrastructure. By this definition MySQL and open source are helping fuel the world wide economy by allowing companies to have enterprise Internet platforms out of the gate.

In the last year a number of small and medium sized companies have started using MySQL on projects. With everyone seeing the tremendous success of MySQL in companies like Google and YouTube, you can expect more large companies looking for projects where MySQL is a good fit. With Sun fueling MySQL (solar powered), this should significantly increase the growth of MySQL in the database market. 2008 can expect to see a significant acceleration of open source in the industry.

Sun has to feel good that they have JavaDB which plays well for smaller databases and now MySQL.

Wednesday, January 16, 2008

The Dolphin in the Net, a Great Catch!

The Dolphin in the Net, a Great Catch!
Only time will tell, but Sun Microsystems (who said "the NETwork is the computer") was able to capture the dolphin. Sakila the dolphin is the MySQL mascot. Sakila represents power, speed, grace, precision, friendliness and good nature. I believe the open source community would want Sun to help maximize these characteristics and not turn it into a whale. This may turn out to be one of Sun's best acquisitions in a long time. It's interesting that most people think dolphins all look the same and that replication is one of MySQL's most popular features.

Any good relationship is based on both sides bringing something positive to the table and hopefully each side has positive assets that can counter possible weaknesses in the other. The MySQL acquistion by Sun brings together some strong benefits and assets. Some of the top potential benefits that stand out to me include the capability of making the whole greater than the sum of the parts:
  • MySQL engineers working with Sun engineers is sure to bring new new innovation and strength to the MySQL database server.
  • Sun support, logistics, distribution channels, financial backing definitely will open a lot of doors to big customers for MySQL.
  • The one million plus active instances in the world have the potential of bringing a lot of new customers to Sun.
  • MySQL's disruptive perspective that creates create innovation and ideas in the open source world has a chance to change Sun's culture.
MySQL's popular open source database could have been purchased by Oracle, Red Hat, HP, IBM or a number of other big companies but Sun may have the most synergy with MySQL. One of MySQL's great assets is its relationship with the open source community. It will be very interesting from an IT industry perspective to see how this new relationship evolves. From a strategic perspective, Sun's capture of the dolphin may be one of the great catches of the year.

I would highly recommend reading Jonathan Schwartz's blog at http://blogs.sun.com/jonathan.

Sun to Acquire MySQL - LAMP + MARS

Sun Microsystems Announces Agreement to Purchase MySQL

Today, January 16, 2008 Sun Microsystems, Inc. announces it has entered into an agreement to purchase MySQL AB. Sun's distribution channels and support is definitely going to accelerate the growth of MySQL in the database market. MySQL has over 50,000 copies downloaded daily with an estimated total downloads of over 100 million is already the fastest growing database in the Internet market. Combining MySQL with Sun is sure to increase the growth and incredible popularity MySQL is currently encountering. The purchase is for 1 billion dollars, 800 million in cash and 200 million in options. After the announcement Sun stock is up by 10% which is an increase of about 1 billion dollars. Everything is relative. :) The pending purchase is going to be the largest financial transaction for open source. Despite this being an important day for open source, this is just the tip of the iceberg in terms of where open source is going.

Sun and MySQL - A Change Agent
Sun's emphasis on meritocracy and MySQL's focus on egalitarianism is sure to bring new innovativeness and ingenuity to the Internet market. The Sun and MySQL cultures have a lot of similarity and this combination is sure to be a change agent. Sun helped change the IT world and replaced Digital Equipment Corporation and forced HP and IBM to change their positions on large big computers being replaced by small powerful computers. MySQL is continuing to change the IT world by providing a strong open source database and has forced proprietary database companies like Oracle, IBM and Microsoft to address the growing popularity of MySQL and open source. Sun currently plays a large role in the server and Java worlds will now play a larger role in IT nfrastructures.

MySQL Key Component of Web Platform
The MySQL database is a key component of the web platform along with the LAMP software platform of Linux, Apache, MySQL/memcached and PHP/Perl. With Sun including OpenSolaris, OpenOffice, GlassFish, Java, and NetBeans this is going to increase the power of the web platform that both Sun and MySQL play a key role in. MARS is the MySQL, Apache, Ruby on Rails and Solaris platform. Sun and MySQL have been two of the most innovation companies in the web software platform for the Internet. The combination of MySQL and Sun is sure to help take the web platform to new levels which will benefit large organizations as well as small individual companies.

The Toy Revolution is Here!
In the past, some proprietary companies have tried to address the incredible explosion of MySQL's popularity by saying it was a "toy". As stated today, the world had better prepare for the Toy Revolution! Acquisitions today are very dynamic and changing the world. Apple's purchase of Next brought tremendous innovation and creativity to Apple which spearheaded the growth of Apple. Sun's purchase of MySQL has the potential to bring a tremendous amount of new creativity, energy and dynamics to Sun Microsystems.

Thursday, January 10, 2008

Excellent Open Source Presentations

Last night I went to some presentations that were put on by the Chicago chapter of ACM. The two presentations were:

  • An Introduction to Bloom Filters - This presentation focused on choosing the best algorithm to solve a problem. The most familiar trade-off is between storage space and time, but there are more exotic possibilities that can lead to data structures with surprising properties. This presentation discussed Bloom Filters, a probabilistic data structure that efficiently encodes set membership and allows a trade-off between storage space and uncertainty. It was an excellent presentation on how to achieve very high scalabliity with inexpensive hardware using open source.
  • How Open Source Projects Survive Poisonous People -Every open source project runs into people who are selfish, uncooperative, and disrespectful. These people can silently poison the atmosphere of a happy developer community. Come learn how to identify these people and peacefully de-fuse them before they derail your project. Told through a series of (often amusing) real-life anecdotes and experiences.
These were two absolutely outstanding presentations. The second one was probably the best presentation I've seen in years. Both presentations had tremendous take aways. I would highly recommend attending both of these presentations if they are given again (they will be the audience was asking the presenters if they would give it again at different locations). If this is the type of presentation given at the Chicago ACM chapter I would highly recommend attending a meeting of this organization in the future.

Wednesday, January 2, 2008

2007 - MySQL a Year in Review

2007 has been an interesting year with MySQL. MySQL really seems to have broken out this year. Organizations are absolutely choking on their database and software licensing costs. More and more organizations, large and small are now recognizing MySQL databases as a viable solution for database projects.

If MySQL can be a solution for a database project, it can provide a lot of flexibility for organizations. Leading managers are looking at more ways to be competitive in today's global markets. A number of the largest Internet websites are using MySQL to provide extremely fast reliable Internet solutions. These success stories have more IT managers asking what MySQL can do for them. A great success story can be found at:
http://itc.conversationsnetwork.org/shows/detail3299.html

In 2007, more than any year open source solutions have taken an exponential leap in use and acceptance in the market place. In the last year I've gone into some of the largest companies in the U.S. and seen an explosion of MySQL databases. In 2008, I expect to see the growth of open source solutions increase in use and acceptance. My top three reasons I see a significant increase in MySQL databases for 2008:
  1. IT managers beginning to think out of the box and realizing how open source can offer greater flexibility in choosing software solutions.
  2. Industry acceptance of open source solutions in the enterprise.
  3. Popularity of MySQL version 5 features.
The large vendors can no longer ignore the growing popularity of open source and MySQL. 2007 has seen large vendor companies purchasing open source products. It's funny, I've seen a few blogs predict gloom and doom for MySQL because Oracle purchased InnoDB and IBM purchased SolidDB. I see the exact opposite. The purchases of popular storage engines used by MySQL shows the growing popularity and use of MySQL can not be ignored by large vendor companies. Their purchases bring more light and industry awareness of popular storage engines used by MySQL.

I predict InnoDB and SolidDB storage engines will be used more than ever in MySQL databases. As MySQL 6.0 moves towards GA, you will see the Falcon storage engine increase in interest and popularity with it being the next generation in transactional storage engines for MySQL.

The growth of open source is going to be very interesting to watch in 2008. As Oracle, Microsoft and IBM, BEA, etc. add more and more features to their products and increase their prices, open source products grow in popularity and marketshare at almost the same pace. The growth of MySpace, YouTube, MySQL, etc. is continuing to demonstrate the incredible dynamics of the Internet and how the use of open source is continuing to change our IT industry. I don't work with all open source products but the following are products I work with and see them becoming more popular than ever before. Popular open source solutions that I predict will continue to grow in 2008 include:
  • MySQL
  • Apache
  • Apache Tomcat
  • JBoss
  • Eclipse
  • Spring

Thursday, December 27, 2007

MySQL Architecture using MOCA















Proper installation of a MySQL database environment will make a tremendous difference in the management of the MySQL database server. This image shows key areas that need to be considered in defining the MySQL configuration. MOCA is used to demonstrate important points to consider.

I've received a lot of emails asking about defining a MySQL environment using MOCA. So I defined this image to try to summarize the core configuration on one slide. On the right it shows the MySQL instance and the storage engines.
  • The MySQL instance is the global shared memory and session threads for an individual MySQL database server.
  • The storage engines control how I/O is performed on tables and indexes. The individual characteristics of each storage engine will determine where and how the tables and indexes for each storage engine will reside.

Software Installation
The MySQL database software should be installed in its own file system. All dynamic files should be moved out of the software location. The software location should be a static environment.
  • The MySQL_BASE directory (/opt/mysql) is the directory point for installing different versions of MySQL database software. Each MySQL database version should be installed in a subdirectory below this base directory location. Naming each software subdirectory with the database version makes it easier to manage.
  • The MYSQL_HOME directory (ex. 5.1.22 for the MySQL 5.1.22 software release) is the location of a database software install. This directory should be located below the MySQL_BASE location.

MySQL Global Variables
MySQL global variables define the location of important directories and files for an individual database server instance.
  • basedir - is the directory location of the database software installation for a specific release. This is equal to the MYSQL_HOME directory location for a database server.
  • datadir - is the default location for the database files are stored. Each individual database schema will have a subdirectory below this location that will contain database .frm files and MyISAM files. The default location for the InnoDB tablespace and log files will be stored in the directory defined by the datadir parameter.
  • log-bin - defines the location of the binary files required to recover a database to a point in time. This location should be different than the datadir location.
  • pid-file - defines the location of the PID file containing the unique process id of the mysqld daemon that runs the database server.
  • log-error - location of the primary error and event log file.
Primary operating system directories
These primary directory locations need to be well thought out for a database server. Refer to older blogs that describe MOCA in more detail. Below are sample directories that distribute database software, database files, binary logs for recovery, administration files and backup files into different physical locations. The default installation puts all these in one directory structure. Best practices strongly recommend separating the physical location of different MySQL files. It is a good practice to name directory paths with /dbxx so everyone can understand these directories contain database files. The are template directory names. The mysql2 name is the unique name of a MySQL database server.
  • /opt/mysql - base location of MySQL software
  • /db01/mysql/mysql2/data - base location of database files
  • /db02/mysql/mysql2/binlog - base location of binary logs
  • /db03/mysql/mysql2/dbadmin/ - base location of administration directories
  • /db04/mysql/mysql2/backups/ - base location of backups

Wednesday, December 19, 2007

More MOCA please ...

There are certain facts about how database servers work. A database configuration should follow best practices to address these facts. Below is a list of certain truths about database servers that are self-evident:
  • Default installs by database vendors are designed to be simple to install and under configured to minimize the initial use of resources. Default installs should not be used to run production servers.
  • Relational database servers run faster when memory is configured properly.
  • Balancing disk I/O is important.
  • Treat your information and the data you need to do recovery as matter and anti-matter. Never put them together.
  • Separate your database software from your data.
  • Separate your information logs and administration files.
  • Database software should never be installed as root or as the operating system administrator.
  • Database software, data, logs, administration files, recovery files should be kept separate from other types of files.
Default installs do not address the above. The default software for MySQL is designed to be simple to install and minimize the use of initial resources. However new users perform the default install and then use the default install to run an important database. This default install creates a "lot" of problems if you want to use MySQL as a database server. This is why I created MOCA. MOCA is defined further down in this blog.

MOCA stands for the MySQL Optimal Configuration Architecture. This is a summary of best practices that apply to any database server. Every experienced production DBA from Oracle, DB2, SQL Server, Informix and MySQL uses something similar that contains a list of guidelines and best practices that they have learned from years of experience that should be followed. For years Oracle DBAs have followed OFA (the Optimial Flexible Architecture). MOCA is a summary of best practices modeled from OFA and that I have picked up from 20 years of DBA experience. It is not a complete listing but a set of common sense guidelines that should be considered for a database installation.

I strongly recommend that if you are new to database administration you review MOCA. It pains me to see customers using the default install of MySQL that they installed as an operating system administrator userid and then they wonder why they are having so many problems. The default install will create pain and anguish in your life if you use it as a production configuration.

Tuesday, December 18, 2007

Create aliases to make MySQL administration easier

When working in a Unix/Linux/Mac OS environment, aliases can make things a lot easier if you are running the same commands over and over again. Here are a few aliases you can define to simplify running MySQL commands. Then just type the alias name. Put these in one of your configuration files dependent on the Unix shell you are running so these aliases will be automatically set in your environment.

Alias examples ($ represents the command line prompt):
$ alias myalias='alias | grep mysql'
$ alias myenv='env | grep mysql '
$ alias mystat='mysqladmin -u root -p status'
$ alias myestat='mysqladmin -u root -p extended-status'
$ alias myping='mysqladmin -u root -p ping'
$ alias myrun='ps -aux | grep mysql | grep -v grep'
$ alias mysql='mysql -u root -p'
$ alias mystop='mysqladmin -u root -p shutdown'
$ alias mysafe='nohup /opt/mysql/5.1.22/bin/mysqld_safe -- defaults-file=/dbadmin/mysql/startup/my.cnf & '

To view your aliases type the following:
$ alias

There are a lot of additional aliases you can define to make your daily tasks easier. Normally aliases are put in a startup file (in the $HOME directory) that is executed each time a Unix shell is started.
  • In the Korn shell (ksh) put the aliases in the .kshrc file.
  • In the Bash shell (bash) put the aliases in the .bashrc file.

Thursday, December 6, 2007

Favorite 3rd party software with MySQL

Here are the results of a small poll I conducted on favorite 3rd party software with MySQL. The poll results are:
  • SQLYog 48%
  • Nagios 15%
  • Other 14%
  • Toad 10%
  • Navicat 7%
  • DBArtisan 3%
  • Innodb Hot Backup 1%
  • BMC 1%
  • Cfengine 1%
  • Zmanda 0%
Since this was an informal poll (take with a grain of salt), so I wanted to add a few insights I have found in customers that I have been working with.
  • SQLYog and Nagios are very popular in MySQL environments.
  • Navicat has its own fan base in the MySQL world.
  • Toad althought popular in the Oracle world is very quirky when used with MySQL.
  • Zmanda althought it did not get any votes, I do see it being used quite a bit by students in my classes.
  • I was really surprised that I do not see a lot of people using InnoDB Hot Backup.

Friday, November 2, 2007

The Incredible Growth of Open Source

Getting Hooked on Open Source

Open source is kind of like M&Ms. It's hard to have just one. Once people understand open source, they start looking at more ways open source can be used in their organizations. The cost savings can be dramatic. In the old days people would say "You won't get fired by choosing IBM". Those days are over. You may not get fired by buying a large vendor solution, but a lot of people may get laid off or outsourced due to large vendor costs and licensing.

Open source by definition is a "sharing" environment. Every class I teach students are sharing different open source products they use for Wikis, ticketing systems, communication, monitoring software, operating systems, database servers, application servers, development environments, etc. What's more they are also sharing scripts, ideas and planning on collaborating more after the class ends. This is a very cool environment for a technologist.

The Microsoft Word Effect

I look at it as the Microsoft effect. You go out and buy Microsoft Word for $329.99. Most people use Word for setting bold, a few fonts, spell checking, italics etc. People pay over $300 for one vendor (Microsoft) product and 95% of all users don't even use 5% of that product. I went and bought iWork that has Pages, Keynote and Numbers, the Apple equivalents of Word, PowerPoint and Excel for $99 for a five system family pack. This wasn't an open source solution, the point being that why keep paying large amounts from vendor software if you are not using a lot of their features. Arguably by going to iWork I not only saved a lot of money but also got a lot more functionality that the vendor (Microsoft) product. It took being able to think out of the box and thinking I had to buy a large vendor product.

I also bought Notebook software for my Mac to help keep myself organized and to take notes. One of my students then showed me Tiddlywiki and I can use it for free on all platforms. I keep a copy of it on my flashdrive and I take it everywhere with me. There are a lot of points if you look at open source, you have a lot more options and will likely save a lot of money.

Open Source Can Dramatically Reduce IT Budgets

Companies are seeing that open source solutions such as Linux, MySQL, JBoss, Apache, Eclipse, RT, etc can save them tremendous amounts on their IT budgets. If you need all the feature functionality from a major vendor then it makes sense to pay their prices. In most companies their are numerous project areas where open source can provide large cost savings and still meet core functional requirements. Using open source may not only keep you from getting fired, it may also keep most of your employees from getting outsourced or laid off.

The Fear of Open Source

Don't misunderstand what I am saying. The features provided from the large vendors can be very important to an organization. There is a reason you pay large amounts of money for large vendor features. If you need an aircraft carrier and you have the money for it, go get it and you'll sleep soundly. For extremely large mission critical systems I would highly recommend looking at the best solutions money can buy if you need it. What I'm saying is if you don't need an aircraft carrier then look for the right sized solution that will meet your needs.

A lot of managers are scared to move off the security of large vendors and to look at open source. In the future you are going to see managers looking for more flexibility, nimbleness and the need to manage costs more effectively as growth occurs.

Globalization has allowed large corporations world wide to compete with U.S. companies. Open source is growing significantly in popularity in places like Europe and China. With low cost solutions like open source, in the future you will see smaller companies begin to compete more effectively in the U.S. as well. U.S. companies need to look not only at the strength and flexibility of the IT organizations but also at the costs of their IT organizations to compete locally as well as world wide.

Good Articles on Open Source Growth

Different industry groups are predicting up to 27% growth annually in open source software by 2010. Small businesses have always been a core component of the U.S. economy. Small businesses and individuals can often compete against much larger companies at a fraction of the large company costs by using the Internet and open source. Why shouldn't large organizations also leverage these costs benefits? Especially since your competiton is probably using open source.

Here are a few interesting articles on open source growth.
I always welcome hearing about different open source solutions.

MySQL and VMWARE

VMWARE keeps popping up in more and more clients I go to. Virtualized environments are continuing to evolve. Companies are looking for more ways to stream line costs and improve efficiency and virtualized environments are one way to accomplish this.

Observations on virtualized database environments is that this is still an area that needs to mature a lot before being put in production environments. Don't get seduced to the dark side unless you understand all the issues. Thoughts on virtualization for MySQL:
  • Production databases - No way, nope, nyet, nien, bu shi, iie.
  • Test databases - When bench marking and performance tuning are not factors at the time, virtualized environments can play a role here. Has to be used in a controlled environment.
  • Development databases - Extremely efficient and cost effective.
I personally run Apple MacBook Pros and enjoy working with VMWare Fusion and Parallels. In my simple test environments I am running MySQL Servers, Oracle Servers, Eclipse, JDeveloper, Apache, JBoss and the Oracle Application Server in Solaris, Enterprise Linux and Fedora 7 environments. I'll eventually load a version of Vista. I save my VMs and then it is really easy for me to create a new copy of my VM from a backup. VM is a great environment for new MySQL DBAs to play around with different configurations, running multiple servers, etc. DBAs can also use VM's to create a new test or development database environment in a matter of minutes.

Definition of Virtualization

We are all seeing that virtualization will be an area of continued growth. Virtualization from Wikipedia:
In computing virtualization is a broad term that refers to the abstraction of computer resources. One useful definition is "a technique for hiding the physical characteristics of computing resources from the way in which other systems, applications, or end users, interact with those resources. This includes making a single physical resource (such as a server, an operating system, an application, or storage device appear to function as multiple logical resources; or it can include making multiple physical resources (such as storage devices or servers) appear as a single logical resource."

As you are well aware, each vendor has their own definition of virtualization. In the Wikipedia definition (above), they define platform virtualization, resource virtualization as well as some good virtualization examples.

The Role of MySQL in Virtualization

As databases continue their rapid growth and proliferation, organizations are looking for more ways to reduce hardware and software costs. Large vendors don't want customers to look at hardware and software from a commodity perspective. However, powerful open source solutions are giving organizations a lot more flexibility in purchase decisions. Open source solutions offer much more cost effective solutions with MySQL, Linux, Intel (and AMD) hardware with muliple CPUs. We can definitely expect that solutions like MySQL and Linux will play a large role in virtualized environments today and in the future.

There is also a new forum at http://forums.mysql.com on discussing VMWare and MySQL if you have comments.

Thursday, November 1, 2007

MySQL: Favorite 3rd Party Software

I've started a new poll on popular 3rd party software used with MySQL. I've recently been involved in a lot of discussions on favorite software used by MySQL DBAs. I realize there are a lot of great solutions. I narrowed the list to a few software solutions that I've had a lot of discussions about in the last few weeks with students and clients.

I decided to restart the poll by adding SQLYog. Below are the initial numbers before restarting the poll. I won't restart the poll again. These numbers will be included in the summary blog after the poll closes.
  • Nagios 6
  • Cfengine 0
  • Navicat 3
  • Quest (Toad) 6
  • Zmanda 0
  • Embarcadero (DBArtisan) 1
  • Innodb Hot Backup 1
  • Other 6
As databases proliferate in numbers, companies are struggling more with deciding what is the right tool to monitor and manage our databases. Especially with MySQL which is likely to run in a heterogeneous environment. Do I use open source tools or do I use tools like BMC, Quest and Embarcadero to help me manage a heterogeneous environment? I've been involved in a lot of discussions on this in the last year. I hope you are lookig forward to seeing how the numbers shake out as much as I am.

I hope you don't get frustrated if you don't see your favorite tool on the list. I wanted to keep the list to a top ten and on software that has been hot in a lot of conversations lately and make sure this wasn't just my list. At the same time Lake City, CO in the San Juan Mountains did not make my top ten list in CO, still not sure how that happened. Lake City, CO is an absolutely beautiful place in Colorado.

In this list is a mix of tools very popular in heterogenous environments, mixed with tools that are popular in the open source world. It includes development tools, DBA and monitoring tools. The goal is to get a feel if organizations lean towards heterogeneous tools or if for MySQL they focus on tools specific to MySQL environments.

Another issue not addressed by this poll is the management of multi-tiered infractructures which brings in the application server and web server. The whole question of how to manage multi-tiered infrastructures is a completely different poll.

The list includes:
  • Nagios
  • SQLYog
  • Cfengine
  • Navicat
  • Quest (Toad)
  • Zmanda
  • Embarcadero (E/R studio)
  • Innodb Hot Backup
  • BMC
  • Other
I did not include MySQL Enterprise Monitor or MySQL Query Browser since they are MySQL tools. The goal was to see what products outside of MySQL stand out.

Poll on Favorite Development Environments for MySQL

I did an informal poll on favorite development environments for MySQL and I was surprised to see how PHP seemed to be signiciantly more popular in MySQL environments versus Java, Ruby on Rails or .NET. Here are the results of 99 responders:

  1. PHP 52
  2. Other 23
  3. Java 13
  4. Ruby 5
  5. .NET 5
  6. Access 1