Team blog: Developers

Goodbye RethinkDB, hello PostgreSQL

lib.reviews is now powered by PostgreSQL, the veteran open source database that drives much of the open web (and a good share of the closed web, too).

When we started, we used RethinkDB, an interesting document-based database that seemed well-suited for a project like this one, where review subjects don’t necessarily conform to a fixed structure — books, movies, restaurants all need different kinds of metadata.

But RethinkDB ran out of money, and it has been in life support mode ever since. This doesn’t make it a future-proof backend for a website. PostgreSQL nowadays supports flexible column types that can store JSON documents. We use this for our multilingual text fields, review metadata, and more.

Migrating was a major technical lift, as you can see in the 97 commits that comprise the pull request. However, it is now done, and we got a lot more test coverage out of it along the way.

We also ported the database dump script over to PostgreSQL, and will soon be providing sanitized database dumps in the new format.

We’ve tested this extensively, but there are bound to be bugs. If you find one, please don’t hesitate to open an issue!


New languages enabled

We’ve enabled the following new languages for UI and content: Arabic (experimental), Finnish, Hindi, Lithuanian, Slovak, Slovenian, Turkish, and Ukrainian. Huge thanks to all the volunteer translators who have made this possible. :)

To create a version of lib.reviews in your language, please see our FAQ.


Goodbye Grunt, hello Vite

In today’s modernization epic, we say goodbye to Grunt and Browserify, two very old-school ways of orchestrating the build process for JavaScript and CSS. Their place is taken by Vite, which is faster and comes with some nice development tooling.

As a developer, before this change, if I wanted to change some JS and see it live, I would have to stop the server and rebuild the code. Now, I can simply save the JS file, and Vite will take care of everything in the background.

As part of this, we’ve started to modernize the frontend code using JavaScript modules, which Vite is much more comfortable with than the older require syntax.

The production site is powered by this new Vite tooling; if you notice any issues, let us know!


Goodbye greenlock, hello certbot

As part of modernizing the codebase, we had to phase out greenlock, a neat Node extension for automatic HTTPS cert management directly within Node. Unfortunately, it’s no longer maintained. Fortunately, certbot has come a long way over the years and makes HTTPS cert management quite painless!

lib.reviews now directly serves up HTTPS certs generated via certbot, which should be quietly auto-renewed without downtime when the time comes. Fingers crossed!

Oh, and pm2 is also gone. It’s a nice process manager for Node, but for our purposes, it just adds overhead. Our production setup is now just managed with systemd.


Gradually modernizing the codebase

I’m working my way through modernizing the lib.reviews codebase, starting with older dependencies.

Today included:

  • Switch to maintained bcrypt dependency for password hashing (compatible with previous hashes)
  • Phase out deprecated request dependency
  • vendored Thinky ORM (unmaintained) and improved its accessibility; removed its reliance on bluebird
  • made test suite fixture setup more resilient against interruption or errors by using a test wrapper
  • replaced unmaintained node-webhooks with internal webhook handler
  • replaced unmaintained remote-ac autocomplete library with vendored & modernized version

The changes ahead will include:

  • moving away from the unmaintained greenlock library for managing HTTPS certs; I’ll likely just use certbot and a trigger to re-generate certs as needed
  • likely dropping pm2 for managing production deploys in favor of just using systemd

And the biggest planned change is to move from RethinkDB (unmaintained DB backend) to PostgreSQL. That literally touches every aspect of the site, so it may need to proceed in a long-lived branch until we’re ready to flip the switch.


lib.reviews is part of Permacommons

I’ve transferred the lib.reviews repo to the Permacommons organization, which I also manage. The idea behind Permacommons is to build a permanent home for shared resources, managed with AI support (in the case of lib.reviews, for development) and automation in mind. If you’re interested, check out the other projects that are being built under the same GitHub org.


Server & dependency upgrades

The lib.reviews server has been upgraded to Ubuntu 24.04. I’m also in the process of incrementally updating many older dependencies and modernizing things under the hood. If you notice anything break, please open an issue!


Twitter/X account deactivated

Belatedly, the Twitter/X account for lib.reviews is gone and won’t be coming back, since Twitter/X has been turned into a hate platform. If you’d like to follow us, you can do so on Mastodon or of course on this blog :-).


schema.org JSON-LD data added to review subjects, individual reviews

We’ve had basic support for aggregate review metadata (using schema.org types) since 2017. We’ve now converted this data into the more modern JSON-LD format, and added it for individual reviews as well. The latter should help make reviews more discoverable in search engines. Thanks to Nortix for the suggestion.


Preview bug with uploaded files fixed

The new social media image support seems to be working well, but it had an issue where it would sometimes lose track of files you uploaded from the editor, especially when using preview (the dropdown list to select a social media image would be empty even though you uploaded files). This should now be fixed, but please file a bug report if you encounter any new or old problems.


Older blog posts