Advantage of schemaless data storing over data storing with schema
Asked Answered
T

2

8

I want to choose a back end web service for my app. Reading documentation of these services(Parse, Proxomo, Cocoafish, StackMob etc.) reveal that some of them offers to store data in schemaless form while other mention that schema must be specified apriori. I understand what is schema of data is and hope schemaless will be easy to use, but want to know merits and demerits of each. Any explanation will be greatly appreciated.

Tropo answered 24/1, 2012 at 12:9 Comment(0)
Z
6

The biggest difference is scalability.

Data storage solutions with schema are much harder to distribute than Schema free data storage solutions. Its really easy to replicate (schema free) key-value pairs for fault-tolerance. Its really easy to distribute copies across nodes for fast read times and its easier to provide fast writes with eventual consistency. If you are managing your own database this means it will be much easier to manage schema free solutions when you need to scale to multiple servers. If you are using a service this means schema free solutions are normally cheaper and faster.

The problem with schema free comes when you need transactions and consistency across various data-sets or tables. All this has to be done in code.

So the bottom line is: If you need huge volume data with fast access cheap it has to be schema free. If on the other hand your data size and load is modest than schema based systems are better.

If you need help choosing which service to go with, A better way to decide would be to do a read/sec write/sec and expected data size analysis on your application and then choose which solution is cheaper. All of these services will presumably scale to your loads but the cost will be the deciding factor.

Zama answered 27/1, 2012 at 15:55 Comment(0)
F
1

I'm not a real specialist on this but from what I read, here's what my perception :

  • most of the time, schemaless databases enable you to easily store Key / Values, JSON objects. So it's often quite easy to bridge the objets you manipulate in your application to the DB storage. You don't have to use an ORM (Object Relational Mapper) because your objects are directly in the format accepted by the DB (most of the time, it's quite easy to generate a JSON from the object you have in an app)

  • If you don't have any schema, you can easily adjust (add / remove) the properties of the objects you want to store in your DB without having to go through a schema update and a migration of the data from the old schema to the new one.

  • in the CONs for the schemaless, my feeling is that you cannot express as many constraints as you could do in standard SQL to retrieve data (you don't do any join etc) so maybe you have to really check how you want to retrieve stuff from the db data and see what is offered by the schemaless engine.

Franck answered 27/1, 2012 at 12:17 Comment(1)
Thanks a lot Yonel for your thoughts and explanation. I am not only new to web services but also to programming in general, so I might be wrong but (regrading to your third point)schemaless data storing services are actually many filterings for data retrieve. I will wait for some more time and then mark your answer as correct and give bounty.Tropo

© 2022 - 2024 — McMap. All rights reserved.