playframework / playframework/play-ebean

Cannot configure Ebean read replica with Play configuration

Open
#566 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.