I have an Apache Geode setup, connected with external Postgres datasource. I have a scenario where I define an expiration time for a key. Let's say after T time the key is going to expire. Is there a way so that the keys which are going to expire can make a call to an external datasource and update the value incase the value has been changed? I want a kind of automatic syncing for my keys which are there in Apache Geode. Is there any interface which i can implement and get the desired behavior?
Auto Syncing for Keys in Apache Geode
159 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?
I am not sure I fully understand your question. Are you saying that the values in the cache may possibly be more recent than what is currently stored in the database?
Whether you are using Look-Aside Caching, Inline Caching, or even Near Caching, Apache Geode combined with Spring would take care of ensuring the cache and database are kept in sync, to some extent depending on the caching pattern.
With Look-Aside Caching, if used properly, the database (i.e. primary System of Record (SOR), e.g. Postgres in your case) should always be the most current. (Look-Aside) Caching is secondary.
With Synchronous Inline Caching (using a
CacheLoader/CacheWritercombination for Read/Write-Through) and in particular, with emphasis onCacheWriter, during updates (e.g.Region.put(key, value)cache operations), the DB is written to first, before the entry is stored (or overwritten) in the cache. If the DB write fails, then the cache entry is not written or updated. This is true each time a value for a key is updated. If the key has not be updated recently, then the database should reflect the most recent value. Once again, the database should always be the most current.With Asynchronous Inline Caching (using AEQ + Listener, for Write-Behind), the updates for a cache entry are queued and asynchronously written to the DB. If an entry is updated, then Geode can guarantee that the value is eventually written to the underlying DB regardless of whether the key expires at some time later or not. You can persist and replay the queue in case of system failures, conflate events, and so on. In this case, the cache and DB are eventually consistent and it is assumed that you are aware of this, and this is acceptable for your application use case.
Of course, all of these caching patterns and scenarios I described above assume nothing else is modifying the SOR/database. If another external application or process is also modifying the database, separate from your Geode-based application, then it would be possible for Geode to become out-of-sync with the database and you would need to take steps to identify this situation. This is rather an issue for reads, not writes. Of course, you further need to make sure that stale cache entries does not subsequently overwrite the database on an update. This is easy enough to handle with optimistic locking. You could even trigger a cache entry remove on an DB update failure to have the cache refreshed on read.
Anyway, all of this is to say, if you applied 1 of the caching patterns above correctly, the value in the cache should already be reflected in the DB (or will be in the Async, Write-Behind Caching UC), even if the entry eventually expires.
Make sense?