Friday, June 16, 2006

Bits and bytes

Sometimes I still marvel at the way things 'work' .... sometimes bordering on scary !
When I was a kid , I remember a show on TV were they showed how the human skeleton 'moves' as a person walks : man , did it look fragile ! I was wondering how the body is kept in shape by something so 'makeshift' :-)
When I used to see and read about human anatomy , heck ... anything and everything about human body , it used to freak me out.
The reason ? How could something which looks so delicate in parts work so well !
I mean , take a look at achiles tendon for example - you sever it , and you just topple and fall with almost no control over your feet : and the bloody thing is so exposed !

The reason I am mentioning my childhood 'fears' is that this is not something has been mitigated even now - though in a different way. When I abstract away components , I am more comfortable : it is not just the complexity that I am worried about - I tend to use only interfaces anyway ... it is this 'exposing internals so much that it is scary' that really freaks me out !
Dig in when you need to , but if the abstractions are reasonably good and performant , I tend to think of that 'module' as a blackbox.
For example , I consider the operating system or the virtual machine as a blackbox almost all the time ... and yet yesterday , for finding out how some stuff was implemented , I had to dig quite deep into java VM code ... and did it not freak me out :-)
Everything looked so fragile ! Peephole view to a complex design/system cannot be always good :-P

I did find what I wanted pretty early on (if you are interested - something about arrays and native code) ... but spent the next 3 hours trying to make sense of the whole thing (not that I completed it) - I will tell you one this , it is written by some awesomely brilliant and smart folks ...

Other than maybe in solaris , JRE + JDK (the parts I have been interested in) would be the the most 'neat' and wellwritten code I have seen at that level of complexity.
Netbeans , when I was working on it , tended to be more messy from a design point of view : though I did learn a lot from it too !

By the way , in case you are interested , take a look at these :
http://blogs.sun.com/roller/page/dagastine?entry=java_is_faster_than_c
http://blogs.sun.com/roller/page/dagastine?entry=sun_java_is_faster_than

I do not use benchmarks too much - depends on a hell lot of factors : esp when comparing different platforms , but it is interesting that java has managed to come so close assuming reasonably level comparison grounds.

As a parting thought , consider this :
Assume a multi-user chat (chat rooms) of 100 participants - so , for each message that goes into the server (from a user to the chatroom) , 99 will go out at a minimum (from chatroom to participants). Consider the processing and bandwidth implications of this.
Now , extend this to a common server feature hosting say 20k users concurrently , and getting used by a lot of the users ... some of who are in multiple chat's.
Interesting ?
Now , extend this to a server pool of say 8 nodes (a pool of servers all acting as a single server to the external world but on different machines to increase scalability , blah , blah) - each server hosting 20k approx ...
Consider the memory/processing requirements , the inter server node traffic , the communication with the clients , the routing considerations.
Interesting huh ? :-)

Personal goal : make it scale to atleast 128 nodes server pool on run-of-the-mill boxes each serving about 20k users concurrently.... let me see if we get there :-)

0 Comments:

Post a Comment

<< Home