Thinking In Reverse - Not Taking Orders From Your Boss in Realtime

Today I was talking to my crazy, crazy-smart and great friend Mike Marshall, the creator of Massh (http://m.a.tt/er/massh/, look how badass his domain is, a.tt, get it now?) about how difficult it is for some people to adapt to new things. We were also talking about Realtime Webapps, wondering how many wasteful pull-style apps we have done over the years (open a connection, make a request, get nothing in return and then do it again, over and over again).

It’s funny how you need to totally think in reverse sometimes to understand something. I remember the first time I heard about Kanban, the inventory and scheduling system created by Taiicho Onho, the father of Toyota’s Production System (That used to sound a lot more impressive before the latest scandals Toyota had with their cars). Traditionally production systems and scheduling systems use/used a “Push” method and its success requires a good amount of forecasting and all the issues that come with trying to “predict the future”, miscalculations are very frequent and there is a cost associated with that. In simpler terms, it means that traditionally our boss tells us what to do, pushing the task to each team member, sometimes one task at the time, sometimes a whole pile of tasks and he/she tries to predict how much work you and your peers are gonna get done. Kanban solves the forecast craziness by just eliminating it completely, by using a “Pull” method when there’s demand; that means you go to your boss (or a Kanban taskboard) and gets a task (a Kanban card) to work on. When you are done, you repeat the same process; That avoids your boss giving you too many tasks that just sit there in your pile while someone else, right next to you sometimes, has nothing to do. That also avoids you finishing all your tasks and going waste time on your favorite website because your boss is not there to give you more tasks. It makes sense! Somehow this whole process of just eliminating a problem completely reminds me of NoSQL databases (transactions, isolation levels, locking) but we’ll leave that for another day.

In traditional webapps the client requests information from the server, a “Pull method”. Then Ajax came a long and webpages became more alive, things seem to change without a full refresh but in a lot of cases there’s still a lot of requests pulling information from the server involved. As there’s a new breakthrough on the Web every once in a while, every five years some would say, we are starting to see become mainstream pushes from the server to clients (that’s right – clients) to create realtime webapps that won’t require the stupid pull requests I described before (I know Comet and Bayeux have been around for a while, take it easy). It works in reverse just like Kanban. I heard it be called Ajax Push, Reverse Ajax, HTTP Streaming; call it whatever-hell you like, I hate marketing buzz words anyway, they seem to get outdated so fast. When you think of Ajax (Async Javascript and XML), do you think of XML or JSON? JSON!

Riding on this wave there’s node.js, which I love, but I decided to create a little example in Java. Poor Java, I love Java, but it gets so much criticism nowadays; you can do a lot of cool stuff with Java! So since today I was bored out of my mind at work, and I can’t stand being bored, I decided to spend the day to set something up; I came up with a simple sample application I am calling Jaye (because of Node.js’ Kickass Faye which is also based on Comet and Bayeux).

I created the whole thing today, code, hosting, deployment, etc. It is using Cloudbees for hosting, very impressive, super easy to setup, just worked! I created a free account, verified my email, uploaded a war and boom, it was all done! I didn’t have to setup Apache, I didn’t have to setup Tomcat. You gotta love PaaS, great job guys! It is using Raphael JS for the map, a SVG vector map by the way, we are not talking about gifs, excuse me. That means it works on different zoom levels, it works on mobile phones and it is very very cool for all geeks reading this.

I want to add more features of course, that’s just a sample application; if you want to help me, fork Jaye on the always awesome Github and contribute.