qor / admin

Qor Admin - Instantly create a beautiful, cross platform, configurable Admin Interface and API for managing your data in minutes.
917 stars 188 forks source link

DB connections READ and WRITE separation in config #183

Open theromis opened 5 years ago

theromis commented 5 years ago

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})
omjangir commented 4 years ago

can I pick the above feature implementation?

theromis commented 4 years ago

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

bodhi commented 4 years ago

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

omjangir commented 4 years ago

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 commented 4 years ago

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

bodhi commented 4 years ago

@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.