Merb Rules
Well I came across a “problem” the other day in Rails. It turns out that Rails is not exactly thread safe at the CGI level. What this really means is that it waits for a file upload to finish before another can happen, which for a busy file uploading site is not actually good. But, since I have read that this is not as big of a deal as you would have thought if using Mongrel because it magically handles multithreading requests and only offloads the request to Rails once it has finished, meaning that it is only blocked whilst being mime parsed etc, which is not that bad. But whilst thinking oh shit I came across Merb, which is another Ruby framework that is really cool and extremely lightweight meaning its nice and fast. It also allows you to pick from a selection of ORM providers such as Sequel, Datamapper and of course ActiveRecord. The main advantage is that it has its own CGI handlers and effectively handles multiple file uploads concurrently which is big benefit.
This does not mean that I am now going to switch over to Merb – infact not a chance. Rails is now very very good at what it does and has a million plugins that are very useful (most can also be used in Merb) and it is very useful for the actual application side of the system. It has so many useful features that its hard to explain them all. But it does mean that I can use Merb for all file handling activities. Its fast and allows me to handle multiple files effectively. In fact it was my original plan that we would someday move file handling off the main app to another server just so that the system can run the application so much faster. As it turns out, this is what some very heavy traffic sites have begun to do which means the idea isn’t totally crazy. You might as well let things do what they are good at hadn’t you?
Another good thing is that we can share code between the Rails and Merbs apps. Like I said, Merb lets you use ActiveRecord which means all the models are available in both apps without any code duplication so it makes sense.
First of all I will start by saying that I like the new Apple Macbook Air, I like it a lot. But why oh why are we getting ripped off once again. It’s not that the laptop is too much money, because when you compare it to the Sony equivalent they are about the same price, which is unusual for apple as they normally like charging loads more. It’s just that the price in the states is $1799 which as of this morning works out to £919.68. But somehow the price is magically £1199. Thats almost £300 more! Actually it is more like £200 because of our difference in VAT which they have no control about. The thing is, they will still give us all this shit about how it costs more to do business here. How the hell does it cost £200 more to do business here, thats just utter crap. So they are telling me that it somehow costs them ~20% more to do business here than in the states. I just don’t believe it. Jesus the plane must come over head here from China, so cant they just push a few off. That should save them some money 