?
Solved

Can Coherence update cache from 2 sources and how it works

Posted on 2013-05-30
4
Medium Priority
?
459 Views
Last Modified: 2013-06-09
I have a Rest Based Java application which creates and gets data from SAP Gateway for sales order. The Order in SAP keeps updating with status of order such as dispatch/closed/canceled from messages.

The application is expected to be slow. Introducing coherence in java to SAP layer is expected to improve the performance but there is a risk that the data in coherence layer will be stale and so order data on UI will be old due to cached data.

How can we handle coherence cached order detail data which is getting updated from 2 sources?

Should we upgrade to SAP Hana (which is not popular or yet stabilized) in comparison to Coherence/Giga Spaces/Data Grid. Which is the best caching mechanism and how to handle  stale data.
0
Comment
Question by:jgdvishnu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 28

Assisted Solution

by:dpearson
dpearson earned 1500 total points
ID: 39212372
Are you saying that you are updating the order status without always doing this through the coherence layer?

If so, stale data in the cache is inevitable - as the cache is unaware of some updates and will only see them when you read through the cache to the data store.  If you always do this read through then you'd get no stale data - but you'd also get no benefit from the cache.

The only way to ensure the cache is not storing stale data is to ensure that any time the data being cached changes, that the new value is explicitly sent to the caching layer (coherence or whatever you choose to use).  If you do that, there should never be a problem with stale data.

However, for many applications having stale data is not a huge problem.  You may for instance decide that it's acceptable for the data to be up to 1 minute out of date.  You can support that by having the cache layer only cache the data for 1 minute before evicting it.  That can still give you a lot of performance benefits if the same data set is frequently requested, but occasionally you will be viewing out of date information.

You would of course then need to handle that if a user attempts updates based on that out of date information.  E.g. You could store a 'last-update-timestamp' in the data set, and send that in with any updates.  If the data later receives a timestamp which doesn't match the current value it knows that somebody changed the data and the request is based on out of date information and should be rejected.

If your application cannot ever allow that to happen then you need to ensure that the cache sees all updates.

Hope that helps,

Doug
0
 

Author Comment

by:jgdvishnu
ID: 39233217
Doug,

thanks a lot.
One part of the answer still needs clarification.
In coherence, Is it possible to update some table frequently compared to other tables.
if yes then how
0
 
LVL 28

Accepted Solution

by:
dpearson earned 1500 total points
ID: 39233504
I'm not familiar with the specifics of how you configure Coherence, but generally you can support this only if you create 2 logical caches - one that updates frequently (and is used to cache table set #1) and one that updates less frequently (and is used to cache table set #2).  

How hard that is to support (having 2 caches to the same db) depends on your application, but it may be significant work to add it in.
0
 

Author Closing Comment

by:jgdvishnu
ID: 39233557
this is a good insight into the problem.
0

Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question