Archive for the ‘Programming’ Category

Reducing my work

Saturday, January 30th, 2010

It hurts me but like any other person with responsibilities we need a source of income and just working on this project doesn’t guarantee me money once its released or pay my bills (yet). I gave it some thoughts, well, there wasn’t much to think of-just “well… just focus on a job”, etc etc.

It’s also quite frustrating, because I had other ideas of a few projects I wanted to take on. Yet most of them are extensions for OpenType Threads. Yet I won’t start talking about it after I finish the prototype of the forum software. One of the things I haven’t taken into account is the upgrade of extensions/forum software and most importantly the import of other bulletin board systems into OpenType Threads. I won’t bother with such thing yet, the design comes first.

Now to get a job or something =/

Designing your database, sometimes its more than just a storage

Thursday, January 21st, 2010

Sadly, I’m catching a cold. I seriously hate being sick, all my motivation goes to nada. Yet I wanted to post on this subject, while I’m not going to get all specific and detailed about it. I will mention basic factors of designing your database. I have this book I bought on the many programming books I have, it was requested by my professor to use it in our database design class but we actually never got to use it.

Now it bothered me, I don’t like buying things without a purpose so I opened it to apply things I learnt in my project. I did learn a few things about database designers, they are divided in two tasks, one is to design the database and the other is to check engines and worry about all physical files and how they are going to be managed. And so on, since it had this overwhelming history of flat files. And it got me to thinking of PHP and some developers.

While I love so much PHP, it’s disheartening to see many people just to rush over the project start assigning all kind of unneeded data types. Let’s be realistic, many people use Int over Medium Int because they “foresee their application passing over a range of 9 millions”, to actually reach that amount it will take years unless you spend an insane amount of money in promotions to get all kind of traffic. You can’t be a microsoft or a google in a year.

It also makes me glad in a way, this mistakes generate jobs, didn’t  you know? Because the buyers who hired those kind of people and made the database design shaky, don’t know why their page is slow or why their query is so slow. By putting a higher range, it means more work for the database engine.

Don’t go adding all type of indexes, just the ones your APPLICATION use most of the type. Like for example we got our auto-incrementer primary key (id), it is UNIQUE so MySQL will check UNIQUE ones first than non-unique ones. Or if we got lets say (categoryID, attachmentID) we got non-unique IDs, but they are mostly searched in a query statement.

Secondly, while I won’t probably real-world examples. A bad design can lead the web application to become a nightmare to maintain or add new features because you will end up refactoring or worst, re-designing your database.

Read this page, it’s from MySQL’s documentation. It’ll be a guide to you if you are designing the database using that database system.

I was thinking, after I release OpenType Threads, oh boy I should be prepared to receive a rain of complains. And shield myself from patterns fanboys. Oh, and I started to like Ruby and Javascript syntax, it’s quite… fun. And now, making extra code to support other browsers is NOT fun.