0

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

lcit
  • 306
  • 3
  • 12

2 Answers2

0

You could use Service Fabric and take advantage of Reliable Collections to have your state automagically replicated across all instances.

From https://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-services-reliable-collections/:

The classes in the Microsoft.ServiceFabric.Data.Collections namespace provide a set of out-of-the-box collections that automatically make your state highly available. Developers need to program only to the Reliable Collection APIs and let Reliable Collections manage the replicated and local state.

The key difference between Reliable Collections and other high-availability technologies (such as Redis, Azure Table service, and Azure Queue service) is that the state is kept locally in the service instance while also being made highly available.

Reliable Collections can be thought of as the natural evolution of the System.Collections classes: a new set of collections that are designed for the cloud and multi-computer applications without increasing complexity for the developer. As such, Reliable Collections are:

  • Replicated: State changes are replicated for high availability.
  • Persisted: Data is persisted to disk for durability against large-scale outages (for example, a datacenter power outage).
  • Asynchronous: APIs are asynchronous to ensure that threads are not blocked when incurring IO.
  • Transactional: APIs utilize the abstraction of transactions so you can manage multiple Reliable Collections within a service easily.

Working with Reliable Collections -
https://azure.microsoft.com/en-us/documentation/articles/service-fabric-work-with-reliable-collections/

evilSnobu
  • 24,582
  • 8
  • 41
  • 71
  • At a first glance, this solution seems quite complex at least for the kind of task I have to accomplish. I am looking for a more C++/linux-ish solution like mounting a drive or a shared blob of memory. – lcit Oct 10 '16 at 17:23
  • If your looking for a more IaaS-ish approach, why not use Azure File Storage? https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-files/ - Since it's SMB 2.1/3.0 plays nice with Linux and BSDs too. – evilSnobu Oct 10 '16 at 18:36
0

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.

Russell Young
  • 2,033
  • 1
  • 14
  • 12
  • Using a DB or a File Storage seems affordable to me. Do you know if it is possible to share a drives between multiple instances so I can access it as a normal drive i.e /tmp/mountpount ? – lcit Oct 10 '16 at 17:26
  • Yes, that's pretty much what the Files storage containers are designed for. Note the performance/latency may be an issue on standard storage accounts though, you might want to validate and look into the limitations. – Russell Young Oct 10 '16 at 21:28