1
votes

I have a set of restful services connecting to Oracle , MySQL and Phoenix DBs. These are running on tomcat. I have to migrate these services to pivotal cloud foundry. Is it sufficient if I externalize the connection parameters potentially using cloud config server or env variables to connect to these databases or is there anything additional that I need to do? I assume any db which works with a java application deployed outside cloud foundry will work when the app is deployed to pivotal cloud foundry. Please correct me if my assumption is incorrect.

1
Yes, you are correct. I had deployed a Spring Boot app which uses MongoDB s database service provided MongoLabs(now MLabs). Simply configure the database connection properties, url, password etc and it works.Sanjay Rawat
@SanjayRawat Can you give me details on how you used MongoDB on cloud foundry? My mongodb works locally, but I don't know how to configure it where it would work on cloud foundry.Jesse
@Jackie Pivotal CF provies MongoDb as Service via Mlabs (console.run.pivotal.io/marketplace/services/…) for Free. You can use this and configure your spring boot app to get DB credentials from CloudFoundry or simply hard code the MongoDb credentials (after you create MongoDb from above Mlabs link) in the application.properties file. Here is the project in which I used MongDb using hardcoded as well as CloudFoundry env variables method - blogAggrSanjay Rawat

1 Answers

1
votes

You can certainly manage your connection parameters through Spring Cloud Config Server and connect that way.

An alternative approach would be to use User-Provided Service Instances: http://docs.pivotal.io/pivotalcf/devguide/services/user-provided.html

Some organizations might prefer this approach, because managing access to your databases may more closely align with platform operation responsibilities that code configuration responsibilities.