eFortunes 0.1: a distributed, scalable and fault-tolerant fortunes server developed in Erlang

Well, after naming this post in this way I think it could be a good idea to explain what this is about… 🙂

As the result of working in my Master Thesis, I developed an small “ad-hoc” framework for programming simple and so-so-small web applications using Erlang, since a requirement for doing my Thesis was using distributed functional technology… and web applications are not usually developed with this kind of tools. Well, I know that with ErlyWeb this assertion could be wrong in a matter of months ;), but when I started my work (a year ago) the situation was so much different from now.

In the other hand, my fellow worker Javier Muñoz had recently developed a so much practical script (“Erlang On Rails”, as he called it) for easily start with the development of Erlang applications, without getting lost (and bored) with several commonly needed issues, such as the application definition file, the compilation process or the launcher script. On this post you can read more about “Erlang On Rails”, as it was told by Javi some days ago.

With this background on mind, I felt myself encouraged to develop an small web application that let me to carry on learning about the Erlang world, now that my Thesis is (at last) over… and I thinked about doing an “absurd” (well, this is subjective :)) fortunes server could be a good choice, since I could learn with it more about so many issues about Erlang I haven’t learnt yet, or get a deeper knowledge about issues I’ve already know. For instance:

  • Distributed persistence of data (fortunes) using Mnesia, a Erlang-based objectual DBMS.
  • Persistence into a relational DBMS (such as PostgreSQL) using the ODBC API provided by the Erlang/OTP platform. (Nowadays, it seems Mnesia is not suitable for storing large amounts of data)
  • Developing reliable and fault-tolerance applications on Erlang according the design principles of the supervision tree, as suggested on the Erlang/OTP documentation at erlang.org. (Well, sometimes fortunes are a really-critical information… don’t you think?)
  • Designing of web applications with Erlang using Yaws, a light web server developed on Erlang which is quickly growing on these days, adding more and more capabilities with each version that is out (such as AJAX or haXe support).
  • Testing several frameworks I’ve recently discovered on the web, and that I wasn’t able on my Thesis because of a matter of time: Yatsy, ErlyDB, ErlTL, ErlyWeb
  • And so on…

In fact, all these points could be abbreviated as “learning more about Erlang and having an workbench for testing all those issues I’d like”. And if, while learning in this way, I get a distributed, scalable and fault-tolerant fortunes server for being able to safely store jokes and spontaneus comments… “better than better” XD

At last, I’d like to thank my Master Thesis’s director (Víctor M. Gulías) for letting me to license my work under the terms of the GNU General Public License, in order to let everyone to get the source of eFortunes and use it as needed.

Now I’ll end this post by telling the current features of eFortunes 0.1, the TODO list (this one could change, of course) for eFortunes 0.2 and some screenshots of it. And, of course… you can download the source code if you want from here:


eFortunes 0.1 features:

  • List, create, edit or remove fortunes from server
  • Underlying distributed persistence layer based on the Mnesia DBMS
  • Easy access to the services offered by efortunes by using a simple web interface (powered by yaws)
  • Internationalization (i18n) support for the implementation of the web interface

eFortunes 0.2 TODO list:

  • Bug fixing 😉
  • Add the capability of importing/exporting from/to regular fortunes files
  • Add search interface for making possible to look for fortunes according some specific criteria
  • Improve the web interface ( well… this is a must 😉 )
  • Add an user profiles management tool (currently, only an user admin/admin exists)
  • Create an standalone, deployable daemon of efortunes (maybe, yaws should be embedded into an erlang application)
  • Documentation and code-cleaning

eFortunes screenshots (sorry, only spanish text on them):

List all the fortunes

Edit a fortune Deployment of eFortunes

4 thoughts on “eFortunes 0.1: a distributed, scalable and fault-tolerant fortunes server developed in Erlang

  1. khigia

    I just begin to interest myself to Erlang, and your project is great for a newby to learn how to make an application. Thanks.
    I like the “erlang on rails” script. But I also found Erlware (http://erlware.org/) which is another “on railer”.

  2. mario

    Thanks a lot for your comment. I had no idea about erlware before you wrote about it. I’ll take a look into that URL as soon as I have some spare time ( not yet 🙁 ).

    And of course… feel free to ask me for any doubt you have about eFortunes. I’ll be glad to help you with that (or at least try it).

    See you

  3. martin logan

    I just noticed your interest in erlware – erlware is a not a web framework as such, but a standard build system that supports the creation of OTP applications. It is a solid foundation for good erlang applications and offers features like standard instalation and doc generation build targets as well as higher level features like log rotation. The build system is explained in the trap exit HowTo at http://wiki.trapexit.org/index.php/Building_An_OTP_Application
    you can also direct questions at the mailling list linked off of http://www.erlware.org under contacts.


  4. mario

    Nowadays, I had no enough spare time yet to take a deep look into erlware as I liked to, but your comment made me visit the link you pointed out and I founded so much interesting for my erlang learning purposes.

    I think “Erlang On Rails” script from my colleague Javi Muñoz is good enough for learning (In fact, I’m using it right now for easily create new erlang apps), but the truth is that, for bigger applications some tool like erlware is almost mandatory… or just mandatory, in order to have a easy way to make robust and “standard” erlang applications with installation and doc generation support, as you pointed out in your post.

    And of course… thanks for your interest in my blog. Is good and nice to see how people reads your humble contributions to the world… even when the constribution is something like this 😉


Comments are closed.