• disabled hbm2ddl (set dbCreate: none) on dev environment. We enable validation on test/prod (with CI) or manually when working on domains.
• switched to Flyway to manage/version/initialize the DB with DDL using static SQL files, and some JDBC on Java for things that need a bit of programmatic behaviour (e.g. reading secrets from environment)
Our DBA pointed out that we don’t need ORM or Transactions because our schema and data init is fairly deterministic, so using raw SQL helped a lot here.
If you have data that needs to be loaded from some static files, read on.
• Defer data/plugin initialization where possible and appropriate.
• Let the developer easily enable/disable features/services at startup.
If your app is small and simple, chances are the startup is fast. If the app is large enough, then maybe it would be helpful to disable some areas, so that a dev can focus on the thing being worked on. Some examples:
• Loading data from files -> use a RPC or HTTP call that is only enabled on development
• Connected services (MQ, S3, etc) -> only initialize the connection when the system first calls the methods.
Sometimes plugins can slow down/complicate the startup, so it may be useful to just disable it at startup.
A real example of this is Spring Security CAS Plugin which on top of needing the service to be online to let you log in, it also significantly increases the start up time. So we kept both S2 Core and S2 CAS configs on application.yml, and let the developer uncomment which one they want.