Search code examples
azuremulti-instance-deployment

How to store temporary data in an Azure multi-instance (scale set) virtual machine?


We developed a server service that (in a few words) supports the communications between two devices. We want to make advantage of the scalability given by an Azure Scale Set (multi instance VM) but we are not sure how to share memory between each instance.

Our service basically stores temporary data in the local virtual machine and these data are read, modified and sent to the devices connected to this server.

If these data are stored locally in one of the instances the other instances cannot access and do not have the same information. Is it correct?

If one of the devices start making some request to the server the instance that is going to process the request will not always be the same so the data at the end is spread between instances.

So the question might be, how to share memory between Azure instances?

Thanks


Solution

  • Depending on the type of data you want to share and how much latency matters, as well as ServiceFabric (low latency but you need to re-architect/re-build bits of your solution), you could look at a shared back end repository - Redis Cache is ideal as a distributed cache; SQL Azure if you want to use a relation db to store the data; storage queue/blob storage - or File storage in a storage account (this allows you just to write to a mounted network drive from both vm instances). DocumentDB is another option, which is suited to storing JSON data.