You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Shaomin Zhang <Sh...@tudor.com> on 2016/04/18 12:29:20 UTC

write-behind on two caches in transaction

Hi

I have two caches: order and trade where one order entry linked to multiple trade entries and need to persist the two caches into their database tables using write-behind in transactions.

I don't think that simply configuring the two cache to be write-behind enabled will work as they will be out of synchronization. Am I right?

What I am planning to do is to configure the master cache, order, to be write-behind and this cache will write the order and the related trades into database when a write is triggered. Is this ok? Any better design?

Thanks

Shaomin

_________________________________________________________

This email, its contents, and any attachments transmitted with it are intended only for the addressee(s) and may be confidential and legally privileged. We do not waive any confidentiality by misdelivery. If you have received this email in error, please notify the sender immediately and delete it. You should not copy it, forward it or otherwise use the contents, attachments or information in any way. Any liability for viruses is excluded to the fullest extent permitted by law.

Tudor Capital Europe LLP (TCE) is authorised and regulated by The Financial Conduct Authority (the FCA). TCE is registered as a limited liability partnership in England and Wales No: OC340673 with its registered office at 10 New Burlington Street, London, W1S 3BE, United Kingdom

Re: write-behind on two caches in transaction

Posted by vkulichenko <va...@gmail.com>.
Hi Shaomin,

With write-behind cache it's impossible to enlist several DB updates in one
transaction, because DB is updated asynchronously and potentially from
different nodes. However, this is possible if you use write-through, in this
mode you can ensure transactional consistency between cache and DB.

Your approach confuses me. Are you updating trades in cache as well? How
does the store knows the set of trades to write to DB?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/write-behind-on-two-caches-in-transaction-tp4279p4297.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.