Friday, November 14, 2008

Abstraction

I remember once reading that the two most important ideas in computer science were abstraction and caching (by the way, a statement to which I 100% agree!). In this post I will be talking about abstraction.
According to wikipedia abstraction is a mechanism and practice to reduce and factor out details so that one can focus on a few concepts at a time.

In building jawaker, we tried to model card-games with an abstraction general enough to deal with the most common card-games and yet be simple enough to implement and reason about. We ended up modeling card-games as movements of cards between card stacks (used here in the non-technical sense to mean a pile of objects) with side effects (updating score, etc.). This abstraction solved the problem neatly as we worked on our first game (Trix) and is proving to be quite adequate as we work on our coming games.

Monday, November 3, 2008

On Scalability: Using Memcached

Jawaker has been written with scalability in mind, all along the way.

One of the decisions we took in this aspect was to use memcached to cache information about the games currently being played. Memcached is a general purpose distributed memory object caching system, think of it as a large hash table (a dictionary for Pythoners out there; a table of key-value pairs) loaded right into your memory (basically, the RAM), with the ability to spread over several machines if needed.

The idea is that accessing the memory is much faster than accessing the database, by caching data that is accessed often (such as data about games being played), we save valuable database read time. Database access becomes an issue as the number of queries increase, our solution reduces the number of queries needed, and can scale across multiple machines too!

This is in particular important since Jawaker is AJAX-based, and querying the server for updates happens often.

Sunday, November 2, 2008

Jawaker At DemoCamp Dubai

A couple of people from the Jawaker team, Mohamad Haj Hasan and Fouad Mardini, went to DemoCamp Dubai last week to demonstrate the application to a healthy crowd of people that included developers, bloggers and investors in the Radisson SAS in Dubai Media City.

The event showcased a total of four web applications in a 15-minute presentation per application. Jawaker was well received by the attendees and we seemed to have created a small buzz within the community and were able to cement Jordan's place as the country for innovation in the Arab online space. It was also very exciting for us to see an article about us published in The National, a prominent daily paper in the UAE.