Last week, I made good progress by finishing graceful shutdown and implementing routing to multiple backends with simple prefix matching, including tests for both. Graceful shutdown stops accepting connections, tells in-flight connections to close, and closes forcefully after a configurable timeout if necessary. The prefix routing involves forwarding requests to the configured backend with the longest matching path or returning 404 if none match.
This week, I’ll start load balancing, using a simple round robin algorithm for now. Building on the current setup of one backend per prefix, I’ll need to cycle through multiple redundant backends with the same prefix. Even though the algorithm itself is relatively simple, implementing it will involve problems such as managing indices/counters concurrently.
In terms of impediments, my job search continues, and it continues to take up a lot of time and energy. However, spring break will give me time to make as much progress as I can on the job search while also balancing this project and other classes.
The process I used last week was generally good, but there is a key area of improvement for me to bring up. I spent too much time going back and forth between making the overall structure of code cleaner and more reusable but then going back and simplifying things to avoid overengineering. Sometimes I start into making something more decoupled, encapsulated, and/or reusable, but then realize that’s likely just overcomplicating things at the current scale or any scale the code in question may realistically ever reach.