Linux distributions explained
RT @thibauld Linux distributions explainedWhile cleaning my disk, I found a presentation about Linux distributions and the challenges they are facing which I did about 2 years ago. It is pretty unique since I gave this presentation only once during a 1 day training session I gave to Canonical OEM sales team. This presentation is particularly interesting as it graphically explains what is the work of Linux distributions and their challenges. Being an Open Source enthusiast and former Mandriva (Mandrakesoft) employee, this is a subject I know pretty well so I thought I'd share it with you. Hope you'll find it useful!
Introducing allmyapps!
RT @thibauld Introducing allmyapps!If you follow this blog, you probably know that, last august, I accepted to help develop freelancebusinessclub's new website. Three months later, on November 3rd, the new website was launched! Since then, after having squashed the small little bugs left, I started working on another project, my project. It's something that I've been thinking about a looooong time ago, it took me several years (really!) to mature it and, having completely recovered my technical skills, I thought it was the right time to make it become a reality.
Feeling that the market has reached a point where my project finally makes sense, I'm proud to introduce you to my new baby : allmyapps, the first linux app store designed to help users find and install new applications on their Ubuntu Linux system.
To fully understand this project, you need to know that I'm a long time Linux user and evangelist. I started using Linux in 1998 (with a slackware) while still in high school and I've always been convinced that Linux would find its way to the desktop sooner or later. There are 2 factors in particular that make me think that this time has come:
- Canonical and Mark Shuttleworth's vision is, by far, the most important point. In my opinion, the biggest reason of the Linux Desktop relative failure til now is lack of willingness from the major Linux players. Let's face it... who, today, really works to make the Linux Desktop a reality? Red Hat? They purely and simply abandonned this market. Novell? They only considers the enterprise desktop... The only company really working towards making the Linux Desktop a reality is Canonical, Mark Shuttleworth (its founder) being committed to put the Linux Desktop into everybody's hands. And it's not only words! In the past months, Canonical has hired usability experts, desktop experience engineers... and the company is really working, both technically and commercially, to make the Linux Desktop happen. Unlike everybody else, they're not waiting for the market to move but are working to make it move!
- The netbook opportunity. Did you see the laptop market last year? People are fond of netbooks: 14 millions of netbooks were sold in 2008, with around 30% of them preinstalled with Linux! For the first time, normal people (unlike you and me) are using Linux and loving it. Do not trust the rumor that says that the return rate is higher with linux netbooks as it is simply not true. Linux price and versatility is a strong asset when it comes to run machines with low spec and sell them at a low price. Netbooks are a great market opportunity for the Linux desktop! For the first time, "normal users" are buying machines with a Linux pre-installed on it.
With the rise of the netbooks, more and more users today are confronted to a linux desktop. While using the system in itself is not a problem for most users, I've experienced that people tend to have a problem when it comes to finding new applications to install on their system. On the contraty to Windows systems, Linux systems historically have a very easy, quick and reliable installation mechanism, thanks to their centralized repositories and their associated package management systems. The only drawback of this mechanism is that it is different from the one users are used to on Windows... and it's a big drawback because users are getting lost... and lost users quickly turn into angry users! And the last thing you want is your users becoming angry! With allmyapps, we want to address this very specific issue.
I will probably not be blogging much about allmyapps on this blog. If you want to follow the development of allmyapps, I advise you to subscribe to allmyapps' blog. I will continue to write posts on my personal blog (this blog), I already have a few posts waiting about web application debugging / profiling and web application performance tuning... so stay tuned!
To conclude this post, I just wanted to say that we will be attending Recked in Amsterdam on monday 26th of january (today!) and then FOSDEM in Brussels on february 6th and 7th. If you'll be there too and want to meet, just leave me a comment!
Ubuntu Party this weekend!
RT @thibauld Ubuntu Party this weekend!Just a quick post to let you know of the Ubuntu Party that will take place this weekend à la Cité des Sciences et de l'Industrie. I don't know yet exactly when I'll be there, but I'll sure be there
See you there !
Web application implementation step 1: choose your weapons!
RT @thibauld Web application implementation step 1: choose your weapons!During the next series of posts, I will describe the different steps involved in building a web application. These posts will only deal with the technical aspects of implementing a web application that has already been designed. Web application design is another subject which I'll develop in another series of posts.
I'll take the new FBC website as an example. It is a good example as we almost had to start from scratch to build the new version. Indeed, the architecture in place was extremely inflexible, the worst being :
- Webpage layout relied on field values in SQL tables
- 1 url <=> 1 php page containing everything from HTML to SQL
Functionally speaking, their website was working well but it had been at the expense of countless hours spent testing and testing and retesting that every process was functional. But now they were stuck... Only changing the graphical chart would have needed to go change *every* php file and restest the whole thing entirely... When I saw that, it was obvious that it would take us less time to rebuild the entire architecture from scratch and then add the new features than trying to work on this extremely rigid and non evolutive code organization. Of course, we would need to reutilize pieces from the old code in order not to re-implement the business process, but it was pretty much everything we would be able to reutilize.
So the first step when building a web application (and not a website) is choosing your weapons, that is the technology stack you're going to build your application upon :
- Which OS are you going to use ?
- Which webserver ?
- Which database ?
- Which programming language and framework ?
Choosing the OS
I'll not elaborate on this one, use Linux. The only reason I can see for not using Linux are :
- you know nothing about Linux and don't want to learn
- you were asked explicitely not to use Linux
- there are obvious reasons which require your app run on another system
If none of the above matches, choose Linux. And among all Linuxes, if you have no preference, I'd personally go for a Ubuntu Server LTS (Long Term Support) which is free and provides security updates during 5 years. Just check that the LTS does not end next year
The current Ubuntu Server LTS is version 8.04 (code name Hardy Heron).
Choosing the webserver
Again, I'll not elaborate much: Apache 2 as it has proven capabilities to run high traffic websites, great documentation (official and non official), lots of modules availables... etc... There are other webservers but, unless you want to restrain it to very specific tasks, use Apache to serve your dynamic pages.
Choosing the database
I assume you want an Open Source database here. It's hard to choose here between MySQL and PostgreSQL . PostgreSQL is probably more powerful but it is also probably a little harder to get into. For example, the fulltext search in MySQL in a lot easier to use than in PostgreSQL but PostgreSQL's fulltext search allows you to perform more complex queries. In the same spirit, MySQL provides handy but limited functions (ex: GROUP_CONCAT) where PostgreSQL offers you less handy but more powerful equivalents (ex: array).
Both database has a good official documentation but I think MySQL benefits from a lot more unofficial documentation compared to PostgreSQL. In terms of proven capabilities, both have examples of usage in very demanding contexts...
Finally, the choice is up to you BUT if you use MySQL, do not forget to use InnoDB tables instead of MyISAM tables. By default, tables are created using MyISAM. Using MyISAM table can be a good choice but it must be a known choice. Indeed, MyISAM table does not support FOREIGN KEYS nor does it support sql transactions so it is very limited and will inevitably result in added programming overhead if you build a complex web application upon MyISAM tables.
Choosing a framework
Rule 1: be skeptical
First, you should not use a framework for the sake of using a framework. Instead, you should really think at what you expect from your framework. I'm personally a bit skeptical about a lot of frameworks because, in my opinion, a lot of them end up being bloated, trying to reinvent the wheel and with finally a limited number of really useful functionalities. Keep in mind that using a framework is a binding investment: First it needs time to learn how to use it efficiently and, second, it generally deeply affects your code. So you'd better choose your framework well if you don't want to loose a lot of time !
Rule 2: know why you need a framework
Beware of frameworks that try to provide a solution for every aspect of your application as they are likely to belong to the "bloated" category! I personnally prefer a framework which focuses on doing 1 thing right than a framework that tries to simplify everything. For each functionality, ask yourself : "Do I really need my framework to do this ? Will it really help me be faster in my work ?
Rule 3: Beware of marketing crap
Here are examples of marketing functionalities I always consider with skepticism :
- i18n support (internationalization): In which way is it better than gettext ?
- RESTful URLs: You mean Apache URL Rewriting (and optionally a routing index.php) ?
- Easy Ajax: I did not know Ajax was hard to implement on the server side! Are you looking for a Javascript framework ?
- Full database abstraction: This one must be considered really really carefully. Database design is one of the most crucial part when you build a web application. In the same manner, how you query your database has an enormous impact on your application performance. This is why I am really really skeptical when it comes to delegating the database management to the framework. Some frameworks even create the database for you! Unless you're talking of a very simple web app, I think it just does not make sense... The only explanation I can think of is that a lot of web developers have a very little knowledge of SQL and, for them, it's easier/better to have the framework handle the database. On the other hand, it is also true that that database abstraction (especially ORM) are useful to handle all the simple queries. As a conclusion, concerning database abstraction, I would only use one if I'm sure that it's flexible enough to :
- Work on top of the database schema I designed
- Let me perform raw SQL queries when needed
I see a framework as a toolbox to help you concentrate your efforts on implementing real business code. So what can you expect from a framework ? A templating system, a caching system, a testing / debugging framework... All of these are very useful functionalities that a framework can offer because coding them would sure be a waste of time!
Choosing a programming language
There are a lot of very good languages for web programming (PHP, Python, Ruby...) and I can see a few differences:
- Framework compatibility: Once you've chosen your framework, you probably already know the programming language you'll be using.
- Quality and quantity of documentation: I think PHP has the best and most comprehensive documentation, followed by Python and Ruby.
- Library exhaustivity: Again, in my opinion, PHP has the deepest library available, followed by Python and Ruby. You should check beforehand that a language has all the required library for the app you want to implement. For example, if you plan to use SOAP based webservices, you probably want to avoid Python as (last time I checked) it has one of the most limited SOAP library. PHP, on the contrary, has a good gsoap compatible SOAP implementation.
- Familiarity with the language: One of the most important criteria of course! How productive are you with each language ? Even if all of these languages are relatively easy to get into, mastering a language takes time... so if you're a Ruby guru and have never used PHP, then you're probably better off with Ruby...
- Language beauty: Sorry guys but this is unfortunately NOT a good criteria. Had it been, then I would have rated Ruby first, then Python and then.... far behind, PHP
To conclude this long post, I think the most important rule is :
Use production ready technologies which have proven to be performant in similar contexts
Each time you have to choose a technology stack, no matter what it is and what bloggers and/or developers tell you about it, find relevant examples of web applications using this very stack to be sure, provided you do things well, the chosen stack will be able to fit your needs (performance, scalability...).
Stay tuned for the next post where I'll talk about the technology stack I've chosen for FBC!
