Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many read operations can be handled by Reliable Actor with no problems?

Aim: Pretend, I have a very popular page (let's say 1 million people per 5 minute) on my Azure Service Fabric based web application. I want to make some kind of cache layer between a data layer and frontend API layer.

Solution: For this purpose, I choose a Reliable Actor performing only one method for readonly operation: GetFrequentlyAskedPage(). This Actor has a volatile type and 5 minutes timeout to be replaced with Garbage Collector.

Questions:

  1. How many read-operations can be handled by the Actor before it lay down?
  2. Should I use in this case "read from secondary replicas" option for that Actor?
  3. Or maybe I am totally wrong in my reasoning and should change the way of implementation.
like image 924
matterai Avatar asked Jan 29 '26 15:01

matterai


1 Answers

I would not recommend using actors as a cache. Actor instances force single-threaded turn-based access, meaning an actor instance can only service one request at a time. This obviously will not perform well as a cache. See here for more info: https://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-actors-introduction/

Instead I would recommend using a stateful Reliable Service with a Reliable Dictionary to cache data, or better yet, use a stateful Reliable Service as your data layer, in which case you don't need this cache at all.

like image 190
Vaclav Turecek Avatar answered Jan 31 '26 05:01

Vaclav Turecek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!