TL;DR: InterMine 2.0 will be based on our new BlueGenes framework. We’ve answered a lot of the common questions about it below.
You may recall seeing various preview screenshots or demos of Staircase (also sometimes referred to as Steps) over the last year or so. We were all pretty excited about it, with plans to release it as InterMine 2.0 beta early this year.
Not all was well in Staircaseland
Time for a re-think
Feeling a bit in the lurch, we had quite a few technical architecture meetings, trying to decide how to take this forward, whether it meant going through the Angular upgrade pain or starting from scratch. Our biggest priorities were:
- Choosing an architecture that was going to be maintainable in the long-term, not something fly-by-night that would leave us in an awkward position again.
- Making sure whatever we chose was fast: it needed to feel speedy and responsive in the browser, and quick for devs to update the code, too.
- Other important things in no particular order: modern/attractive look, usable, and generally fun to implement.
We ended up choosing a complete re-write, code-named BlueGenes, with the following setup:
What’s the ETA? We’re aiming to release to public alpha with a basic featureset this summer. Private alpha prototype user testing is already ongoing.
A bit more about the technology stack we’ve chosen:
Re-frame is web app framework written in/for Clojurescript.
Unlike Angular, Re-frame has a very simple set of rules for handling the “model/controller” part of an application. The basic rules are:
- The entire state of the application is stored in one object.
- Accessing the state is always performed via a “subscription”.
- Mutating the state is always performed via a “handler”.
That’s it really.
The UI subscribes to different slices of the state object and are notified when the data changes. This makes the application almost entirely reactive where the underlying data is the “truth” and the UI is just its reflection. With a reactive approach we don’t need to worry about the data and the view getting out of sync.
It handles the rendering of the view in such a way that elements on the page are only re-rendered when the data that backs them changes. This has a huge advantage over Angular 1’s approach of constantly thrashing the page to re-display data when parts of the model change. Angular 2 adopted React’s philosophy as well, but the nice thing about using Reagent/React is that it can be used independently or in conjunction with any framework.
We chose to use Clojure for many reasons. Some of the big advantages include:
- Uses immutable data structures.
- Promotes the use of pure functions which makes for reliable testing.
- Impressive code optimization / dead-code removal.
Featured image, “Blue Jeans” by RetroWench via Flickr. Licence: CC BY-NC 2.0, no modifications made.