We have Apache Geode connected to Postgres using an AEQ + AsyncCacheListener configured to write data to Postgres. During async write, we submit the list of events that we want to persist and it asynchronously inserts those events. Let's say I have two client applications which calls processEvents for async writing and both have some events in common which violate some key. But, after client calls processEvents, control is immediately returned to client. In such cases how will client know if some issue occurred? What are the best practices to tackle this?
Multiple data insertions using async writing with Apache Geode
184 Views Asked by user956021 At
1
There are 1 best solutions below
Related Questions in GEMFIRE
- Gemfire offers Time To Live for an element?
- Gemfire HTTP Session Manager EntryIdleTimeout is not the same error
- GemfireXD - PreparedStatement setArray for String(VARCHAR) array not working
- Gemfire Junit for multi module project tests are taking too long
- How to know Gemfire/Geode cluster size from the client
- How to use GFSH to connect peer to peer environment?
- GemfireXD - How to parallelize data processing for bigger data size
- Using Gemfire on high volume transaction system
- Gemfire - Cannot start locator
- Gemfire WAN Gateway-sender configuration
- Gemfire WAN Gateway-senders/receivers members
- Gemfire, JMX Manager startup to fail because: 'HTTP service failed to start'
- Can GemFire cache clients create Regions on servers?
- Gemfire/Geode Back-ups
- Gemfire client/server architecture and region lock
Related Questions in GEODE
- Gemfire HTTP Session Manager EntryIdleTimeout is not the same error
- How to know Gemfire/Geode cluster size from the client
- Gemfire WAN Gateway-senders/receivers members
- Can GemFire cache clients create Regions on servers?
- Gemfire/Geode Back-ups
- Geode native client RegisterAllKeys produces NotConnectedException
- Storing Protobufs in Gemfire/Geode?
- geode pdx date formats
- Issues with 2nd geode container connecting to locator at port 10334
- Setting up Custom class Object as Key/value in Apache Geode
- Apache Geode down when deploy jar files
- How to use Apache Geode type registry to write arrays of domain objects
- Cursor equivalent for Gemfire?
- Apache Geode + Spring Boot: Suspect member host (reason=member unexpectedly shut down)
- How to connect to Gemfire docker instance?
Related Questions in SPRING-DATA-GEMFIRE
- Gemfire Junit for multi module project tests are taking too long
- Using Gemfire on high volume transaction system
- Gemfire - Cannot start locator
- Gemfire WAN Gateway-sender configuration
- Gemfire WAN Gateway-senders/receivers members
- Gemfire, JMX Manager startup to fail because: 'HTTP service failed to start'
- Can GemFire cache clients create Regions on servers?
- Gemfire client/server architecture and region lock
- Gemfire - Crud Repository - findBy Implementation
- GemFire CacheLoader from Cassandra
- Gemfire Pdx Serialization Put All
- How can i get complete data from apache geode if geode is having partial data and other data is present in external datasource
- calling getall in apache geode to getall data for the keys in the list is slow
- Way to call data source only once for multiple keys in apache geode
- Dynamic GemFire Region Creation with PCC
Related Questions in SPRING-BOOT-DATA-GEODE
- Apache Geode + Spring Boot: Suspect member host (reason=member unexpectedly shut down)
- How can i get complete data from apache geode if geode is having partial data and other data is present in external datasource
- Multiple data insertions using async writing with Apache Geode
- Auto Syncing for Keys in Apache Geode
- Integration tests with Cucumber using embedded GemFire for a Spring Boot application deployed in an Apache Geode client/server topology
- Geode/GemFire/PCF/SCDF error - user not authorized for DATA:WRITE / DATA:READ permission
- Get region statistics in spring data geode client application
- Spring Boot Apache Geode error refused connection: Peer or client version with ordinal 120 not supported
- Upgrade to spring-geode-starter 1.4.2 produces condition, introspection and ClassNotFoundExceptions
- Spring Boot Geode Unsatisfied dependency expressed through method 'sessionRegion'
- Geode spring boot Cache Client Updater Thread crash
- geode client server version not supported - Peer or client version with ordinal 100 not supported
- Geode/GemFire/PCC error - No security credentials are provided
- Spring Boot GemFire Pivotal Cloud Cache @EnableClusterAware and ClientCacheRegionFactory
- Unable to Instantiate Class while Alter Region adding cache loaded to that region
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
What do you mean by the events in common "violate some key"? Like a primary or foreign key constraint, or some other database constraint perhaps (e.g. uniqueness, non-null values, etc)?
Handling a conflict depends on the importance and nature of the data being inserted, or written to the backend (Postgres) database from Geode and its significance to the application, from a requirements and business logic POV.
If 2 (or more) client applications are writing to the same cache/database entries/records, then certainly some type of collision will eventually occur, and how it is handled will depend on the data and the type of operation performed on the data.
In general, handling the violation closer to where and when the violation occurs (e.g. inside the
AsyncEventListeneritself) maybe preferable or ideal, since then you should have most of the necessary information (e.g.DataAccessException, events, additional capabilities to query the DB) to deal with the situation.Inside the AEQ Listener, you could employ different strategies depending on the data and operation as determined by the application:
You could employ Geode to conflate events stored in the AEQ for the same key, which should minimize collisions/conflicts.
If the client (as in "client" in a client/server topology) needs to be informed, then you could write the failed events to another
Regionwhere a client registers a CQ to be notified when entries are written to this (failed events)Region. The client-side handler associated the CQ could then take the appropriate action, such as notifying the end-user, refreshing and then retrying the operation, and so on.Given the async nature of the initial write, then you can only respond asynchronously once the violation occurs. This is not unlike in a Reactive world (namely with onSuccess/onFailure event handlers).
So, in this situation, I don't think there really is a "best practice" per-say, rather only "recommendations". For example, handling the situation as near to the actual occurrence of the violation as possible, since handling the violation usually involves having the necessary information readily available to make the best possible, informed decision on the right course of action.
Sometimes you can automate the recovery, other times you might need manual intervention. Most definitely, do not guess. Clearly document your application/systems (configured) behavior when it can handle a situation and when it cannot.
I don't think there is a general, 1 size fits all solution in this case.
I hope this gives you some ideas to think about.