A few things on my to-do list.
1/ Implement cluster API - http://nodejs.org/api/cluster.html
Can we get a simple demo application working with cluster based deployments on ft platform?
Some notes here - https://gist.github.com/jedi4ever/6079180
Clustering seems useful for, a) using multiple processors on the same machine, b) not having to rely on doing a forever restarts when you deploy, c) no-downtime deploys, and possibly d) dynamic scaling.
or http://blog.keithcirkel.co.uk/load-balancing-node-js/ - perhaps it's not the answer right now?
2/ Profiling and instrumentation
Node on FT Platform doesn't give us a huge amount of information about what it's doing - cpu, memory, leaks etc. so would be useful to investigate what information we can get from the boxes and expose it.
Eg, http://blog.nodetime.com/2012/07/detecting-memory-leaks-in-nodejs-apps.html
Likewise, the presentation tier is going to be very dependent on making HTTP calls to the service layer but contains no instrumentation by default (dns lookup time, response times).
3/ Express is ok but largely feels like syntax sugar over the base node stuff. Plus it feels like at the end of it's life time.
What would a simple node HTTP server from scratch look like? What are we missing out on?
4/ Offline build processes are horrible. We should aim to make everything dynamic, on demand.
5/ Dependencies. Rhys had a nice idea for visualising npm dependencies, and changes, licenses, and general activity around our packages.
It freaks me out every time I run npm install
that we are wedded to hundreds of small, unvetted (?), modules without a clear idea of their status or whether they are maintained.
6/ Docker. See if this makes deployment simpler (or at least less about transfering and unpacking lots of little files).
I actually implemented a basic Cluster implementation for the metadata-cache app on Heroku. Did a brief load test and there wasn't a significant difference between clusters vs dynos (although admittedly this was hardly thorough, and would be interesting to do with proper instrumentation). The main benefit I thought was the forever aspect (i.e. refork when one of the cluster instances crashes, whereas heroku would just stay crashed) - but presumably forever on FT platform does the same.
Also it had the unfortunate downside of maxing out the number of processes that Nodetime (tier 1) could handle so couldn't get any decent instrumentation on it.
I quite like the idea of exploring alternatives to Express JS. Maybe it would be useful to do a retrospective (so to speak) of Fast FT (and any other node projects like Responsive News feed) pertaining to Node.JS/Express and the good/bad things you found using it - so we know what to look for with alternatives?