Comments (8)
Ignite client is thread-safe and can handle many requests in parallel (multiplexing).
It is recommended to create only one long-lived instance (or a small pool of instances) and reuse them across all API requests.
from ignite.
@ptupitsyn - Thank you for your response.
Just to give a background of our use case. we have many microservices (with multiple instances) connect to Ignite. So basically we would be having one client / instance of a microservice. Also is there recommendation on establishing a client connection like using connection pooling in the DB world (I understand in the case of DB connection it is different as we don't reuse the connection). Just making sure I'm following the right standards for a highly transaction system.
from ignite.
I don't have any specific recommendations, it should work well with 1 client instance per microservice. Pooling is not necessary here.
from ignite.
Thank you. Appreciate your response.
from ignite.
@ptupitsyn - I have a sudo code of how my domain transaction is wrapped in a unit of work. Within the same transaction I'm trying to update by cache as well. Is this a good design approach to update by transaction DB and ignite in a single transaction. As soon as I add ignite in a transaction dotnet runtime upgrades the transaction as s 2PC resulting in npsql failure. I assume since I have a transaction opened and using ignite client put() is invoked then it joins to the existing ambient transaction as a volatile resource which is causing this.
Do you think this is possible ? From an application perspective I would like to have the state of the data in transactional DB and cache up-to-date at any point of time.
try
{
using( var transactionScope = new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted },
TransactionScopeAsyncFlowOption.Enabled))
{
//NHibernate ORM using npgsql - create / update
//Apache ignite - put()
transactionScope .Complete();
}
}
catch
{
// handle exception
}
from ignite.
Coordinating a transaction across two databases requires a two-phase commit: https://learn.microsoft.com/en-us/dotnet/framework/data/transactions/committing-a-transaction-in-single-phase-and-multi-phase
Thin client can only do a single-phase commit, so there is no guarantee of atomicity across two DBs.
- This is implemented in "thick" mode and works as expected with
TransactionScope
. Consider using a thick client. - Alternatively, write your own logic to roll back the changes in DB 1 if commit fails in DB 2. Many consider this approach to be more efficient in micro-service scenarios.
from ignite.
@ptupitsyn Thank you for sharing your thoughts. If we do a saga pattern with rollback strategy then we can still stay with thin client right ?
from ignite.
If we do a saga pattern with rollback strategy then we can still stay with thin client right ?
Correct.
from ignite.
Related Issues (20)
- Continuous query using NodeJS client HOT 2
- we need go client sdk HOT 11
- Is there any plan to support window aggregation in Calcite Query Engine
- Is Ignite 2.16.0 impacted by CVE-2024-22243 ? HOT 1
- IBinarizable : Mapping complex objects HOT 9
- I am running a 3-node external cluster, but I find that the memory is growing slowly. By checking the top, I can see that the buffer/cache has been growing slowly and has not been released. What is the reason for this
- Ignite 2.16 is incompatible with recent h2database, h2 must be shaded HOT 2
- Ignite Getting started guide for Java missing something (gives errors) HOT 2
- Support Apache Arrow serialization transfer
- How do I reset the expiration time after ignite sets the expiration time
- In ignite2.16.0 and jdk21, run task with lambda expression, it can not run.
- CPU goes crazy in ignite server
- Spring boot 3 support for Ignite
- Question: CacheStore Configuration using DDL HOT 3
- Question: Apache ignite on kubernetes with Proxy HOT 2
- Ignite cluster discovery HOT 1
- Out of direct memory where flush wal buffer to disk in flush method, please ensure this.
- lz4 upgrade HOT 1
- Unable to connect to ignite with persistence enabled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ignite.