Sometimes geek drive alone won't get you through
In the true tech spirit of why do something the easy way when you can geek out while doing it the hard way, I've been fooling around with MySQL.
My wife needs a way to keep track of her students including lesson times, instruments, contact details - enrolment basics really. Knowing I had completed an introduction to databases subject last semester she said "Do you think that maybe you could build a database for me?" I'm not ashamed to admit that if she had also whispered that in my ear, she could quite easily have had her way with me right there and then (unfortunately for me, it is likely while the resulting action would have have been hot and sweaty, that's more in the "Now, can you move the lounge over to that side? Oh, and hold this picture frame up so I can see what it looks like on the wall" rather than the forbidden pleasure type. Still, any attention is good attention, and it's the thought that counts).
After I drew up a basic relational schema, mapped out the tables and assessed just how small the database was likely to be, I looked at it closely. For a fleeting second I thought "this could be just as easily done in a Calc spreadsheet" (and yes, I do have a tendency to think in hyperlinks) but I was able to successfully move on from that moment of weakness to concentrate on the job at hand.
I had installed MySQL recently and tracked down some nice, idiot-friendly GUI tools as well when I remembered that the basic MySQL install is a CLI. I had accepted that my SQL was probably a bit too halting and lacking in confidence to enable me to finish this task quickly through raw SQL alone (the start of the school year is looming after all). I faffed about a bit with downloads and installs, but I was eventually able to get the GUI up and running and input the tables. I was even able to easily work out how to mark primary keys and link up foreign keys as well. This may not sound like much of an achievement, but my only substantial database experience was battling to make an MS Access-centric course compatible with OpenOffice Base so that I wouldn't have to go out and buy a version of MS Office. That did not prepare me very well for using MySQL, although SQLyog did make life much easier.
Entering tables, and setting up relationships is one thing - designing a UI for data entry is another altogether. I spent ages in my last assignment last semester fighting with Base and it's primitive UI functionality (Access is streets ahead of Base in this regard). I didn't relish the thought of trying work out if I could do the same with MySQL. If the general install preferred a CLI for designing the database, the chances were that it may not even have the capability to build GUIs for data entry. The more I thought about it, the more I became convinced that there was a very good chance that MySQL was designed to be used as a back end and that a front end would need to be designed using something like PHP, Java, Python or Ruby. Urgh. Clock is ticking after all.
Even if I am totally wrong (and please, drop me a line in the comments if I am) and MySQL enables an absolutely stellar user experience to be designed, I just don't have the time to find that out right now. Upshot of all of this? A geek attitude and spending time playing with options is not always enough to bluff your way through. Sometimes you really do need some experience and knowledge.
Over the next few days I'll be remapping the tables in Base and building a basic UI over the top. After all, the whole point of the database, besides getting me needlessly excited, was to allow my wife to keep a better handle on her lesson timetable. It defeats the whole purpose if she needs to come to me every time information needs to be updated.
I haven't entirely given up, though. Once it is up and running in Base, I plan to use some of my precious spare time to work out what I need to do to make a front end to MySQL. I've been gagging for an excuse to teach myself Ruby and Ruby on Rails, and this seems like as good an excuse as any. Now all I need is the spare time...



2 comments:
You will need some kind of front end.
PHP is fab, but you'll need to set up your box with Apache - which can be kinda tricky. But is a fantastic learning experience.
I recommend PHP and MySQL Web Development by Welling and Thomson
http://www.amazon.com/gp/reader/0672329166/ref=sib_dp_pt/104-1064360-6498318#reader-link
It's a snap when it's all together.
N
Just as I suspected.
I've heard good things about PHP but also bad, but I'll happily admit I don't know enough about it to judge either way.
I've also heard from a number of people that while PHP is great, if they were starting from scratch today, they'd learn Ruby On Rails instead. Everyone has their favourites I guess.
Either way, I'm going to have to set up Apache, which is fine because I want to learn how to do that anyway. I just don't have the time to set it up for this particular project.
Post a Comment