let's have ecommerce website million of products, have millions of pageviews day, product details pages.
let's have data in relational db, old way.
what pros , cons of keeping data in relational db doing queries, aggreating , filtering products , that...but using flat json files product details?
so, having 1 file per 1 product, details serialized json. these files placed under high-performance cdn, geographically distributed , that. when user goes to
www.mysite.com/prods/00123
the server (or client) load template file layout, , fill data reads cdn.mysite.com/prods/00123.json
so don't need queries in case - jump straight file named after product id. guess should fast, , yet delegate scalability / caching / geographic distribution external strong partner (cdn akamai, amazon etc.) instead of building own (expensive , hard maintain) distributed db server?
i forward suggestions / feedback...especially if comes real world experience :)
thanks!
as per requirements,
it better store product descriptions in schema free database mongodb since products can have different fields wide variation in number of attributes (and corresponding fields). such information written far less read. mongodb has collection level write locks deter write heavy applications if consistent writes. reads in mongodb fast because dont have joins or fetch field values eav schema table. needless say, based on data volume sharding , replication needs done in production environment.
it better storing in flat file since mongodb's read performance because of memory mapped files , replication/sharding well.
however, if filesystem (or filesystem network) provides security, speed , accessibility provided database storing data in filesystem not bad idea. traditional db vs flat-file argument not hold true if flat files configured served in efficient manner.
however, should not store information shopping cart, checkout transaction, etc in mongodb since dont have acid transactions , frequent writes , updates 'with consistency' not mongodb's cup of tea.
Comments
Post a Comment