Question

Sometimes documents with it's free form structure is attractive for storing data (in contrast to a relational database). But one problem is persistence in combination with making small changes to the data, since the entire document has to be rewritten to disk.

So my question is, are "document databases" especially made to solve this?

UPDATE

I think I understand the concept of "document oriented databases" better now. It's obviously not documents of any kind but each implementation uses it's own format, such as for instance JSON. And then the answer to my question also becomes obvious. If the entire JSON-structure had to be rewritten to disk after each change to keep it persisted, it wouldn't be a very good database.

Was it helpful?

Solution

If the entire JSON-structure had to be rewritten to disk after each change to keep it persisted, it wouldn't be a very good database.

I would say this is not true of any document database I know of. For example, Mongo doesn't store documents as JSON, it stores them as BSON (http://en.wikipedia.org/wiki/BSON).

Also databases like Mongo will store documents in RAM and persist them to disk later.

In fact many document databases will follow that pattern of storing documents in main memory and then writing them to disk.

But the fact that a given document database will write data to disk - and the fact that some documents might get changed a lot - does not mean the database is non-performant. I wouldn't disregard document databases based on speculation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top