Tuesday, August 27, 2013

MySQL 5th Ed.


MySQL Fifth Edition
Developer's Library
Author: Paul DuBois
Published by: Addison Wesley

With a new database project in the planning stage I settled on MySQL for my data base manager. MySQL switched to InnoDB as the default search engine starting with version 5.5. Since InnoDB introduces some primary differences in design and performance over the previously used MyISAM, I thought the latest version of the “MySQL Bible” should be a requirement.

Indeed this change brings a major difference in the way indexes are created and stored. This could cause problems in a large complex database like I'm planning. DuBois does an excellent job of highlighting this difference and how best to accommodate it in Chapter 5 of the book. He continues with extensive treatment on using indexing for maximum benefit and minimum cost. My highlighter got a workout in this section.

The MySQL default data directory is under /usr/local or /var/lib which on my computers are on separate partitions fixed in size. This could become a problem as the database grows. My personal preference is to keep database files in a /home/sub-directory. Since I keep /home on a separate drive it is then somewhat protected against accidental deletion during installation of an updated or different version of Linux. In Chapter 11 the author goes into considerable detail on the location and structure of the data directory. Though I did have to go to a different source to find a sure-fire method for changing the default location.

My planned database will be accessible by other users so security is a major concern. Chapter 13 starts out with a section entitled “How to Steal Data” which can be rather unsettling. The author then presents detailed step-by-step instructions on setting tight permissions on all related directories and files. Many of which I would never have thought of securing. The author also covers MySQL user and administrator privileges in great detail. As with any system, it is important to note that the security is only as good as your passwords. Of course if your root password is compromised nothing is secure.

Lastly, after designing and setting up my database, much of the inputting and accessing of data will be through other software and scripts. Chapters 7, 8 and 9 cover writing programs in C, Perl and PHP respectively in considerable detail. I'm sure these pages will be thumb-worn and full of margin notes in due time. Sadly, however, the author completely ignores the widely popular and my personal favorite Python language. Though there are numerous resources on line, hopefully the author will consider include a chapter devoted to Python in later editions.

Finally Chapter 14 addresses my personal weakness by outlining the procedure for regular secure backups of your data base files. You can use either mysqldump command or with a binary backup. One piece of sage advice here is to store your backups on a separate drive or even a different computer to to avoid a catastrophic loss. The chapter is a good reference for backing up all your important files.

In the net I found the book invaluable in understanding the inner working of MySQL for designing and building my database. This I'll keep it close at hand as I flesh out the structural details and set to work at my keyboard. Later on it will serve as a primary reference on SQL syntax and query structure.


Friday, August 16, 2013

They're Back!

I first blogged about the Cicada Killer Wasps back in 2009 when a half dozen dug burrows in our front lawn. They've returned to do they same each year hence. In ever increasing numbers!

Two years ago we had our in-ground swimming pool removed from the back yard. The contractor filled in the hole and topped it off with so-so quality top soil. Consequently the new grass has taken some time to establish a good thick turf. Meanwhile the wasps have found this area ideal for establishing their nest burrows.  Literally hundreds of little mounds of excavated soil dot the landscape. It is unsightly for sure to say nothing of inhibiting the development of a the luxurious carpet of lawn to which every suburbanite aspires.

Well, they're back again this year doing their thing. They find cicadas up in the trees and paralyze them with a sting. Then gripping their prey under their body fly down to their burrows to stow them away and deposit their eggs in them. Gross eh? Occasionally the wasps will miss the bare landing area by their nest and being unable to take off with their heavy load they have to struggle though the grass to make it home.

Suddenly the bluejays returned to the yard after more than a month's absence. I noticed the jays will sit on the fence or clothes line poles and occasionally make a quick visit to the ground. What are they after? When it spots a wasp trying to drag its booty through the turf the jay will swoop down knock the wasp over and steal the cicada. Quite the opportunist.

“You can observe a lot by just watching.”
     - Yogi Berra
    


Saturday, May 18, 2013

Dont't Tread on Me!

Yesterday I watched a portion of the broadcast of the House Ways and Means Committee hearing regarding the IRS alleged targeting of conservative groups and individuals through intimidation and harassment. I came away saddened and ashamed that an arm of my government would so flagrantly trample upon the rights and freedoms of its employers -- the people. Our nation, which holds itself up to the rest of the planet as a symbol of freedom and liberty for all now has a big glob of egg on its face.

The idea that we periodically elect (or re-elect) officials and representatives to manage the affairs of our great nation in the best interest of ALL its people has become a farce. We have become increasingly like any third rate banana republic with a government that will use its power primarily to stay in power. The whole idea that federal and local governments are constrained and limited by the articles and amendments of our constitution is becoming more and more vaporous.

All that said, there is something causing me even greater concern and trepidation as the future unfolds. That being, throughout history governmental regimes built upon the charisma and seductiveness of a single individual rarely end gracefully.

"Don't tread on me!"