Extending Singapore National Library Board Search
Some weeks ago, I heard about Redis from Chu Yeow’s tweet. Redis is a key-value database, similar with memcached, but with the persistence feature. And one of the first things that popped up into my mind was, this is going to be handy to extend Singapore National Library Board (NLB) catalog search on BookJetty.
So I stopped my adventure with iPhone for a while to work on this hack. After all, BookJetty was built to be a proxy to plug-in other catalogs easily. With the plug, all vertical features found in BookJetty such as importing books to your shelves, tagging, book reviews, ratings, the social networking features, Google Books preview, author pages, cross libraries search, and other vertical features will be immediately available for the catalog. Well, with just a plug or an adapter.
I was lucky that Redis 0.900 (1.0 RC 1) was just released, though not a production release, I took my chance. It was very Ruby to work with Redis; download the codes, read the documentation, bam bam and you got it working, one of the reasons why I chose Redis over Tokyo Cabinet (What a name!). More about the differences between Redis and Tokyo Cabinet here.
There is an issue with NLB search result, it does not return ISBN and some other information BookJetty needs to perform the matching and to display the information nicely. Thus, it needs a second call, and it is expensive. A fast database is required to cache this kind of information, and Redis is the answer.
Previously on BookJetty, you can only search Amazon catalog, and BookJetty will find matches in NLB catalog based on the book ISBNs. But due to data discrepancies, some books found in Amazon are not found in NLB.
As a library user myself, I had always wanted to search the other way round. And today, I’m glad to announce to you, and I hope you are as excited as me. We can now do the other way round; search NLB catalog, and BookJetty is smart enough to find matches in Amazon and probably from other sources in the future. I dreamt about this, and today that dream is fulfilled. Click image or here for a sample search.
There is one limitation though, the search API does not sort by the newest books as in NLB online catalog. Hopefully there will be an upgrade to the API soon, and we would be close in our quest to find the holy grail for our local library search. Meanwhile, let’s cherish what we have.
May the books be with you.


















