If performance is a concern you should consider using Redis, or something like that, to store this sort of frequently updating data. You could then reconcile with the database when appropriate (idle moments, etc.).
This being said, since you are writing to the database after the response has been sent, you aren't actively delaying the response (something you would do if you hooked to the on_fetch
event instead).
I guess it all depends on 1) the kind of traffic your API is going to handle and 2) where you are storing these stats. If you are going to get a lot of traffic (or want to be ready for it), then consider using an alternate storage (possibly in memory) other than your main database.