Multilevel XML document database for asp.net application
I was thinking about how to let multiple users get CRUD access to XML document in asp.net application. Obviously, operations should be performed assuming a multi-threaded environment.
For primary purposes, would it be advisable to cache the document and use a mutex in that cached version? When will the changes be flushed to the physical XML document?
All recommendations are appreciated (also, unfortunately, "using the database" is not used at the moment)
a source to share
It makes sense to cache the XML document of course, so you don't have to read it from disk for every user / request. You must sync access with it. It would be a good idea to encapsulate the access in one class and use the ReaderWriterLockSlim to sync. When reading data, acquire a read lock and read from memory. When you write, you acquire a write lock, write the data, and replace the in-memory copy.
a source to share