Collect events in a database.