Wednesday, August 3, 2016

Reads vs writes in production database of web application

I recently think about CQRS-like patterns we partially used in current application, and pros'n'cons of migrating more towards full CQRS, which is mostly about separating reads from writes. Previously I assumed that in usual application "we may have probably 100 times more reads than writes", what would qualify to have a value from these two models separation. I wanted to check it later on the production, but I forgot. Now we are close to start a big redesign of the whole application, and I've just remembered about that. So, how does it look for real production? This is data from postgres pg_stat_database of one of my projects:

tup_returned   | 58956902163
tup_inserted   | 3348809
tup_updated    | 4557408
tup_deleted    | 245501

Does it look that I made a big mistake previously and we have ~7200 times more reads than writes? It will be funny to investigate that in the near future...