Search code examples
azure-service-fabric

Does Service Fabric provide a mechanism for distributed transactions?


We have a set of micro services that all communicate via REST API. Each service will be implemented as a stateful actor in Service Fabric and each will have access to the reliable collections we have in service fabric. It is imperative that these services act in a transactional manner. We are architecting this solution right now, and there is a debate on the ability for Service Fabric's ability to do distributed transaction coordination. If distributed transactions are not supported (as some are claiming) then the solution will be architected using Nuget packages to update functionality. I think this comes with its own set of problems almost like the old COM components.

Does Service Fabric have a distributed transaction coordinator for Stateful Serivces using Web API communications?


Solution

  • No, SF transactions work on the level of a service replica. Maybe the quorum got people confused, even though this feels like a distributed transaction, it's not something you as a developer can use.

    Strong consistency is achieved by ensuring transaction commits finish only after the entire transaction has been logged on a majority quorum of replicas, including the primary.

    Note:

    Distributed transactions cause more issues than they solve, I'd recommend you read about Event Driven Architectures instead.