spring-cloud-app-broker
spring-cloud-app-broker copied to clipboard
Replace `InMemoryServiceInstanceStateRepository` with real database
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).
Is it recommended to persist SI state in MongoDB through Mongo CRUD service REST API?
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!
Thank you @Albertoimpl
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.