Thread: Deploy modifications of database objects
Hello everyone, We often deploy modified function code to production database. In order to impact the less users that still use the old versionof these functions, we add another function. I think it’s not relevant. How could we deploy these modifications ? Add a schema per version ? Thank you in advance. Mai
You could use different schemas, but that seems like overkill to me.
What I would do, is make sure the function code is backwards compatible, and just replace. Or alternatively, you could have a master function run child functions depending on what version you need.
On Tue, Jun 22, 2021 at 9:00 AM Mai Peng <maily.peng@webedia-group.com> wrote:
Hello everyone,
We often deploy modified function code to production database. In order to impact the less users that still use the old version of these functions, we add another function. I think it’s not relevant.
How could we deploy these modifications ? Add a schema per version ?
Thank you in advance.
Mai
Jayson Hreczuck | Principal Database Administrator
C: +1 617.571.9861
130 Turner St, Ste 530, Waltham, MA 02453Where ever possible, I would recommend you use a version control system (git) for DDL history and create a process to run migration / rollback scripts. Setting up a QA / Staging system and some tests would also probably raise your confidence level in the code / performance.
If this is to support versioned API's, I would probably spend my time ensuring the abstraction was correct for functions (limited to doing just one thing) and that future changes were backwards compatible (seconding what Jayson said). Adding features or refactoring generally shouldn't break the contract.
Best regards,
Assuming you wanted to have some beta users or feature flags in production, I would probably use a schema or obvious new object name prefix or suffix (probably with a date). In this instance, I would probably lean toward the application using the correct object where necessary for feature flag (manage feature flag from one location where possible). From there I would be diligent to clean up un-used versions when versions were made GA.
Best regards,
Dan Smith
On Tue, Jun 22, 2021, 06:00 Mai Peng <maily.peng@webedia-group.com> wrote:
Hello everyone,
We often deploy modified function code to production database. In order to impact the less users that still use the old version of these functions, we add another function. I think it’s not relevant.
How could we deploy these modifications ? Add a schema per version ?
Thank you in advance.
Mai