0

In Azure Service Fabric I can use stateful services and actors. A state type is like a normal .net object type. So I can create multiple instances of that state.

When I am pushing an instantiated state object from one stateful service/actor to another stateful service/actor, will the state object instance be copied or just referenced? Because it is not referenced, but copied, then I have to store the state data twice. Right?

CPA
  • 2,923
  • 4
  • 30
  • 52
  • When you down vote the question, please leave a comment. That is helping me to improve my questions. – CPA Jan 13 '16 at 11:10

1 Answers1

1

Services span nodes in a cluster. Anything you send from one service to another has to be able to cross machine boundaries, so any object you send in a message must be serialized and sent over the wire.

Vaclav Turecek
  • 9,020
  • 24
  • 29
  • That means all the data will be duplicated if I want to use them in other services/actors? – CPA Jan 13 '16 at 21:34
  • Right, if you send data from one service to another, it is a copy of the data because the services may be in different processes or even different machines. Remember, with stateful services data is co-located with the service itself - it's not stored in an external location. – Vaclav Turecek Jan 14 '16 at 00:54