You are on page 1of 6

Cloud Foundry Services

Database Migration
Agenda

1. Cloud Foundry Services


2. Flyer
3. Travis
4. Database Migration
Cloud Foundry Services

Service Type
Config Server
Service Registry
Circuit Breaker Dashboard
Single Sign On
ClearDB
Redis
Flyway

1. Open Source Database Migration Tool


2. Supported by Java,SQL, Command, Gradle/Maven Plugin
3. Databases supported Oracle, MySQL, DB2, Amazon RDS,Derby, PGSQL, SQLLite,MariaDB,H2,
Redshift

4. Name Description
5. flywayMigrate Migrates the database
6. flywayClean Drops all objects in the configured schemas
7. flywayInfo Prints the details and status information about all the migrations
8. flywayValidate Validates the applied migrations against the ones available on the classpath
9. flywayUndo Flyway Pro Undoes the most recently applied versioned migration
10. flywayBaseline Baselines an existing database, excluding all migrations up to and including
baselineVersion
11. flywayRepair Repairs the schema history table
JDBC VS JPA

• JDBC is a standard for Database Access


• JPA is a standard for ORM
JDBC is a standard for connecting to a DB directly and running SQL against it - e.g SELECT * FROM
USERS, etc. Data sets can be returned which you can handle in your app, and you can do all the usual
things like INSERT, DELETE, run stored procedures, etc. It is one of the underlying technologies behind
most Java database access (including JPA providers).

One of the issues with traditional JDBC apps is that you can often have some crappy code where lots of
mapping between data sets and objects occur, logic is mixed in with SQL, etc.

JPA is a standard for Object Relational Mapping. This is a technology which allows you to map between
objects in code and database tables. This can "hide" the SQL from the developer so that all they deal
with are Java classes, and the provider allows you to save them and load them magically. Mostly, XML
mapping files or annotations on getters and setters can be used to tell the JPA provider which fields on
your object map to which fields in the DB. The most famous JPA provider is Hibernate, so it's a good
place to start for concrete examples.
JDBC VS JPA

• Uses HikariCP Database connection Pool

You might also like