Call for Articles for Winter Issue of MySQL Magazine

It’s that time again. Time for fame and fortune! Sorry, as usual there is no fortune, but the good news is that our readership continues to grow, so author fame is imminent. We are planning the winter issue of MySQL Magazine. With the new GA release of MySQL server 5.1 last month, there is certainly plenty to talk about!

You can reach me with your ideas at bmurphy@paragon-cs.com . I need to see all article proposals by the 15th of this month. Draft articles must be in by the 10th of January, so if I accept your proposal, you have a month to get things ready. I should also mention that in the past we have used blog postings (with author permission and full credit of course). If you have blogged something recently that you feel is worthy of publishing in the magazine, send me the link and I will take a look.

Never heard of MySQL Magazine? It is a digital magazine designed for both database administrators and developers of the MySQL database server. All six back-issues are available for free download from the website.

A CloudFront is Moving In

Amazon yesterday announced the arrival of what they term a content delivery system that adds one more piece to the puzzle that is cloud computing.

Ever hear of Akamai? They provide what amounts to web caching on a global scale. If you are in Asia, accessing a web site that is located in Europe, the site content might be served from Hong Kong. Of course, this is only if content caching is set up with a service such as Akamai. This is much faster and more efficient than getting the content from the European data center where the actual web server is located. Make sense? Good!

Previously, this required a major commitment of money and time to be able to do this. Not anymore.

Amazon is now rolling out the same service (called CloudFront in Amazonspeak), integrated with S3, that will provide a better experience for your customer just as Akamai does. Caching servers are located in the following locations:

United States

  • Ashburn, VA
  • Dallas/Fort Worth, TX
  • Los Angeles, CA
  • Miami, FL
  • Newark, NJ
  • Palo Alto, CA
  • Seattle, WA
  • St. Louis, MO

Europe

  • Amsterdam
  • Dublin
  • Frankfurt
  • London

Asia

  • Hong Kong
  • Tokyo

Cost is based on where the content is delivered from, and it looks reasonable—even a bargain. The US pricing is roughly comparable to the standard pricing, and the European location pricing actually looks cheaper (why, I have no clue).  The Asian locations have not been available before, but currently their cost is a little steep in my opinion. One good thing is that if you wait for three to six months with Amazon, they will lower the cost. All pricing is listed here.

How do you integrate the caching with your current Amazon setup? It’s very simple actually. A simple API, as with other Amazon services, allows you to configure the content so that it can be served from CloudFront instead of the normal content location. If you already have experience with Amazon services you should be able to serve content from CloudFront in under an hour.

If you are already using Amazon to serve web pages, this is a no-brainer. If you aren’t, maybe this is what tips you into using the Amazon services.

Here is the homepage for CloudFront.

Overview of Transaction Logging in MySQL

I was doing some research over the weekend on how transactions work “under the hood” in MySQL. I thought it might be enlightening if I wrote about what I found.

The database system must resolve the situation where, for whatever reason, the database server stops working in the middle of a transaction.  Perhaps the power goes out, the hard drive crashes, or the CPU disappears in a cloud of smoke. Maybe the MySQL Server itself crashes for some reason. What does the MySQL Server do when operation resumes?

Potentially, there are transactions in an inconsistent state. How are inconsistent transactions resolved? They are resolved through a recovery process involving log files that are called transactional logs. There are two kinds of transactional logs: redo logs and undo logs.

(more…)

Thoughts on the Cloud

For those of you who have been under a rock for the last several years, there is a buzz-phrase floating around—cloud computing. If you haven’t been paying attention, it is time to wake up.

While I could spend an entire blog post—if not several—on a definition of cloud computing, I will be talking only about cloud computing in the sense of companies moving servers from their building or network operations center to running virtual servers in this computing cloud.

While there are a number of companies providing virtual servers, the most visible is Amazon, with their Amazon Web Services (AWS). I will be talking about AWS in this post as it is the service with which I am most familiar. It seems like every month, AWS rolls out new options and services. Just recently Amazon announced that you can now run on AWS the Windows operating system along with SQL Server.

Amazon also announced a service level agreement (SLA) of 99.5%. The SLA is important. It is a guarantee of service uptime. If Amazon don’t meet the SLA, then you get money back. As any of you will know, you have to be able to count on your data center. 99.5% is a pretty good level of coverage.

Beyond that, one of the new features Amazon will be implementing during the next year is the use of regions and availability zones. Regions are distinctly different areas of a country (or completely separate countries); availability zones are designed to be insulated from failures in other availability zones and provide inexpensive, low-latency network connectivity to other availability zones in the same region. What does this mean? It will soon be very easy to deploy a set of servers in different areas and/or regions so that your data and servers are spread out and not vulnerable to a single point of failure.

I am not going to go into any detail about how virtual servers work. That’s not the point of this post. I am going to concentrate on what you can do with virtual servers.

(more…)

Poll: MySQL on Debian or Ubuntu?

I have put up a poll on my personal blog, Diamond Notes asking whether you prefer Ubuntu or Debian as an operating system for MySQL server. I am curious because I have seen a shift in the last year of Debian users to the Ubuntu distribution, and I would like to put some actual numbers to what I am seeing. (Please don’t vote if you use another OS or another Linux distribution, as I am strictly interested in the usage patterns of these two operating systems.)

Thanks,
Keith.

Log Buffer #121: a Carnival of the Vanities for DBAs

This week gives me a chance to get back into something I love to do—write. For those who don’t know, my name is Keith Murphy and I am a MySQL DBA at the Pythian Group. In addition, I have the privilege of being the editor of the MySQL Magazine, a quarterly  magazine for those who use MySQL on a daily basis, either as a DBA or a developer. The sixth issue was just released last week and is available for download now. But enough about me! Let’s see what you all had to say this week.

Beginning with the world of MySQL.

Monty Taylor kicks things off, bringing us news of the ability to use the innodb plugin with Drizzle. I just think its great how the Drizzle development is moving along so rapidly. My thanks to everyone involved.  Monty also puts out a call to help defray the cost of the purchase of the drizzle.org domain name.

There have been several posts this week on virtualization of MySQL Server. I point you to a colleague at Pythian, Sheeri Cabral, who wrote about some of the benefits our customers have already experienced while using virtualized servers. While virtualized servers are not a panacea, they definitely have a place in the DBA’s environment. If you don’t work with any currently, you will be doing so down the road.

The OpenSQL “unconference” is coming! The date is Nov 14 -16 in Charlottesville, Virginia, USA. Details and registration information are available here. Speaking of conferences, the MySQL Users Conference, which is in April in Santa Clara, CA, USA has extended its deadline for topic proposals.

Baron has a great post on naming conventions for your schema.

In the how-to department, Falko Timme has a good tutorial on how to set up GreenSQL to protect your databases from SQL Injection attacks. Finally, Johan Andersson has a good introductory blog post on optimizing queries for a NDB cluster, and a post on how you can get the Cluster Sandbox tool for testing the MySQL Cluster.

The Oracle world had sad news this week. Carl Backstrom, who was an Oracle employee and APEX developer, was killed early Sunday morning in a car accident in Nevada. (more…)

MySQL Magazine Fall 2008 Issue Released!

Come get it while it’s hot. The brand new issue six of the magazine is available for free download from http://www.mysqlzine.net.

MySQL Schema Synchronization and GUI Tools

Or, There is a Use for GUI Tools!

Recently I was working on a problem for a customer. They are converting a server with two InnoDB data files to innodb_file_per_table:

$ ls -l ibdata*
-rwxr-xr-x   1 mysql    mysql       2.0G Oct 14 13:10 ibdata1
-rwxr-xr-x   1 mysql    mysql       350G Oct 14 13:10 ibdata2

I honestly don’t recall ever seeing (or hearing about) so large a data file.

The method chosen for conversion boils down to this:

  1. stop and start the server to enable innodb_file_per_table
  2. alter all tables to myisam
  3. stop server and delete ibdata file
  4. restart server
  5. convert tables back to InnoDB
  6. add foreign keys

This post isn’t about how we did it, or about whether or not it was the best way, or anything like that. This post is really about the the last two steps.

There were over 500 InnoDB tables and something like 375 foreign keys. So I needed to somehow create the ALTER TABLE statements for these 500 servers. To drop the Foreign Keys, I used the following SELECT statement:

SELECT CONCAT( "mysql -u root -pPASS ", table_schema," -e 'ALTER TABLE ",table_name, ' DROP FOREIGN KEY ', constraint_name,';'' &') AS list_of_fks FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_NAME is not null ORDER BY TABLE_NAME, COLUMN_NAME;

This created a list of statements that I could then put in a batch file, edit a little, and have them run in parallel.

I used the following SELECT statement to find all InnoDB tables and prepare a command to convert them to MyISAM:

SELECT CONCAT("mysql -u root -pPASS ", TABLE_SCHEMA, " -e 'ALTER TABLE ", TABLE_NAME, " ENGINE=MYISAM;' & ") FROM INFORMATION_SCHEMA.TABLES WHERE ENGINE='INNODB';

Again, the output can be put in a batch file, modified a little, and run in parallel.

Once everything was converted to MyISAM, I shut down the database and removed the InnoDB log and data files and modified the my.cnf to so I had file_per_table and a much smaller InnoDB data file. That was the fairly straightforward part. Now the fun began. (more…)

MySQL Magazine Fall Issue Coming Soon!!

Hey everyone, I try to get the magazine out every three months on the 15th. Sometimes life gets in the way. Imagine that! The next issue is looking great and will be out very soon.

Not to early to start thinking about what you want in the next issue. I will be asking for article ideas very soon.

Keith

It’s a Good Time to be Involved with MySQL

In many parts of the world times are uncertain. I live in the United States and we are in the middle of a financial meltdown that many fear may be as bad as the Great Depression. Because the world’s economies are so linked it is causing severe distress in many other countries as well. I just read that two trillion dollars have been lost from nest eggs in the last 15 months here in the States.

I am not going to turn this into a rant about who is right, who is wrong, or  what should be done about it to resolve the problem. This isn’t the place. I probably don’t even have the right answer. I have a different angle.

If you are involved with MySQL as a database administrator, or if you work directly with MySQL in some other aspect, you can probably breathe a little easier. Why is this? MySQL Server has grown in market penetration for a long time. It is now a significant section of the RDBMS pie.  I predict that this market penetration will only continue to grow. As this economic downturn/recession/whatever continues, companies will look harder for ways to save money. What better way to do so than replace your proprietary RDBMS that can cost you significant amounts of money, with MySQL Server? For all intents, the same functionality is there, the speed and flexibility is certainly there, and there is a giant company behind MySQL now, providing “enterprise-ready” support.

The market is crying right now for MySQL database administrators. We don’t cost any more than Oracle or Microsoft DBAs, you know. Just a couple of years ago, very few companies hired MySQL DBAs. They hired developers who also did database administration, or a system administrators who also managed the MySQL server. Now, as the number of database servers increases and the amount of data grows they want real, honest-to-goodness database administrators. If you have production experience with MySQL server in any significant amount you will not have any problems finding a job. I don’t think this is going to change anytime soon. So, even if your company succumbs to the times, there are others out there who need your experience. Don’t be dismayed! (more…)