As I understand, you can enter any non-structured information in the document-oriented database. Imagine a document like this:
{name: 'John Blanc', birth of the year: 1960} Later, In a new version, this structure {firstname: 'John', lastname: 'blank', yearOfBirth: 1960}
You document-oriented How do such a database? Do you have to prepare merge scripts, which changes all your entries in the database? Or better way you can handle the change in the structure?
Factoring here reveals that there is a deterministic mapping from the old schema to the new schema, the most effective option There is a job that you do with a SQL database and actually updates the documents.
Document-oriented databases give you another option, though it depends on which DODB and how you are using it on the front-end. This option is to leave data alone, and the last As a compatibility option, you have to support the "old" definition in your application. In other words, you are doing this translation on-the-fly, as opposed to a permanent one-time update.
This is not really an option with a SQL database because you keep the obsolete column around and possibly indexed. With a DODB, you are not really wasting any data or index space. You have to weigh the benefits against the loss.
The primary loss, of course, is the incompatibility, which can grow over time and cause the bugs to grow. Another disadvantage is the computational expenditure of this in-the-fly, or inability to use the new structure effectively (for example, you just want to index it on last name ). So, most of the time, I think I just elect to run an update on a large scale.
However, there is a clear advantage to preserving old documents; If you are unsure that your refactor is correct - for example, if the data in your name column does not always follow the convention, then in some cases it may be called last name, first name and in other cases it is first name last name and in other cases it is company name - then on-the-fly-on-conversion without permanent conversion Mapping allows you to over time, So that you can use the first name and last name fields when available, but you can play by assuming names for legacy data. As has been said, I may preserve the second option for extraordinary cases, where I do not have full faith that I will be able to get the correcting "refactoring" for every record / document. However, this is an option that is available to you that you do not actually have other types of databases.
In addition to those two, I do not see any other obvious option; it is a binary decision; Either you update existing data permanently or not.
Comments
Post a Comment