August 2007

Did I say adviserl need doc and testing … well … I did implemented something else: a (too) simple HTTP API based on inets. It enable rating of items and retrieving recommendations. Hopefully it will also display few info about state of adviserl application. If set in config file, adviserl will start inets at startup.


adviserl is now version 0.2 thanks to its new default backend: Mnesia.


All 4 data services (sources, items, ratings and predictions) can now store everything into Mnesia tables, which help to (let’s hope …) ensure consistency. Using Mnesia will also ease to distribute the application later.

The main difficulty was the backup of adviserl data because all services are independent. So adviserl only provides tools (adv_mnesia:backup/0, adv_util:save_files/0) and the user of adviserl need to know want he want to backup and when (no logic is implemented to backup or restore data). There is no function to restore a backup when adviserl is running, but for a shortcoming, it is easy to stop and restart adviserl.

For now, adviserl start mnesia if needed, but cannot stop mnesia when adviserl stop. Still wondering if mnesia could/should be an included application (using mnesia_sup module).

API changes

The main interface has change a little bit to facilitate the use of ID or key to identify items and sources. By default, ‘keys’ are used to identify sources and items (adviserl:rate/3,4). New functions enable to directly use ID (adviserl:rate_id/3,4).

Also new functions enable to add rating asynchronously (adviserl:async_rate/3,4 and adviserl:async_rate_id/3,4), meaning that recommendation will not use those ratings until specified (adv_predictions:init/0): this enable to quickly add a lot of ratings (without expensive update of recommendation data), then purposely trigger a re-initialization of recommendation data.


That’s all for now.

I hope I can work on using multiple prediction algorithms, but it may be better to first implement some regression tests and write a minimal documentation 😉

I’m looking forward to play with recommender algorithms 🙂

I added a “welcoming bug” feature in adviserl: a simple save_files/0 function to backup the recommender data in a persistent manner.

That was quick to write, and I really need it now that I begin to look at a lot of data. But it’s the wrong way to do it: I need to synchronize the multiple servers before to make or restore the backup. Still wondering if I should have done that in a branch …

Anyway, it’s here, and it works: if the application anvironment define few files where to save data, those files will be read and written when application start or stop respectively (you can use load_files/0 or save_files/0 whenever you want, but be careful that servers should not process anything else at the same time to avoid inconsistent state).

Mnesia backend is becoming urgent now … it’s the next point on the roadmap 🙂