in reply to Database or Storable?

In general I wouldn't dump the counts to a different location, because it would have to be kept synchronized, which is error prone.

If you have an index over the primary key of your table (it likely works for other columns as well) then a SELECT COUNT(*) will simply look into that index, so the DB already does the optimization you're looking for.

I'd only revert to such means if I ran into performance problems that make them absolutely necessary.