Solved

Can Coherence update cache from 2 sources and how it works

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

728 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