Solved

Can Coherence update cache from 2 sources and how it works

Posted on 2013-05-30
4
454 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 27

Assisted Solution

by:dpearson
dpearson earned 500 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 27

Accepted Solution

by:
dpearson earned 500 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

749 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