Going to Production
Going to production can be scary but it doesn't have to be if you are well prepared. Below is a checklist of things that you should consider before taking a system to production. Weight these up with the size of the project, how important it is if you lose data and the load you expect the application to sustain. Some items may not be necessary depending on your project's attributes, however, all of them are important to consider.
- Backups - Ensure you have scripts that backup data regularly and that cleans up old backups so that they don't fill up all available space. Here is a script to use for inspiration - Example backup script with some notes on useful conventions
- Server monitoring - Server should be monitored so that you know when a server goes down or for example runs out of hard drive space or is running at capacity. A great easy to use tool for this is NetData
- Alerting - Ensure that you have alerts setup so that you know when things go wrong. You can setup alerting for NetData mentioned above, other good tools that we use are Pingdom and OpenHIM alerts.
- Error reporting - when errors happen in production it is useful to know right away. There are platforms we can use to report exceptions to when the occur both for frontend and backend systems. Tool we have use before include - Sentry and LogRocket
- Redundancy - if necessary for the project, ensure that service are deployed with redundant capacity. This is useful for applications that must be highly available. Commonly we would do this be using a container orchestrator (e.g. Docker swarm or Kubernetes) to do this or a standalone load balancer (e.g. Traefik). See the deployment architecture section for more info.
- Certificates and HTTPS - we should always use secure transports for logins and user or patient information. Ensure that HTTPS has been setup for your applications. LetsEncrypt can provide us with free certificates. The OpenHIM can act as an HTTPS revere proxy. Traefik is a cloud router with allows both auto-generation of LetEncrypt certificates, load balancing and reverse proxy functions.