Tuesday, August 07, 2007

Database Table Size Calculations

As a professional Developer, every once in a while you'll need to create a Database, for one reason or another. It's always nice to apply structured thought to your design process and work out your proposed database size before who release it upon the unsuspecting database server.

It's kinda obvious to do, but just in case heres how i do it.

First create your data dictionary. In my case it was for a questionnaire management system, (QMS, might release it as OSS when i'm done).

i wanted to dynamically generate a new table for each questionnaire, so i need to work out the system limits before hand.

first we would have our "user id's"

id - UInt
hostName - 128 byte (unicode 64 character string)
ip addr = 15 bytes (it's ip v6)
assocQuestionnaire = 4 bytes aka 32bit unsigned integer

then depending on the questionnaire you could have upto 32 questions/ comment, (32 columns). These could then store upto 1024 characters so thats basically double in UTF-8, so 2048 bytes, bringing in each row at almost 65Kb, now the company i work for has 40 000 members of staff, so lets assume they all anwser the same questionnaire (Great advertising for me), the database would swell to 2.5 Gb!

Well i think thats sight over kill, so by tweaking the the system to only implement the larger fields when requested by a user, and assuming that they only want one comment field per questionnaire, we get a much more wholesome figure of 100 Mb.

So to summerize the formula is

sum( column types ) * num of rows.

Remember this is only an estimate, and doesn't account for the master tables or relationships or any of that other RDMS goodness. So it's a guide not, E=MC2

Jonathan

Saturday, August 04, 2007

Display Madness

For once i have a little time, which makes a huge change. In the last hour or so i've been exploring my options around getting a new display to help support my Mac lovin life style. However what should be a joy filled ride through the online e-commerce world, is turning out to be a little less simple then i had imagined.

I have a budget of around £600.
My current setup is two 19" @ 2560 * 1024

However there is a major problem with my current setup, My Blackbook only supports one display. However with a little box from matrox it can support two, but at a maximum resolution of 1024 * 768 each or 2048 * 768.

Current i share the setup with my nix box, but that is getting axed (Yes blu-ray is dead/dying) in favor of consolidating all my development onto one physical machine, and running nix, solaris, windows via parallels.

Now normally i would the following choices given the price.

2 x 22" displays (3360 * 1050)
1 x 24" display ( 1920 * 1200)
1 x 27"
1 x 26"
Now two 22's would be nice, not only cause because it's big but it's also a Jay-z song(well in reverse)!

Now based on current machine specs i've actually got three choices
1 x 24" display ( 1920 * 1200)
1 x 27"
1 x 26"

These are all below my current resolution, so maybe it's the machine that needs changing ...

Ok, lets do the math

Macbook pro (legit) £1149 with student discount
2 22" displays £ 500
matrox dual head to go £140

total £1700!

sweet price point, not. What makes it worse, is that i love the macbook's form factor and would hate anything bigger. ie MB pro.

Plus for that price i could get a mac pro which i have often considered and drooled over with phil. (the computer not phil).

The other solution is to build a osx86 machine, however as developer, and with Leopard coming doing all my work on a unsupported, illegal, in-frequently updated, hacked platform strikes me as dumb.

So that leaves the single units

All of which mean i lose about 1/2 million pixels, and a couple of inches.

Heres the price breakdown
24" £430
26" £ 500
27" £ 680

So on price the 24" is a winner models in that range, that have 8bit color panels, good response times, and adjustable stands, and multiple inputs are ...
Dell's 2407wfp
Benq's 241 wp ( HDMI included!)

On the 26"'s there is one that i know of
Acer 2604
It's got a crapy stand, and no Digital inputs, infact it's only got a VGA input

And then there is 27's

Dell 2707wfp

Which is basically the 24" dell with a phat-er panel and no rotation. And a pixel pitch closer to a 19" lcd (0.294 vs 0.3)

Now we consider the pros and cons of the 24 vs 27

1. I have personal issues with spending seven bills on a lcd display, that i don't really need while people starve to death, and go to war over food.
2. The pixel pitch of the 27 is ideal, the high pixel pitch of my 19's is why i sprang for them over the 17"'s.
3. No rotation, how do i show off those cool XGL effects without being able to rotate the display as well!
4. Both give me less working resolution then i have currently.

Conclusion...

I'll wait to see if apple brings out a super notebook next week, that razor thin macbook pro that all mac geeks dream about, and if it's what i want i'll upgrade.

BTW

i recently bought my name (www.jonathandalrymple.com) as well as a couple of domain names for some projects that are in the pipeline.