Like countless other people in South Africa, I have invested in an Inverter with a Lithium battery. The battery is a significant part of this investment, so it is essential to get as much runtime out of a single charge as possible.
My inverter is connected to my DB board, meaning all the sockets and appliances in my house are powered by the inverter during a power outage, which, in South Africa, happens frequently and for hours at a time.
Having “always on” power in all the sockets is great and super convenient, but not always smart. As winter encroaches, we start plugging in appliances that draw substantial amounts of power, like electric heaters and blankets. Some electric heaters can draw up to 2 kilowatts of power per hour. Given that the typical inverter system is paired to a 5-kilowatt battery, which means a single electric heater can almost drain the entire capacity in just two hours.
To solve this problem, I built a “smart extension cord” that turns off when the power fails and turns back on once the power returns.
Load balancing is an important technique for scaling web applications and ensuring their reliability and availability. In a microservices architecture, a common pattern is to use an API gateway to route incoming requests to the appropriate service instances. However, as the traffic grows, a single API gateway instance may become a bottleneck and a single point of failure. To avoid these issues, we can use multiple API gateway instances and distribute the traffic among them using a load balancer.
In this post, we’ll explore how to set up a load-balanced API gateway using Node.js and Docker. We’ll use Docker Compose to define multiple instances of the API gateway and a load balancer, and we’ll configure the load balancer to distribute the traffic among the instances using a round-robin algorithm.
Like so many other people in South Africa, the unreliability of our power grid have forced me into taking the plunge and investing in an inverter with a lithium backup battery.
I used a raspberrypi to retrieve modbus data from the SunSynk inverter via a custom RS485 RJ45 to USB cable, logged the data into a MySQL table via a Nodejs app, and then used Grafana to display the data in a custom dashboard.