Updating relational databases through views

Since records are contained within entire documents, it makes it easier to move, or replicate an entire object to another server.

By providing a reference in the beer document to a brewery document, you create a relationship between the two entities: In this example we have two different beers from the Amstel brewery.

We represent each beer as a separate document and reference the brewery in the field.

The schema is the structure described in a formal language supported by the database and provides a blueprint for the tables in a database and the relationships between tables of data.

Within a table, you need to define constraints in terms of rows and named columns as well as the type of data that can be stored in each column.

As we see in this illustration, the relational model conforms to a schema with a specified number of fields which represent a specific purpose and data type.

The equivalent document-based model has an individual document per beer; each document contains the same types of information for a specific beer.In the document-oriented database, we could choose to have two different document structures: one for beers, and one for breweries.Instead of splitting your application objects into tables and rows, you would turn them into documents.Fields can vary from document to document; there is no need to declare the structure of documents to the system – documents are self-describing.If a new field needs to be added to a document, then the field can be created without affecting all other documents in the collection, without updating a central system catalog, and without taking the system offline.If we wanted to add attributes to a beer in a relational model, we would need to modify the database schema to include the additional columns and their data types.

Comments are closed.