Schema-less, Not model-less

The data model is not just the model of the data base tables, it represents more than that. Data model represents the domain model; the various entities that represents the a business. For  any product to be successful and to serve the intend purpose the data model is important, the data model is the common language among the end users, business teams and the developers. A poor data model leads to a poor understanding and the information gap between various stake holders.

The schema in the relational database terminology refers to the metadata or definition and organization of the various tables. The tables in the data base closely represent the data model. The schema is rigid, extending the data model becomes difficult. Involves transformation when such case arises. The positive side of this aspect is that it forces us to think of the schema, in a sense it mandates to understand the business thereby a data model. The data model helps in designing the Object/Entity model of the product.

The schema-less databases do not mandate a rigid schema and there by do not force us to think of a data model. I have observed a few occasions where teams started using the document databases and storing the data more in random format; mostly not able to relate between their object model and data base. Schema-less databases provide the flexibility for extending the model. The database accepts the any data to store but the application needs a model to operate.

One of the main advantages that comes out of using schema-less databases is that not requiring a Storage Model to Object Model conversion. If the project doesn’t have a well thought model, it may need to combine two or more entities from database to form a single Object. Having well defined model makes it easier to store and retrieval from a schema-less database. For example, a Java object can be converted to JSON and stored in MongoDB and retrieved and converted to Java object. If it has to come out of two documents, we accidentally have invited the relational databases’ complexity to the schema-less data bases as well.

The schema-less databases provide flexibility to add or remove more fields to the data, change the data type of the data, and obviates the need of normalization and relationships but they are not an excuse for not having a domain model.

Schema-less is not model-less.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s