Archive for August, 2008
Hello Data Modeling, My Old Friend
About 2 weeks ago I was given the opportunity to step away from Flash and Flex and get back to the basics of application development: designing a database.
For those that don’t know me, I’ve spent my entire software development career before May of this year developing custom software solutions for a wide variety of clients. Being in a small team, this rendered me the opportunities to develop through nearly all aspects of the SDLC including designing a data model.
Previously most of my experience had been using Microsoft’s SQL Server, but now this time I’d been handed the challenge of an open source solution in MySQL. A few versions ago this might have caused me some minor heart palpitations, but luckily with recent versions of the product, there are a lot of creature comforts that I can work with thanks to the InnoDB storage engine.
Stored Procedures
This topic is easily debatable, and it especially depends on the architecture and scope of the application, but I am a very large supporter of stored procedures in RDBMS. The reason for this is a few things:
- They are compiled on the database server - meaning, an SQL string will not need to be passed every single time from the web application to the database server. This can increase performance by reducing the network load.
- Easy to debug - running a stored procedure from MySQL Query Browser (or whatever your flavor is) is far easier than stepping through a PHP debugger or dumping variable values, and this can in turn make the problem solving step far simpler.
- Separates web code from DB code - this is extremely important to me, and being able to leave the in-line SQL strings behind can greatly clean up and simplify an application.
Foreign Keys
It actually surprised me to uncover that foreign keys are relatively new to MySQL, and on top of that, the application that I’m in the middle of rebuilding the database for was built without any relationships between the tables at all. There is a good possibility I’ve been spoiled by a paid product, but I had assumed data integrity was far more important than leaving out such a vital component for so long.
With these features at my disposal I felt a little more comfortable diving into MySQL Workbench and creating a working database model. It’s one thing to build a model and improve upon an old product, but without the ability to form relationships between the tables and manage its data directly with stored procedures, it can be nightmarish.
My next task is to ensure the data migration (via stored procedure, I’ll plainly brag) has fit into the new site’s requirements and have retained all the necessary and previously assumed relationships between the entities of data.
To say this is a boring or stressful task would be doing the process a great disservice, but after spending so long developing RIAs with Flex, going back to the basics with some raw SQL and modeling an ERD, it has been a welcome change and has completely envigorated me professionally.
Here’s hoping I continue with more of the same.
*Updated - Information Privacy in the Era of Facebook
As the technology of the world wide web progresses, so does the need for more information from users in order to access these technologies. Social networking sites like MySpace and Facebook require that personal information be published in order to gain functionality to more services, like finding other people with similar interests or finding friends you used to know by alternate names.
Identity theft has been around as long as identities, and the rise of the internet gave thieves a gateway in which to perform the action on a massive scale. Now, major corporations are the ones collection the information and there’s hardly a true word spoken about where our information is going.
On Facebook’s privacy help page, they outline that while it is possible to deactivate your account and remove yourself from their active service, information is still stored:
However, we do save your profile information (friends, photos, interests, etc.), so if you want to reactivate at some point, your account will look just the way it did when you deactivated.
Although it would seems the information is more sticky than it really needs to be, there is a form that will allow you a one-click permanent deletion of your account - though finding this page within your Facebook profile settings may prove to be trying. For the sake of this article, I had to do a Google search.
In a recent article on ZDNet, researchers have found that Facebook is able to:
… track the buying habits of its users on affiliated third-party sites even when they are logged out of their account or have opted out of its controversial “Beacon” tracking service.
Which in turn adds to the controversy over the information that’s being submitted. Social networking has been realised to be a cash cow. As a user inputs more data about what they like, befriending people like them and posting info about general personal habits, advertisers are able to generate more related advertising content to them in a way that will greatly increase the chances of interest being piqued in a displayed product or service.
It should be surprising that web-based corporations are lying to the people that have made them billions, but it’s not at all. And in place of surprise, consumers are becoming angry and demanding answers about why their information is being distributed. Although it could be argued that if we have nothing to hide then we should have nothing to worry about, but that doesn’t entirely work given this medium. When your first and last name, birthdate, email address, and numerous other tidbits from your life start finding places in more and more databases around the world, it only increases the chances of someone breaking into these and finding a criminal activity of theirs to attach to your name.
It also appears that consumers are becoming wise to the greed for information. In a recent CBC.ca article:
Nearly half of Canadians say they have refused to give personal information to a retailer, according to a survey commissioned by the federal privacy commissioner.
It’s important for the average person to become aware of the world around them as more information becomes necessary to do simple things. Becoming educated on the changes and developments in the world around us is key. There hasn’t been a story in my local paper for some time about identity theft, but is that because it’s not happening or that it’s happening so swiftly and without detection that nobody is yet aware?
I can only hope our safety can be assured while preventing both criminals and government from invading my personal privacy.
Update:
Almost as if on cue, a few major stories broke today concerning your personal information. The first, is that eleven hackers who have allegedly stolen 40 million credit card numbers have been indicted today, with the story outlining that about nine major retailers had been the target of the attacks (and subsequent retrieval).
The second, was from a post I read on Slashdot this afternoon regarding the medical records of US citizens, in which the Washington Post explains how there is a booming business in selling medical records.
Both of these stories outline how truly serious it is to have your electronic information floating around, and everyone should be reading the fine legal print on any document they sign concerning their health insurance and medical disclosure policies.