Hi - just wondering how I would go about incorporating Blynk Server redundancy in my Blynk App. Basically I run a local Blynk Server but if it failed I would like the Blynk App to sense this and switch over dynamically to the public Blynk Server and then keep checking if local Blynk server is back up and switch back accordingly. I realize I need two auth tokens and need to duplicate Blynk App but this would be really nice feature for devices that I have remotely. I will try code myself but if anythone has does it or any ideas
It’s a very cool and very complex feature.
There are 2 questions:
- how much would someone be ready to pay for it
or - how many people would like to contribute to our open-source server
Also, many people are using local servers because of privacy and in this case we would need to copy the data to the cloud
You can achieve this relatively easy using loadbalancers. They can determine where traffic needs to go if, for example, server1 fails. All the traffic would be automatically redirected to server2, but you will connect to the same address. How cool is that? There is only one small caveat, you have to synchronise the data files, user files etc. WIth the Blynk server being what it is, it’s pretty simple and a simple copy job will take care of that.
Using more smart loadbalancers, like the Citrix ones for example, you could even do more intricate stuff like rebuild HTTP headers etc. to reflect status of server, where you are connected etc. etc.
In a more crude and simple implementation I was thinking a new Redundancy Blynk Widget for iOS/Android app could be configured which accepts AUTH tokens from two different Blynk servers and as part of the Blynk,connect API you also input the two AUTH tokens and denote one as primary and the other as secondary. The Blynk.run handles all the magic and ensures both servers are sent same data so if one server is down it can talk to the other. Would this work ? and would people find it useful ?
@mars I think some Blynkers would pay for a widget that provides an easy way to switch between different servers.
We have spent quite a bit of time reviewing different ways to do it and some are now quite polished but they all involve some level of manual interaction with the Blynk app.
This is nice feature. However truth is - only 1-2% of Blynkers using private servers. So from business point of view development of this feature doesn’t make any sense.
You are welcome to contribute as all you need is open source.