spring-cloud-app-broker icon indicating copy to clipboard operation
spring-cloud-app-broker copied to clipboard

Replace `InMemoryServiceInstanceStateRepository` with real database

Open royclarkson opened this issue 5 years ago • 4 comments

This implementation was meant to be obviously the wrong thing to use in a production application, but now it's causing problems with Reactor and BlockHound (see #313). Let's replace it with a real Reactive data repository and deprecate this one (or remove it entirely).

royclarkson avatar Jan 28 '20 20:01 royclarkson

Is it recommended to persist SI state in MongoDB through Mongo CRUD service REST API?

buddyavis avatar Feb 14 '20 11:02 buddyavis

Hi, Siva. We have a sample app that showcases how to create the ServiceInstanceRepository using R2DBC: https://github.com/spring-cloud-samples/spring-cloud-app-broker-samples#service-instance-state-repositories but it is up to you to choose the database that suits your needs. MongoDB is a perfectly valid option, but if you don't have mongo, you could try R2DBC. Last, if you can't use any reactive driver nor compatible database, you can use what is shown on at the end of that sample app. However, it has some downsides that are explained in the notes. Let us know if that helped!

Albertoimpl avatar Feb 14 '20 11:02 Albertoimpl

Thank you @Albertoimpl

buddyavis avatar Feb 26 '20 13:02 buddyavis

Discussed today... We think a nice way to solve this would be to autoconfigure a data store based on database starter availability on the classpath.

spikymonkey avatar Jun 10 '20 16:06 spikymonkey