Is duplicating data in SQL and Document store (like MongoDB) a legit idea or should be avoided? -
i have question. considering using data store type of objects (e.g. products data). criteria using document store if object has detail page, fast read of entire object necessary (example - product attributes, images, comments etc). criteria using sql displaying lists (e.g. n newest, popular etc).
some objects meet both criteria. products example. normal practice store info used in rendering lists on index pages in sql database, , other data in document store?
the main idea mongodb created denormalization , embedding. @ 1 of past projects i've done sql denormalization better performance, don't sql denormalization because many dublicated data( if have 1 many relation example). second step rewriting data access layer mongodb. , in mongodb difficult pages need load multiple documents i've created denormalized document(with embeded collections , plain data different documents) fit page content. no problem pages work fast, facebook ;).
but here possible problems, becase should support denormalized document every time. denormalized data updates work async, , data can stale in moment, it's normal practice. stackoverlow use denormalization because sometime when open question see answer, when return questions list , refresh page question doesn't have answer.
if need denormalization choose mongodb.
Comments
Post a Comment