Best way to implement multiple daily counters


So we have multiple daily counters in our app that we need to track. For example:

  1. We have order counter that counts number of orders in our website for a given day. We use that to generate receipt numbers when sending receipts.

  2. We have third party API call counters that track how many API calls our server had to third party services for a given day. We have limited number of API request per day for some services, so we use this to track the usage.

Currently, we have one collection per tracking logic. So, there is one collection for order counter and one collection for each API counter. Since all of them have the same structure (date property and counter property), I think it’s more convenient to have only one collection with multiple fields:

  • date
  • order_counter
  • api_1_counter
  • api_2_counter

I just wanted to check if this is indeed better way to handle it. I am worry about multiple concurrent read/writes.