Transactions
A transaction at Diafunc is the unit of change to the project graph containing a set of deltas to the graph.
The changes are applied to the project graph when committed. It's also possible to revert local transactions.
Functions always see a local transactional view of the project graph with all deltas applied.
The changes are applied to the project graph when committed. It's also possible to revert local transactions.
Functions always see a local transactional view of the project graph with all deltas applied.
Consistency Modes
Two consistency modes are available: Weak consistency and strong consistency. While weak transactions provide the maximum scalability and performance, strong transactions may be used to achieve higher levels of consistency. However, as Diafunc is designed as an analytical platform, it's strongly recommended to use weak transactions, eventual consistency, purposeful data redundancies, idempotent operations and mappings via cloud functions between immutable data structures in most use cases.
Transactional View
Independent of the selected consistency mode each transaction is invisible to others until it's committed. During function evaluation a transactional view of the project graph is provided. This means that changes to the graph are seen locally within the same transaction in a single function evaluation. By committing the transaction the changes are applied to the global project graph. Transactions will be committed automatically after the function evaluation has finished if they haven't been committed or reverted manually before.

The green elements are added and the red elements are removed by the transaction at the illustrated project graph.

The green elements are added and the red elements are removed by the transaction at the illustrated project graph.
Commit
The commit applies all changes to the project graph and makes them visible to other functions and transactions.
Committing the current transaction
Revert
A transaction can also be reverted as long as it's not committed.
Reverting the current transaction
Sequential Transactions
A function can easily perform multiple transactions sequentially.
Performing sequential transactions
Nested Transactions
It's also possible to work with multiple nested transactions.
Performing nested transactions