Archive for the ‘Articles’ tag
Linux Myth Buster: What is difference in Server and Desktop Linux?
Disclaimer: This article is too long! This was done to explain lots of historical information which lead to this question. If you are not interested, you can skip to ‘Actual answer begins here…’ section.
Why this question is here?
Linux has been part of my technical life since 2001. I have seen Red Hat Linux 6.x early releases and fall of Red Hat Linux. Rise of Fedora and birth of Ubuntu. This whole journey is very interesting and enjoying in its own way. Linux is today having a position which is not dominating but surely challenging! Linux is not having aim to replace every desktop in the world (… some might say it just can’t!) but surely its putting a smile on people’s faces who have used it for a while. You can’t just put Linux out of the door and wait to disappear, the small tiny tux is now having a great foot tapping parade of people and organizations which will do whatever they need to make this tux growing!
I have been asked a question many times by my friends and colleagues who are new to Linux or just want to learn Linux. They started the question with, “Sachin, I have a stupid question…” this was always one of questions which I answered very religiously. The only reason I never made any nonsense while answering this question was, they were new to Linux and slight wrong answer might put a wrong foundation about Linux Information in their minds. My friend Ashish suggested me to write a blog post about the same so that, people can get right information.
The question is not at all stupid! In fact, most of people don't know the answer and they hesitate to ask this. I would request you to read the whole post and if you have any suggestion or question feel free to post a comment about it.
In technical terms, Linux is simply a ~2 MB sized binary file which has all (…almost all) the stuff necessary to manage file systems, networks, processes etc. Usually Mandrake, SuSE, Fedora, RHEL and all other popular Linux flavors contain this ~2MB binary acting as heart and soul of their distribution. Remember the italicized word in last sentence; we are going to come back to that word shortly. You can obtain Linux in pure form from Kernel distribution site. That’s most pure and raw form of Linux. If you follow all the instructions and put lots of efforts (although targeted audience is not supposed to do that) you might get a text based console at the max!
Remember the word we italicized? Distribution, yes that is a very important term in this world! Since, Linux started way back in 90s and it was free, people started experimenting with it. People wrote tons of applications which could be run on this robust and naive platform. Most of the applications were coming out of university students, startups, research laboratories and programmers who are dying to try new things! This created a huge sea of application, system, utility software which was unmanageable. Clearly, an effort to make Linux easily adoptable was necessary. This problem lead to a solution called as Distribution. The idea was great because of its simplicity. People started delivering Linux along with few must have software nicely wrapped around with a GUI and installer. This contained system, utility, programming, internet and other software categories. A beginner had all things nicely wrapped which were needed a beginner. Soon, the distribution size exploded from few hundred megabytes to 4-5 gigabytes and the size was growing day by day. Tons of software was coming as part of default bundle which was not at all needed by a normal user. To address this chaos and make Linux more targeted to audience, people started creating their own customized distributions! This lead to Live CD, business, small and large sized distributions! Each distribution was targeted for an audience with considering their need of software and applications. Nothing got changed; still a nice GUI and rock solid base functionality was supported. Each distribution (a.k.a. distro) was addressing a very specific problem. There are around 1000+ distributions available to date at the time of writing this post, refer to (distrowatch).
Actual answer begins here…
Linux was really easy to configure and creating a distribution was real fun, which lead to “Problem of Many”. There were unlimited options and unlimited configurations! This created a great amount of chaos and making impossible for new comers to figure out which one of these 1000+ distributions they can use for day-to-day use or what they should use to install a Linux server. When, any organization was supposed to install a Linux powered web server, a ‘Super’ developer used to spend around a week to either create a really custom version of Linux. This used to be based upon some out-of-box distribution which matches close to their criteria. If this doesn't work out well, organization will pay hefty amount of money to purchase Enterprise Linux from vendors like Red Hat or SuSE. Commercial software vendor were giving 24x7 supports and other business terms which were comforting to organization which were new to Linux. Today or another day this was supposed to happen. (Let’s leave the topic here as this might be a good discussion over Slashdot)
In simple terms, Linux is a simple binary. Distributions are nothing but customized suite of application, system software which is solving some business, personal computing problem for most of the cases in ‘out-of-box’ fashion. Server and Desktop versions of distributions are nothing but different set of software packaged together. Yes, that simple it is! Just another distribution might be called Server Linux and others might be called different names as well.
Ubuntu, Kubuntu are today’s most popular Desktop versions of Linux distributions (from my perspective). Ubuntu as well releases a server distribution with same quality of bundling and support.
What can I expect from a Desktop distribution?
You can expect all the functions (perhaps much more than that) supported by a Installed and Configured Standard Windows box from a Linux Desktop distribution. This includes E-mail client, Internet Browser (Mozilla Firefox etc.), Media Player, Media Browser, Games (basic), Network support, Office and Productivity suite etc. There are tons of other features coming which you just need to explore.
What can I expect from a Server distribution?
If you are planning to host a web server which can run database applications written in PHP or Ruby then perhaps this is the distribution you are looking for. This includes Telnet, SSH, FTP, Web and other remote servers. This includes few server applications which are normally needed by web administrators. In all normal cases you don’t need this distribution as you don’t need most of the applications in your day-to-day basis unless you are geek.
I am still confused, which one is right for me today? Will I miss something if I choose a wrong distribution today?
Hell No! There is no such phrase called as ‘can’t happen’ in Linux world! If you choose a desktop or server or for that matter any distribution, you will be able to install any application which can run on Linux. Let us take example of standard desktop distribution of Ubuntu. If you installed the standard 1-CD installation and then want to host a web server, please go ahead. You can always find very nice and friendly applications like ‘Apt’ and ‘Package Manager’ which will help you to install web servers, database server, FTP or SSH servers without typing a single command! You can just click the mouse, make sure you are connected to internet and choose any software from repository of ~25000 applications available for Ubuntu! Doesn’t it sound simple and great? So there is no problem in beginning with any distribution of your choice. There might be few distributions which may not support ‘Apt’ but they might be having some parallel application which does the same job. SuSE have ‘yum’, Red Hat has ‘up2date’ and others have similar tools. You just need to find tool which runs in your distribution.
Thank you for reading a lengthy post. Please help me if there is anything which needs rectification.
Rhino, BeanShell comparison
Update (22/May/2007): I have also included Groovy performance as per Tom's comment. The post is here.
Recently I got a requirement to provide scripting capabilities in our product. A while ago, I was reading about JSR 223 and thought to have hands on the scripting capabilities of Java. While searching Internet I came across a page which states number of programming languages for Java VM. The most appealing options for me were Rhino, BeanShell and JudoScript. Ofcourse Groovy, Ruby and others are good too, but I wanted a simple and close to Java scripting for my product.
To get a quick start, I chose Rhino and BeanShell. JudoScript sounded like lots of in-built capabilities and since I didn’t want a Swiss-knife kind of thing with me so I chose to go with generic approach of Rhino and BeanShell.
In our case, developers will write some small routines to process sql resultsets. Typically the operations will be getting values in different columns or creation of sets etc. So my job is to provide a framework which takes sql queries dynamically and pass on the resultset to script. Script will process resultset and return the Lists or HashMap to framework again so that further processing can be done. So from my perspective resultset processing abilities was a winning point. For those who are more interested in computational performance analysis, I hope they will love to see this page.
Coming back to data processing capabilities, I set a simple test case with following steps:
- Get Resultset
- Note start time
- Process Resultset using Java / Rhino / Beanshell code.
- Note end time
I kept number of records as a variable in all of the executions. Thus I wanted to see the effect of increasing recordset size on performance. I started with 50 records and final reading was taken at 50000 records. Result of tests is as follows -
To help you understand clear the tabular representation of above data is -
| Num of Records | Java | Rhino | BeanShell |
| 50 | 31 | 375 | 250 |
| 500 | 110 | 391 | 453 |
| 5000 | 359 | 844 | 1391 |
| 50000 | 2375 | 5515 | 11406 |
On your machine the figures may vary a little bit but the ratio should be roughly same. BeanShell's performance is dropped suddenly with the larger size of record set. On the other hand Rhino performs consistently and balances better with the size record set. For Java the ratio for 50:50000 records is 1:37 but for Rhino its 1:15. For Beanshell same ratio stands as 1:45! This clearly shows that there is consistency in performance of Rhino compared to BeanShell.
Although Rhino is winner from the performance perspective, I need to admit Beanshell is homely for Java developers. The communication between beanshell and java is almost seamless. For Rhino you need to understand Scope, context and little more Rhino specific things but for BeanShell there is no complexity. So from simplicity perspective I vote for BeanShell.
My advice to others will be, there is not much difference in both of the scripting engines. Normally neither we process (or at least not supposed to process) 100000 element sized lists nor so big datasets. So its mere matter of choice for majority of users. Go with BeanShell if your end-user is a Java Developer as its very easy to understand the operation and there is very little learning curve.
If you like JavaScript or needs millisecond accurate performance guarantee then choose Rhino as it proves to be consistent. I didn't get chance to test E4x and other features but overall Ecmascript 4 is good. I will love to hear any other experiences regarding above two or any new engines.
Like New Reader Feature
Ever you wished about a feature in product and it happened right away? How quick? Well in my case it took 7 hours flat! Yesterday night before sleeping, I tried to organize my Google Reader subscriptions. I wanted to categorize them with labels. Man, that was real pain!
For each label it will say "Fetching you subscription list" and the pane size keeps on changing. That was really painful for me to arrange my reading list.
I opened my mail editor to send feedback to Google Reader that I want you to make it simpler! But I didn't send the mail and fall asleep. I wake in morning, go to Reader and amazingly I could see the screen below
Man, that was quick! I happily organized the reading list and I have decided to be with Google Reader for some more time.
Kudos to Google team.
Open Standards
I read today about new protocol for reading and writing data on web. Google has put the client libraries and other information on their website. I really appreciate the style of Google for providing open standards as well open application interfaces. We all know that Google earns a huge amount of money from their Ad programs but still, they are doing many things for free. Their every effort to make the web better place is clearly visible. Take example of their vast range of applications, (Gmail, Calendar, Spreadsheet, Reader, Suggest, Maps...) all applications are wonderful and I love them. Undoubtedly they brought the Ajax wave to mass. Many people were using XMLhttp before Google too, but it was not to masses, Google not only made it visible but they demonstrated how you can really simplify the applications!
Similar things should happen for quite long from now. We need help from giants on the web. They need to help building and realizing the open standards so that Web 2.0 and subsequent versions of it will be much more powerful than anybody has seen or imagined!
Are we ready for Web 2.0?
Hushhh... last week was a real rough! Got some time to breath and felt to write a post. I am currently developing software which has a web-based application component. We tried to ajaxify it to give better user experience. We did it really well. There is lot of buzz going on since last few months around Ajax. Ajax is going to play a vital role in Web 2.0. In this post I would like to shed some light on Ajax only. Before we go too ahead, what we need to think is, are we really ready for this?
Ajax gives a very rich experience to user. Ajax gives richness of web and feel of desktop applications in true sense. While development, I felt that we are not that ready to hit the road. The first and foremost important thing is, the platform which runs the Ajax i.e. browsers are not supporting it natively. If browsers provide a clean abstract level implementation of Ajax then a new developer will not get confused by tons of different frameworks. Instead of number of frameworks, we need native support for Ajax and similar things. That will save lot much efforts of developer and in turn it will allow us to concentrate more on the business logic.
GWT (Google Web Toolkit), Tibco GI, Echo2 and Laszlo DHTML are good efforts towards simplyfying the development cycle. Still, Echo2 and Laszlo needs server side runtimes and GWT has better still Java based approach. I will really appreciate if IE or Mozilla support the Ajax just like form handling or any other task in the JavaScript. There shouldn't be any headache to handle responses, marshall / unmarshall the XML etc. XML responses should be handled properly.
The fact still remains that there is huge compatibility issue with JavaScript. ECMAScript 4 standard is out and I don't know why browsers don't support it. Flex people were successful by implementing the ECMAScript 4 standard natively which supports E4X, the new way to handle xml, and other many powerful features.
Now I am not interested to start any flame war or address to JavaScript machos who will say Ajax is simple though. Still majority of people find it painful and we run into trouble many times.
To be really ready for Web 2.0 we need Web 2.0 ready web-browsers. Instead of handful of frameworks we need native support from browsers. ECMAScript 4 should be supported by all leading browsers. Most of all, I plea to Microsoft for not making their own standard for browsers. That really creates huge application portability issues. If they really want to create own standard then let it be public so that other people can get benefit out of it!
Peace.

