Last Tuesday I started writing an
SMS Jabber Transport to "mobile enable" my instant messaging, I finally got around to adding reply support to it last night, so now have nice two-way messaging from Jabber to mobile phones, this is neat :)
During the course of adding the reply handling, I needed to keep track of message id's and the jabberid's that sent them, so I can handle the routing of replies, for a quick test I create a MessageHistory class containing the Date sent, the messageId, and the jabberId and stored these in a HashMap, looking up the entry on receipt of an incoming message. The quick implementation worked, but after the 2nd run I found that I needed some form of persistence, so that tracking information wasn't lost between restarts.
So its time for a database... or is it... I've been using
BottomFeeder as my RSS viewer for sometime now, and was thinking on how it now stores all its persistent data as just serialized objects on disk, and I was reminded of
Prevayler, which I've been meaning to checkout for sometime, so off I went and downloaded it.
I'm hesitant about its use on the "does it scale" side of things, RAM may be cheap, but I'm still broke. Anyway, I wrote up a simple build.xml for the project as it didn't have one and compiled up a jar, added it to my project, found a quick
intro document and refactored my code slightly to match, the changes were minimal, and in about 15 minutes I had a nice persistent object store that... just worked. So far I like, regardless of what others say... if it fails to scale, then I'll change.
links: digg this del.icio.us technorati reddit