stackoverflow.com stackoverflow.com

Best approach for database architecture heavily focused on storing data of different fields by year and by months at the same time

I need to nail this approach as I think the architecture of the database could age badly if the project becomes big enough. My problem is that with the current architecture that I have designed, the database would grow exponentially as it lays like this: entity Project { projectId Long required } entity ProjectData { yearId Long required } entity ProjectMetaData { projectMetaDataField1 Long, projectMetaDataField2...

stackoverflow.com stackoverflow.com

In Ecommerce systems with high load, how are sku stock updates are designed?

When an order is submitted, few things need to happen: sku stocks are decremented if there are enough quantities products returned by subsequent search queries have the latest stocks (sum by sku stocks) stock state of product should be updated if changed, eg. from normal to out of stock A straight forward design is to have a ProductStock aggregate root with totalQuantity, state, and a collection of SkuStock, like this: public Class...