Vekkit is a smart e-bike kit. What does it mean - "smart"? It means that a kit should be able to connect to the Internet via mobile applications - send statistics, update firmware, report attempts to steal the bike. Therefore, the server infrastructure is very important for us and we have spent a lot of time designing it - and now it saves a lot of our money and time. Why did we not take Google Cloud or Heroku? It's simple - we don't have subscription plans, so as the number of sold kits increases, the number of server requests and the cost of cloud servers will also increase, but our customers won't need to pay for subscription every month.
Since the project itself has a lot of applications (mobile applications for iOS and Android, firmware in the motor controller, handlebar computer and cadence sensor, web site, knowledge base, travel journal), we decided to use microservices from the very beginning.
For their deployment we use coded.sh - open-source platform which can be installed on any server with Ubuntu 18.04 and provides Continuous Delivery, Git, SSL, SSH for each microservice in 10 minutes. I developed Coded some time ago and the project was selected by Station F for acceleration, but it still remains a side project. The time saved with a properly configured CD is very large - about 10 minutes for each microservice update.
We currently have 5 microservices on the server:
Each microservice is placed in a separate container (in Coded I use Linux Containers), so if necessary we can just copy a container with a microservice to the new server and distribute the load using DNS (each microservice has its own subdomain). Despite the complexity of the infrastructure and 5 different microservices, the cost of the entire infrastructure is just 10.6 €/month (one server on Hetzner).
What we plan to add in the future:
So far I develop all services and support infrastructure alone. If you also have an idea or have already developed a project on Node.js (SAAS, for example), you can easily create the same infrastructure for your project.
For this you will need:
If you have any questions, feel free to contact at [email protected].
Previously published at https://vekkit.com/stories/server-infrastructure