playframework / playframework/play-ebean
Cannot configure Ebean read replica with Play configuration
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 111
- Forks
- 67
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 19
Description
I have been successfully using a read replica with Play Framework 2.7 for years. I am upgrading to Play Framework 2.9 and Ebean 15.1.0 with Play Ebean Plugin 7.3.0.
I have tried two different configurations and with both of them, the default database is recognized and used, but the read replica is not. Here are my two attempts (application.conf):
db.default.driver=org.postgres.Driver
db.default.url='xxxx
db.default.readOnlyUrl='xxx`
db.default.driver=org.postgres.Driver
db.default.url='xxxx
db.readonly.driver=org.postgres.Driver
db.readonly.url='xxxx'
db.readonly.readOnlyDatabase=true
Here is a link to the documentation that shows the 'readOnlyUrl' property in the configuration.
https://github.com/ebean-orm/ebean-datasource/blob/master/ebean-datasource-api/src/main/java/io/ebean/datasource/DataSourceConfig.java#L719
Please advise on the proper way to configure a read replica.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the application.conf examples in the issue and the referenced ebean-datasource DataSourceConfig.java readOnlyUrl definition. Trace how Play Ebean Plugin 7.3.0 maps Play settings to Ebean 15.1.0 datasource configuration, then verify a supported configuration makes both the default database and read replica usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, postgresql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100