Best way to keep a 'history' of cache changes?

Simple question, really, which I guess many people have run into before, so I'm looking for a bit of 'best practice' as regards Coherence.
We have a distributed cache which is holding financial data (Portfolio Positions), and we plan to update these using Entry Processors for scalability (as a single incoming Trade could affect multiple Positions, so we want them processed in parallel). So far, so good. (I hope! If you have a better approach, please feel free to add it. :))
Now, each Position that is modified needs to be 'audited', so we have a 'before' and 'after' image. This needs to be persisted. I have currently created a separate cache - 'PositionHistoryCache' - and set it up so it's flushed to Oracle in a "write behind" manner. This seems to work OK - i.e. updating this 'other' distributed cache from within the Entry Processor works fine. Does this seem sensible as an approach as regards keeping 'history' - i.e. using a separate cache and 'put'ing to it?
Also, I'm keen not to run into any 'reentrancy' problems in our application. So what's the general rule here, when we are using Entry Processors elsewhere? Is it simply the 'service name' that determines whether the distributed caches are served by different service threads? In other words, as long as the 'history' cache we are trying to talk to is declared with a different 'service-name' to the cache that has the calling Entry Processor we can freely 'put' to it without issue?
Many thanks if you can help clear up the above design issues.

Hi Steve,
yes, the (possibly inherited) service name for the cache scheme determines which cache service a cache belongs to.
As for best practice, you probably would want to use key-affinity and the cache same service for the audit cache and try to put the data into the backing map directly. Since this is inserts and child records we are speaking about (access to the audit record is demarcated by access to the to-be-audited record, and if you do it from an entry-processor then the audit entry is always local because it is affine to the to-be-audited entry), it should be safe, provided that you only ever insert/update the audit entry into the backing map from entry processors manipulating the parent entry.
You would still have the same failure cases as the different cache service cache.put approach: if you crash after the audit record has been inserted but process did not finish, then you may end up with lost but audited updates or duplicate audit records for a single change.
Note that this is an advanced functionality and you would probably want to consult with your Oracle support representative to ensure that you know the implications this approach brings with itself with each Coherence version you try to use it with.
An alternative approach would be to move audit into the same cache as the record and use key affinity to ensure audit records reside on the same node as the audited record, and use EntryProcessors sent to both the changed and the audit entry keys together to update both records together atomically. This is a much safer approach, it is guaranteed to be atomic as long as only the cache is concerned, on the other hand you need to know the audit entry key in advance and use the key-based invokeAll method (you can't use the filter-based invokeAll method as that cannot add new entries). Also you have additional work if you use filter-based read operations to filter out audit records from query results.
Best regards,
Robert

Similar Messages

  • What is the best way to keep your macbook pro in tip top condition. performance wise

    What is the best way to keep the performance of a macbook pro in tip top shape.  Over the years my computer seems to act like a pc with all of its hicups and lockups.
    I am running mountain lion and this computer is approx 2 years old.
    Not sure if there is some sort of software that will help with this or is there something else I can do.
    Thanks
    GAJ

    How to maintain a Mac
    1. Make redundant backups, keeping at least one off site at all times. One backup is not enough. Don’t back up your backups; all should be made directly from the original data. Don’t rely completely on any single backup method, such as Time Machine. If you get an indication that a backup has failed, don't ignore it.
    2. Keep your software up to date. In the App Store or Software Update preference pane (depending on the OS version), you can configure automatic notifications of updates to OS X and other Mac App Store products. Some third-party applications from other sources have a similar feature, if you don’t mind letting them phone home. Otherwise you have to check yourself on a regular basis.
    Keeping up to date is especially important for complex software that modifies the operating system, such as device drivers. Before installing any Apple update, you must check that all such modifications that you use are compatible. Incompatibility with third-party software is by far the most common cause of trouble with system updates.
    3. Don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” “accelerators,” "boosters," “extenders,” “cleaners,” "doctors," "tune-ups," “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” "disk tools," or "utilities." With very few exceptions, such stuff is useless or worse than useless. Above all, avoid any software that purports to change the look and feel of the user interface.
    It's not much of an exaggeration to say that the whole "utility" software industry for the Mac is a fraud on consumers. The most extreme examples are the "CleanMyMac" and “MacKeeper” scams, but there are many others.
    As a rule, the only software you should install is that which directly enables you to do the things you use a computer for, and doesn't change the way other software works.
    Safari extensions, and perhaps the equivalent for other web browsers, are a partial exception to the above rule. Most are safe, and they're easy to get rid of if they don't work. Some may cause the browser to crash or otherwise malfunction.  Some are malicious. Use with caution, and install only well-known extensions from relatively trustworthy sources, such as the Safari Extensions Gallery.
    Never install any third-party software unless you know how to uninstall it. Otherwise you may create problems that are very hard to solve. Do not rely on "utilities" such as "AppCleaner" and the like that purport to remove software.
    4. Don't install bad, conflicting, or unnecessary fonts. Whenever you install new fonts, use the validation feature of the built-in Font Book application to make sure the fonts aren't defective and don't conflict with each other or with others that you already have. See the built-in help and this support article for instructions. Deactivate or remove fonts that you don't really need to speed up application launching.
    5. Avoid malware. Malware is malicious software that circulates on the Internet. This kind of attack on OS X was once so rare that it was hardly a concern, but malware is now increasingly common, and increasingly dangerous.
    There is some built-in protection against downloading malware, but you can’t rely on it — the attackers are always at least one day ahead of the defense. You can’t rely on third-party protection either. What you can rely on is common-sense awareness — not paranoia, which only makes you more vulnerable.
    Never install software from an untrustworthy or unknown source. If in doubt, do some research. Any website that prompts you to install a “codec” or “plugin” that comes from the same site, or an unknown site, is untrustworthy. Software with a corporate brand, such as Adobe Flash Player, must come directly from the developer's website. No intermediary is acceptable, and don’t trust links unless you know how to parse them. Any file that is automatically downloaded from the web, without your having requested it, should go straight into the Trash. A web page that tells you that your computer has a “virus,” or that anything else is wrong with it, is a scam.
    In OS X 10.7.5 or later, downloaded applications and Installer packages that have not been digitally signed by a developer registered with Apple are blocked from loading by default. The block can be overridden, but think carefully before you do so.
    Because of recurring security issues in Java, it’s best to disable it in your web browsers, if it’s installed. Few websites have Java content nowadays, so you won’t be missing much. This action is mandatory if you’re running any version of OS X older than 10.6.8 with the latest Java update. Note: Java has nothing to do with JavaScript, despite the similar names. Don't install Java unless you're sure you need it. Most people don't.
    6. Don't fill up your boot volume. A common mistake is adding more and more large files to your home folder until you start to get warnings that you're out of space, which may be followed in short order by a boot failure. This is more prone to happen on the newer Macs that come with an internal SSD instead of the traditional hard drive. The drive can be very nearly full before you become aware of the problem.
    While it's not true that you should or must keep any particular percentage of space free, you should monitor your storage use and make sure you're not in immediate danger of using it up. According to Apple documentation, you need at least 9 GB of free space on the startup volume for normal operation.
    If storage space is running low, use a tool such as OmniDiskSweeper to explore the volume and find out what's taking up the most space. Move seldom-used large files to secondary storage.
    7. Relax, don’t do it. Besides the above, no routine maintenance is necessary or beneficial for the vast majority of users; specifically not “cleaning caches,” “zapping the PRAM,” "resetting the SMC," “rebuilding the directory,” "defragmenting the drive," “running periodic scripts,” “dumping logs,” "deleting temp files," “scanning for viruses,” "purging memory," "checking for bad blocks," "testing the hardware," or “repairing permissions.” Such measures are either completely pointless or are useful only for solving problems, not for prevention.
    To use a Mac effectively, you have to free yourself from the Windows mindset that every computer needs regular downtime maintenance such as "defragging" and "registry cleaning." Those concepts do not apply to the Mac platform. A computing device is not something you should have to think about very much. It should be an almost transparent medium through which you communicate, work, and play. If you want a machine that is always whining for your attention like a neurotic dog, use a PC.
    The very height of futility is running an expensive third-party application called “Disk Warrior” when nothing is wrong, or even when something is wrong and you have backups, which you must have. Disk Warrior is a data-salvage tool, not a maintenance tool, and you will never need it if your backups are adequate. Don’t waste money on it or anything like it.

  • What is the best way to keep my personal files stored in iCloud separate from my work-related files?

    What is the best way to keep my personal files stored in iCloud separate from my work-related files? It seems that I'm not allowed to link my iPad mini and my work iMac using two different accounts, so I'm wondering how to make my single personal account work for both, while keeping personal vs work files reasonably separated.
    Thanks for any suggestions.

    Is it possible for you to upgrade your account to iCloud Drive? That would mean, all Macs upgraded to Yosemite, and all mobile devices to iOS8?
    See:  iCloud Drive FAQ and iCloud: About using iWork for iOS and iCloud
    In iCloud Drive you could create two separate custom folders, one for work documents and one for private documents and organize your documents there.  Don't use the app specific folders (Keynote, Pages, Numbers, ...) , because you can only create one level of folders inside these folders.

  • I have a iMac Desktop and MacBook Pro laptop. I generate my work related files on both of these machines. What is the best way to keep the files in these machines synchronized?

    I have a iMac Desktop and MacBook Pro laptop. I generate my work related files on both of these machines. After a few days or weeks, I have new files on some folders on either of the machines that is not on the other machine. What is the best way to keep the files in these machines synchronized?

    How did you transfer the files to the iMac.  If you exported the files out of the MB library using Kind = Current you should get the edited version.  Any other  option may not.
    If you want to keep the two libraries "synced"  any photos you want to move to the iMac should be added to an album, connect the two Mac with a LAN, Target Disk Mode,  Transferring files between two computers using FireWire, with WiFi. and use the paid version of  iPhoto Library Manager to copy that album from the MB library to iMac library.  It will also copy the original and edited versions, keywords, titles, etc.
    OT

  • What is the best way to keep the battery built-in last longer?

    what is the best way to keep the battery built-in in macbook pro last longer???..
    is it by plugged in as many times as we can..and discharge it to 80-90% a week..then charged it back?

    My favorite tip for longer battery life: Uninstall Flash

  • Best way to keep a BSO and ASO in sync?

    Hi all,
    I have been trying to find the best way to keep in sync the same outline. Source is a planning cube, while the "target" is an ASO one for reporting purposes.
    My approach has been to use ODI in order to load the metadata in the Planning app, but after some research I figured out I cannot use ODI to build the ASO outline due to license restricitions (It isn't "free" for this).
    As I already have created the interfaces to load the metadata in the planning app, I would like to keep this and then create a method in order use the BSO outline to get the ASO one
    I know there is a wizard to convert the BSO outline to an ASO one, but I wonder if there is a way to execute and automate this process by using a command line script? and if yes, where I can find information about how to set this operation ( with all the automatic outline changes we found in the wizard)
    I appreciate you comments and I'm open to receive you suggestions about any method to get both outlines in sync.
    Thanks in advance
    Edited by: Motorstock on Oct 4, 2011 8:28 AM

    Depending on version you can also extract planning dimensions using the outline load utility - http://john-goodwin.blogspot.com/2011/04/planning-11121-exporting-metadata.html
    Though If you are using ODI to load planning metadata from a source you could create an essbase load rule to load from the same source to the ASO database.
    I would have thought if you are not licensed to use ODI with ASO then you are not licensed to use ASO, it used to be that if you only had a license for planning then you couldn't use ASO.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Best way to keep track of family members, etc

    Hi-
    I am a hobby photographer, and have been playing around with the trial version Aperture to replace iPhoto, and I have some questions.
    1. What is the best way to keep track of family members? For example, I like to basically keep track by setting keywords, adding a keyword for each family member & dog. Is this still the way to do it in aperture, or is there a different solution?
    2. If keywords are still the way, what is the fastest way to do this (in particular for multiple files at a time)? The various keyword buttons & shortcuts seem to only apply to one image at a time, whereas the batchchange option seems to only rely on freeform text-- which makes it likely that somewhere along the line I will get a typo.
    Thanks,
    -jamie

    You can apply a keyword to multiple images by selecting a group of images and dropping a keyword from the keyword HUD onto one of the selected images.
    I created keywords in the keyword HUD for family members, events (Christmas, Birthday, Vacation etc.), and some other things. Keywords you have already typed into an image will be in the keyword HUD already. I created a hierarchy of keywords such as:
    People
    -Family
    --(names)
    -Friends
    --(names)
    Events
    -Holidays
    --Christmas
    --Halloween
    Sorry for the dashes to show the indentations. I tried spaces but they didn't work for some reason.
    Message was edited by: Badunit

  • Best way to keep imac and mac book in sync?

    I have an imac g5 and a macbook. I have made the initial transfer of all files from the desktop to the laptop. What is the best way to keep the two in sync, such as iTunes, iPhoto, etc? I'm sure this is a stupid question, but I need help!! Thanks in advance

    Check out the application called "SuperDuper!" at www, shirtpocket;
    SD will 'clone' your Mac to your Macbook if you start the Macbook in Target mode.
    You'll have 2 identical Macs with identical everything.
    Now there's a start for you

  • What is the best way to keep your files organised

    I would like to know what is the best way to keep your file organise when I am
    Loading program's like numbers and pages from iPhone to MacBook i alway 
    Get double of the same work sheet

    I would like to know what is the best way to keep your file organise when I am
    Loading program's like numbers and pages from iPhone to MacBook i alway 
    Get double of the same work sheet

  • What is the best way to keep my retina screen clean?

    What is the best way to keep my retina screen clean?

    I use Windex Electronics Cleaner on the MBP displays.  I spray some on a small microfiber cloth and wipe the display.  Then I use a large microfiber cloth to dry it.  When finished, the display looks like the day it came out of the box.
    http://www.windex.com/en-US/Products/Pages/electronic-cleaner-and-wipes.aspx
    DO NOT CONFUSE THIS WITH ORDINARY WINDEX WINDOW CLEANER!
    Ciao.

  • Best way to keep files on iMac and Powerbook in Sync

    Best way to keep files on IMac and Macbook Pro in Sync

    Hi ...
    Using the Migration Assistant would be tedious and time consuming.
    You can setup an iCloud account and sync your Macs since you have Lion installed on both. If you have iCloud enabled, if for example you add a bookmark in Safari, that bookmark will sync via your Wi-Fi network to the other Mac automatically.
    Read here > Apple - iCloud - Learn how to set up iCloud on all your devices

  • How is the best way of keeping your macbook pro battery healthy

    what is the best way of keeping your macbook pro battery healthy there are so many ways what is the best way?

    Read these two Apppe articles:
    http://http://www.apple.com/batteries/notebooks.html
    http://support.apple.com/kb/HT1446
    I generally keep my MBP connected to AC as much as possible and try to make certain that at least monthly I run it on the battery to about the 40% charge level.
    Ciao.

  • I just switched from pc to mac.  what is the best way to keep Windows?  Parallel or Boot camp?

    I have just switched from pc to mac.  What is the best way to keep Windows, Parallel of Boot camp?

    Parallels should be able to handle that without any problems.
    There is a version of both of those that will run on the Mac. So you might consider upgrading to that version instead of going with Windows on your Mac.
    Allan

  • What's the best way to keep two hard dives synced?

    I've been looking at the best way to protect my data and I've learned a few things. My first thought was RAID but a bit more research showed RAID is not a fix-all. It has it's own problems and even if I use a RAID1 or RAID10 array (depending on the number of drives) a failure in one drive can actually set off another drive, killing multiple drives and still destroying my data. There are a few other issues I've seen, such as the way you need to manage a RAID system that don't overly appeal to me.
    So what I'm thinking now is two separate hard drives that are synced in some manner. Both of these drives are going to be sitting on the back of my iMac at all times so there's no real worry about their needing to be connected to back up. The question is how best to do it?
    So far my options are:
    Chronosync: Software wise, I know this can sync across drives and as such has been something that interests me. However, I'm not sure how powerful it is and I'm still curious about how I would have to use it.
    SuperDuper: Same thing as Chronosync, really, just a different piece of software.
    Rsync: To be honest, this is the one that interests me the most. I need to look into it a bit more I'm starting to think this might be a great choice for me. With some caveats.
    Basically, here are the things I'm going to use it for:
    Two 3–4 TB HDDs or RAID0 arrays.
    Storing of general project archives, images, documents, movies, music, that kind of thing.
    Possibly for system backup with Time Machine.
    Now, how I'd prefer it to work is:
    I keep both hard drives plugged in via FireWire cables.
    Ideally, whenever I edit, add or delete a file on one hard drive the change is immediately made to the other.
    Once the syncing is set up I never touch it again, don't have to.
    The only time I ever have to come back to it is if I'm swapping out one or both of the drives for larger ones.
    All of this is controlled by some sort of GUI
    I'm willing to accept terminal commands if I have to... But I'd really prefer not to. Also, if the syncing has to be done every hour or once a day or some other similar schedule I'm willing to accept that as well, though it's not preferred.
    So that's what I'm looking at doing. I'd love to hear what you guys think.

    True, it's not technically backup in the traditional sense. What I'm looking for is data protection and redundancy, which is a factor of backups. So in that sense it kind of is, but I see your point.
    Anyway, the reason I'm avoiding RAID is because:
    1. It can be a pain to manage.
    2. It's horribly inflexible.
    3. It's protection is limited.
    4. It brings it's own set of hazards.
    5. RAID arrays can be very expensive once they start getting complex.
    I will likely end up going RAID partially in the end simply because I have a 2 TB external and it's filling fast. I can grab a 3 TB now but I've heard reliability issues so instead I'm thinking two 4TB (2x2TB) RAID0 arrays that I sync.
    This gives me the benefit of RAID in a simple form, which bypasses the larger array complexities, while leaving me still fully protected and highly flexible. It also doesn't have the inherent risks of RAID because if one of the arrays goes down it will in no way effect the other.
    Honestly, I'm not worried about file changes. At all. I'm the only one who's touching the files (well, not true, but everyone else only has read-access). I also tend to not delete things (which is why I have a 2 TB drive that's filling fast). Expansion is my main concern and RAID expansion can be a nightmare unless you go for some of the more expensive systems that are easier to manage. With ease of management comes a hefty price.

  • Best way to keep a JList in gui and a list in domain synchronized ?

    Hi I would like to know what the best way would be to keep a JList displaying the exact sequence and contents of items contained in a list in the domain (an arrayList in this case)
    at the moment I have an adapter class wrapping around an ArrayList in order to make it into a ListModel which I use in the construction of my JList. ythe JList only knows this model trough the package interface. I was wondering is this the way to go or not ? if not do you have a good example of how to do it the right way ?
    thanks in advance.
    Boran.

    OMG I've wasted my life! :) Thanks man!
    Although, now I don't understand why there's no some kind of JavaBeanListProperty - when clearly there's a mechanism for handling this kind of stuff...

Maybe you are looking for

  • Change the flow of the BPEL service based on WSDL operation

    Hi, I have a wsdl which has three types on operations: 1) SOAP 2) HTTP GET 3) HTTP POST I have a BPEL process in which the flow need to be decided on basis of operation of the incoming message... i.e; If it is a SOAP then I should execute a particula

  • Business Blueprint Structures in Solution Manager

    Hi, Can we change the structure node names under Business Blueprint tree on Solution manager. This is accessed by SOLAR01 transaction. Thanks and Regards, Vinayak Thorat

  • Windows only finds the 32GB mSSD not HD when installing

    Hi all, I really do hope that someone can offer me some help as this problem is really making me want to chuck this machine in the bin and give up on Windows all together. My machine is one of these HP elitebook laptops that has both a 32GB mSSD driv

  • Best Program to Split Up Large .mov Files?

    Hi Applers, Let's say I have a large .mov file (1920x1080, MPEG-2, 1h46m long). Now I want to divide it up into 15-20 minute chunks. If I wanted to avoid using FCP or Compressor, what is the best program to do split it up with the least amount of tro

  • Help me with driver please

    if i put my iphone in my pc it sais driver is not correct try to find it at the products website to download it but i cant find it help please