Event-driven architecture best practices for databases and files