Databases in the development process
Last updated
Last updated
▪ Users can create, read, update or delete entries in a database
▪ Also called CRUD operations
▪ Developers need a database for local development
● Connect to a development database to develop the new features
● Connect to a test database to test the new feature with realistic data
▪ OPTION 1
● Each developer installs DB locally
● Each developer has own DB with own test data
✅ Can't mess up someone else's test
❌ DB data start from empty DB | need realistic test data
❌ Install and setup DB for EVERY developer
▪ OPTION 2
● Shared DB hosted remotely
✅ No need for local installation | start coding right away
✅ Test data available right from the start
❌ Can't play around without affecting others!
▪ The DB connection is configured in the application's code
▪ Each programming language has a library/module for DB connection
Better: Do not hardcode database connection data in source code
✅ Define only variables in code
✅ Set endpoint and credentials from outside for each environment (for example dev, test, prod)
✅ Depending on environment (dev, test, prod) connects to different DB!
The way to do this, is to pass environment variables on application start-up
From Command Line
Configure in code editor
Use properties/configuration files
The best option is to pass them via a properties or configuration file
▪ In a Java/Spring application, you can define the values in a Spring properties file:
▪ Application connects to database
▪ This means database needs to be available, when application starts
▪ So before application is deployed, we need to install and configure database
✅ Replicate database
✅ Do regular backups
✅ Make sure it performs under high load when many users accessing the application
▪ System Administrator
▪ Database Engineer
▪ DevOps Engineer