admin icon indicating copy to clipboard operation
admin copied to clipboard

DB connections READ and WRITE separation in config

Open theromis opened this issue 6 years ago • 6 comments

In production we using PostgresQL with hot standby setup (READ) and single master (WRITE), setup. Usually we using two separate connections one writeOnly another readOnly and now we want to integrate qor/admin in our infrastructure. What do you think about adding this functionality to admin?

It will be something like:

  Admin := admin.New(&admin.AdminConfig{DBread: DBread, DBwrite: DBwrite})

and custom situation will be single connection setup

  Admin := admin.New(&admin.AdminConfig{DBread: DB, DBwrite: DB})

theromis avatar Apr 25 '19 05:04 theromis

can I pick the above feature implementation?

omjangir avatar Feb 11 '20 10:02 omjangir

@omjangir of course you can, but it not implemented :)

theromis avatar Feb 11 '20 16:02 theromis

It may be better to do this via the database adapter? Hmm, maybe not, it will cause difficulties with transactions and consistency.

bodhi avatar Feb 11 '20 23:02 bodhi

I was planning to fix the above DB read and write support. So, instead of fixing it in my local qor/admin source code. I was thinking of contributing to this repo.

I never contributed to the open-source project, So, want to understand the process.

omjangir avatar Feb 12 '20 07:02 omjangir

It may be better to do this via the database adapter? Hmm, maybe not, it will cause difficulties with transactions and consistency.

Actual, we want to enable dbRead for listing and search. For a single resource read i.e detail, it will be from dbWrite. As dbWrite will be the true source. Maybe, it can implemented in a way, that anyone can configure that when to use dbRead/Write

omjangir avatar Feb 12 '20 07:02 omjangir

@omjangir we don't have a formal process for accepting contributions. Feel free to make your changes in a fork, and submit a pull request.

bodhi avatar Feb 13 '20 00:02 bodhi