# 05-18 Backend Performance Optimization

I am working on improving performance of the backend. My code is very inefficient because it does operations on the database unnecessarily. I am not interested in persisting measurements in the long term, so there is no reason for me to save them for clients and for gateways. I only need to persist the positions for plotting against time. I will use workers to manage tasks that can be delayed (calculations, curve fitting) and return a response as fast as possible as not to clog up the main API thread. Instead of writing the measurements to memory to persist them across php script lifecycles, I will use a cache to save them in memory.

Last Updated: 11/23/2020, 9:42:47 PM