The computed pattern may be of interest for such slowing counts as

About the following

This is essentially the computed pattern. Yes you need to update the computed field. But you have to ask yourself how often a customer has a new invoice compared to how often you need the number of invoices and the time and code complexity of updating the 2 collections vs dynamically computing the number every time you want to display it.

You may even used an hybrid where you keep old invoices (previous years or months) and dynamically compute for recent ones.