tag:blogger.com,1999:blog-22587889.post618145033323207343..comments2024-02-11T13:21:47.930+05:30Comments on Ruminations of a Programmer: Asynchronous Write Behinds and the Repository PatternAnonymoushttp://www.blogger.com/profile/01613713587074301135noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-22587889.post-4429715756368204062009-02-05T18:40:00.000+05:302009-02-05T18:40:00.000+05:30This post has been cross-posted in Javalobby .. so...This post has been <A HREF="http://java.dzone.com/articles/asynchronous-write-behinds-and" REL="nofollow">cross-posted</A> in Javalobby .. some interesting comments there as well ..Anonymoushttps://www.blogger.com/profile/01613713587074301135noreply@blogger.comtag:blogger.com,1999:blog-22587889.post-11071912149817115512009-02-03T13:21:00.000+05:302009-02-03T13:21:00.000+05:30@Anonymous : While true that most data grids offer...@Anonymous : While true that most data grids offer similar capabilities, the primary focus of the post is to highlight how this paradigm fits nicely into the DDD stack's Repository pattern. The way the repository behaves can be abstracted completely from the application layer. And I like the non-invasiveness of the approach that Terracotta offers.Anonymoushttps://www.blogger.com/profile/01613713587074301135noreply@blogger.comtag:blogger.com,1999:blog-22587889.post-9693432646892779672009-02-03T12:04:00.000+05:302009-02-03T12:04:00.000+05:30Most DataGrids do write behind out of the box with...Most DataGrids do write behind out of the box with a flag so while cool, this is kind of table steaks now. It should just do this with no coding.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-22587889.post-31476121462451046832009-02-02T18:43:00.000+05:302009-02-02T18:43:00.000+05:30Nice post, Debasish! In the Examinator reference ...Nice post, Debasish! In the <A HREF="http://reference.terracotta.org" REL="nofollow">Examinator</A> reference web app, we use tim-async to do async commits of the user's final exam results to the database. That means that if a big group of users completes a test at the same time, they can all create their results, asynchronously commit, and return a valid page to the user. <BR/><BR/>The cool thing is that the way tim-async is written, state will stay in Terracotta (and thus be persistent and highly available) until it is dropped in the database. There is a little bit of extra work with Hibernate to ensure that you can handle the narrow window where the data is in both Terracotta and the database. If the system crashes at that point, you have to have a way to ensure that you don't recommit later. We do that by having the commit handler create the id and remember it in Terracotta before we write to the db. That way, we can check whether the key already exists in the db and avoid a re-commit.<BR/><BR/>It's also worthwhile to note that Hibernate actually does asynchronous writes most of the time behind the scenes, but without this extra layer of reliability.Alex Millerhttps://www.blogger.com/profile/01929662536395624733noreply@blogger.comtag:blogger.com,1999:blog-22587889.post-37625072085879709442009-02-02T15:13:00.000+05:302009-02-02T15:13:00.000+05:30Terracotta Sample App : Examinator is good example...Terracotta Sample App : Examinator is good example of tim-Async.<BR/><BR/>Its not real live-application but close to one.<BR/><BR/>And other features you discussed are being close to In-memory-grid than Asynchronous Write Behind pattern.<BR/><BR/>Lets hope we see those features soon in Terracotta too.<BR/><BR/>regards,<BR/>TusharTushar Khairnarhttps://www.blogger.com/profile/17988114484207923075noreply@blogger.comtag:blogger.com,1999:blog-22587889.post-51469588986429620342009-02-02T14:47:00.000+05:302009-02-02T14:47:00.000+05:30Actually the snippet posted is not the complete me...Actually the snippet posted is not the complete method. For brevity I have excluded that part which adds the list to the in-memory data structure. Thanks for pointing this out .. I should have indicated that .. will fix.<BR/><BR/>Thanks.Anonymoushttps://www.blogger.com/profile/01613713587074301135noreply@blogger.comtag:blogger.com,1999:blog-22587889.post-77654005043471661502009-02-02T14:34:00.000+05:302009-02-02T14:34:00.000+05:30Hi Debasish,very nice post about DDD concepts + sc...Hi Debasish,<BR/><BR/>very nice post about DDD concepts + scalability patterns with Terracotta.<BR/><BR/>Just a minor correction: I don't see in your example where you actually add the list of restaurants to the in-memory store, you just add them to the async coordinator ... am I missing something?<BR/><BR/>Cheers,<BR/><BR/>Sergio B.Sergio Bossahttps://www.blogger.com/profile/09315991044338298083noreply@blogger.com