Posts filed under 'internet'

It’s All Middleware

Jon Crosby has an excellent talk from Mountain West Ruby Conference 2009 about how middleware is taking over web development. His article “A World of Middleware” is a bit difficult to parse if you don’t know Rack, so I’ll try to simplify what he’s saying a bit…

Rails 2.3 is built on Rack, which is a simple specification to connect web frameworks like Rails and Merb with web servers like Mongrel and Thin.  Rails 2.3 also lets you define middleware code to be run before Rails is invoked, again using Rack.  In Rails terms, middlewares are like before_filter’s that are run before Rails is ever even called.  Another way of looking at a middleware is like a miniature application that can connect, via Rack, to another middleware.  Each middleware stack handles certain requests (for example, certain url’s can be handled by specific middlewares), or all requests.  If the middleware returns 404, the next middleware is called.  Rails 2.3 only handles requests that fall to the bottom of the middleware stack.

Crosby’s point is, why bother with a chain of middlewares leading up to an application?  All you need is a chain of middlewares that are the application.  His example in the talk is an authentication middleware that sits on top of everything else, instead of the authentication layer being part of a monolithic application.

The best part is that middlewares can be created as black boxes, and simply included in your Rack application (or used as a middleware in your Rails 2.3 application).  And it looks like the best tool for creating simple middlewares is Sinatra.  This stuff isn’t even on the main Sinatra site yet, but you can read about it on the Sinatra blog.  To quote: “multiple Sinatra applications can now be run in isolation and co-exist peacefully with other Rack based frameworks.”  This is awesome – it means that a Sinatra application can be used as middleware for a Rails application (or other Sinatra applications).  So it’s easy to build a big application by chaining together smaller Sinatra middlewares.

Since Ruby’s open source community is so strong, there’s no doubt we will be seeing pluggable middlewares that fit easily inside any Rack application.  This is exciting stuff, and I look forward to building an app this way!

Add comment March 26, 2009

The Rise (and Approaching Fall) of the Duopoly

I wish I had a nickel for every time I heard someone say they couldn’t “get on the internet”.  Whether it’s via cable, DSL, 3G, or whatever, people are always having problems logging on.  It’s a baffling problem for me, because the internet evolved from ARPAnet, which was commissioned by the US Department of Defense forty years ago to be a completely reliable network.  So why, decades later, is “the internet” so “unreliable”?  The answer is that it’s not.  Individual connections (like mine and yours) may not be reliable, but the internet as a whole is incredibly reliable.  Any device connected to the internet can connect to billions of computers all over the world, seamlessly.

Ok, so why is your connection so unreliable? Don’t be so hasty to blame your service provider, although they certainly deserve it.  The real blame lies collectively with every consumer who currently pays for internet access.

One of the things that saddens me about the evolution of the internet is how it went from being a participatory network to a provider-consumer one.  Originally, the internet was a community of computers. Later, but before the broadband revolution, there were dozens of companies that offered internet via dial-up, which has a maximum speed of 56K, paltry by today’s standards. Broadband made dial-up obsolete, and the dial-up business crumbled.  Unfortunately, broadband required a direct connection to the home, and the only companies that could make that connection were the phone and cable companies.  Startup broadband just didn’t work.

Which brings us today, where your only options for wired broadband in most of New York City are Time Warner and Verizon (there are some small DSL companies that still exist out there, but they usually require you to have Verizon phone service already).  In other words, New York City residents face a duopoly when it comes to broadband internet service – they must choose between two mediocre, unreliable, bloated bureaucracies.

Considering how long the technology behind the internet has been around, surely there are other possibilities?  I believe there are, and in the coming years, I believe those possibilities will crystalize.

More on that in another post…

–DT

Add comment November 19, 2008


Recent Posts

Blog Stats

 

November 2009
S M T W T F S
« Sep    
1234567
891011121314
15161718192021
22232425262728
2930  

Blogroll

Categories

Top Posts