I have a windows service that receives a large amount of data that needs to be transformed and persisted to a database. To ensure that we do not lose data, I want to create a “Write cache” for the data that will continue regardless if the database is online. Once the database becomes available again, I would want it to flush the content of the cache back into the database.
I’ve seen some articles indicating that I might be able to do this with NHibernate, but I haven’t found it conclusively. What options exist for this, and is NHibernate the appropriate direction?
I am agreed with Paco but still there are some scenarios like if a database is being updated too frequently then you might need to implement as you are asking for.
This is called write-behind scenario
Look at the following article
http://wiki.tangosol.com/display/COH32UG/Read-Through,+Write-Through,+Refresh-Ahead+and+Write-Behind+Caching
If you think you really need it you can use NCache server
http://www.alachisoft.com/ncache/
OR there are other applications available too to handle such situation and also you can write your own application or code to ensure this.
Regards
Mubashar