orleans icon indicating copy to clipboard operation
orleans copied to clipboard

need a Orleans.Transactions.SqlServerStorage or Orleans.Transactions.AdoNet

Open Qoooooooooooo opened this issue 8 years ago • 21 comments

Will this add to the later version?

Qoooooooooooo avatar May 08 '18 02:05 Qoooooooooooo

@sergeybykov, @jdom, @ReubenBond, @xiazen, @jason-bragg What would be needed to for this in ADO.NET? I see the shape of the data could be derived from here, then maybe a bit configuration, but are there pointers what other classes? Apologies for paging everyone and their friends, I'm trying to gather the required work here to to add the pieces and then tests (which might become a source of friction too), I see some documentation at https://dotnet.github.io/orleans/Documentation/grains/transactions.html.

@sundong1982 Naturally, but I'm myself busy till early June. :) The package likely will be named Microsoft.Orleans.Transactions.AdoNet, i.e. not ending SqlServerStorage (in case you want to edit the headline).

veikkoeeva avatar May 08 '18 09:05 veikkoeeva

Or perhaps a better question would be, how much in flux is the feature still? Cross-referencing https://github.com/dotnet/orleans/pull/4568/ as well as https://github.com/dotnet/orleans/pull/4566 and related to my previous questioned, indeed, maybe just to take a look at the two existing libraries to estimate some of the work needed.

Also related: https://github.com/dotnet/orleans/issues/3369.

veikkoeeva avatar May 08 '18 10:05 veikkoeeva

The transaction system is still very much in flux.

jason-bragg avatar May 08 '18 17:05 jason-bragg

@veikkoeeva thx

Qoooooooooooo avatar May 10 '18 06:05 Qoooooooooooo

The plan is still to support storage abstractions for transactions so they can run against a variety of storage systems, but these surfaces are still in flux. I encourage others to experiment with these systems to help us vet them, but I am of the opinion that the system is still to immature to start building out a full set of storage implementations.

jason-bragg avatar May 10 '18 19:05 jason-bragg

@jason-bragg Out of curiosity (no need to exhaust if this is a bad question), could the transaction utilize TransactionScope? Or otherwise be like using(var transaction = new DistributedTransaction(grain1, grain2, grain3)) { /* ... */ }? Being compatible, in some way, with TransactionScope would be cool, but might be too difficult (I have not examined the details).

veikkoeeva avatar May 10 '18 19:05 veikkoeeva

Transactions seems to be out of beta phase and production ready. Anyone working on building a adonet transaction storage?

jinhong- avatar Apr 11 '19 05:04 jinhong-

@jinhong- I'm not aware of at least. I'm not sure if there's a set of documentation or guidance either to help adding to other providers such as ADO.NET. Do you have a case at hand?

veikkoeeva avatar Apr 11 '19 09:04 veikkoeeva

There's a testkit out for testing custom transaction storage provider. Please look for Microsoft.Orleans.Transactions.TestKit.xUnit, which is testing nuget for xUnit. If that is not your testing framework, you can still use Microsoft.Orleans.Transactions.TestKit.Base, where all the base class of the test collections are. Just you will need to write extra code to hook it up with your testing framework.

As for docs, I think @jason-bragg wrote something, but I will let him explain the details, since I don't remember what docs is there exactly.

xiazen avatar Apr 11 '19 18:04 xiazen

@veikkoeeva At the moment transactions only works on Azure Table and we are not running Orleans in Azure. We need some sort of alternative to run transactions outside of Azure basically. At the moment we are exploring the usage of CockroachDB for scale out, which means that have a ADO.NET provider that can support the PostgreSQL dialect should theoretically work

jinhong- avatar Apr 22 '19 03:04 jinhong-

At the moment transactions only works on Azure Table and we are not running Orleans in Azure.

That's incorrect. You should be able to run transactions over any storage provider.

sergeybykov avatar Apr 22 '19 15:04 sergeybykov

@sergeybykov Do you mean running it using the storage bridge? I read it on the transactions documentation that we should only use it for development purposes because it is not as efficient compared to the native transaction storage implementation. Does this still hold true?

jinhong- avatar Apr 24 '19 03:04 jinhong-

yes I think that still holds the truth.

xiazen avatar Apr 24 '19 17:04 xiazen

Can we get an update on this? It feels like transactions have just been forgotten about. @sergeybykov @ReubenBond

murshex avatar Aug 21 '20 20:08 murshex

Hi @c0nd3v, we are using transactions in production. If there's something that you are looking for that is not available today, are you willing to submit a PR?

ReubenBond avatar Aug 21 '20 21:08 ReubenBond

@ReubenBond There is currently only one official implementation of transactional state for a storage provider (Orleans.Transactions.AzureStorage). In the documentation it says,

"For any transactional state that does not have a store configured for it, transactions will attempt to fail over to grain storage using a bridge. Accessing transactional state via a bridge to grain storage will be less efficient and is not a pattern we intend to support long term, hence the recommendation that this only be used for development purposes."

Can you please make an official statement on this?

murshex avatar Aug 21 '20 22:08 murshex

We have used the transaction storage bridge in production without issue.

The big difference between the bridge and native is how the data is stored and what operations a transaction needs to do with the storage. In the bridged storage, all pending transaction states are stored inside a list in a single record. As a transaction goes through the phases, states are added, updated, and removed from that list. In the native storage, states are stored as separate records. This generally means that writes are smaller and inserts are more common.

I can't speak to what support the Orleans team will provide, but outside of that, determining what storage access patterns are acceptable for your application and storage is an evaluation that you'll need to make.

jsteinich avatar Sep 11 '20 13:09 jsteinich

Hi @ReubenBond if I am interested in contributing with an Implementation for AdoNet ( we are using Postgresql, but I don't think it will too much extra effort to add support for other databases) should I create a PR on the Orleans repository or should be on the OrleansContrib repository?

gatm50 avatar Aug 13 '21 20:08 gatm50

I agree with what @jsteinich says. Essentially, that the storage bridge is likely sufficient for most cases. Writing a specialized transaction storage provider is very nuanced, undocumented, and I don't recommend it unless the other options have been exhausted and it has been deemed necessary.

I would like to open-source some internal transaction storage providers which are used at Microsoft which target Cosmos DB. Those would serve as additional examples for how to write a transaction storage provider.

@gatm50 I recommend creating a separate repository on OrleansConrtib once it's ready. If it gets good mileage in production across a few projects then we can consider moving it to the main repository at some point, but I also think that OrleansContrib is a fine place for providers - even providers which the team contributes to directly (such as Redis & CosmosDB)

ReubenBond avatar Aug 13 '21 21:08 ReubenBond

We are marking this issue as stale due to the lack of activity in the past six months. If there is no further activity within two weeks, this issue will be closed. You can always create a new issue based on the guidelines provided in our pinned announcement.

ghost avatar Dec 11 '21 01:12 ghost