0

I've got a stateless service which simply allows READ operations against a remote database.

In order to remove the bottleneck of traffic to a remote resources, I'd like to cache the database locally, especially since it is very low transaction volume and a small dataset - around 10 megabytes.

I still need to be able to perform SET operations, such as JOINS against the data.

Does Service Fabric specify how to periodically cache a data source such as SQL Server?

I know there may be different ways to skin this cat, but I don't want to have to re-invent the wheel.

NightOwl888
  • 55,572
  • 24
  • 139
  • 212
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
  • Does anything else change this database? –  Feb 11 '18 at 23:10
  • @MickyD maybe once per day or so, but yes there are other "writers" to the database – Alex Gordon Feb 11 '18 at 23:10
  • Could try Azure Redis cache with a suitable expiry –  Feb 11 '18 at 23:14
  • we're running on premises – Alex Gordon Feb 11 '18 at 23:17
  • Possible duplicate of [Implement Cache in Azure Service Fabric](https://stackoverflow.com/questions/44699720/implement-cache-in-azure-service-fabric). That or just use Entity Framework's `Load()` method, assuming you are using EF –  Feb 11 '18 at 23:29
  • You could also use `MemoryCache` https://msdn.microsoft.com/en-us/library/system.runtime.caching.memorycache(v=vs.110).aspx – S. Walker Feb 12 '18 at 00:51

1 Answers1

1

The SF platform (as in Stateful services) doesn't provide a way to do set based operations atm.

But, you could simply run a database server (like MySQL /SQL Server) inside a container on the cluster. Combined with read-through caching from the stateless service.

LoekD
  • 11,402
  • 17
  • 27