I’m coming up to speed on BaseX 10 and trying to understand the practical difference between using the built-in store (or a custom store) and simply saving values into a database. As far as I can tell from the docs the basic feature is the same: given e.g., a map with stuff in it, I can store the map to a database with the new db:put-value() function or to the build-in store (or a custom store) using store:put() and in both cases can get the map back.
Given that the store is automatically persistent, it seems like the obvious choice if you’re using maps as a result caching technique, so I’m wondering what the reasons would be for not using it and using a database instead.
I think the answer includes:
* Databases provide locking semantics that the store does not—the store docs are clear that the store is non-deterministic and may have side effects. So if you need to ensure locking consistency, you want to use a database. * Custom stores require that you manage any required persistence yourself, while databases are inherently persistent.
Have I missed any other important considerations?
Without taking the time to do the measuring, I’m guessing that there is negligible performance difference between using the store and a database—I’d be very surprised if the underlying implementation was not based on the same code.
In our Project Mirabel system I need to do caching of large query results, so being able to quickly and conveniently store maps is ideal and I’m very excited to take advantage of this new feature.
Cheers,
E.
_____________________________________________ Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.comhttps://www.servicenow.com LinkedInhttps://www.linkedin.com/company/servicenow | Twitterhttps://twitter.com/servicenow | YouTubehttps://www.youtube.com/user/servicenowinc | Facebookhttps://www.facebook.com/servicenow