{"id":6004,"date":"2024-01-21T02:33:29","date_gmt":"2024-01-21T06:33:29","guid":{"rendered":"https:\/\/www.dr-chuck.com\/csev-blog\/?p=6004"},"modified":"2024-01-21T02:33:29","modified_gmt":"2024-01-21T06:33:29","slug":"project-idempotent-project-idempotent-mvp-of-live-continuous-database-migrations-for-sakaiproject","status":"publish","type":"post","link":"https:\/\/www.dr-chuck.com\/csev-blog\/2024\/01\/project-idempotent-project-idempotent-mvp-of-live-continuous-database-migrations-for-sakaiproject\/","title":{"rendered":"Project Idempotent &#8211; Project Idempotent &#8211; MVP of live \/ continuous database migrations for SakaiProject"},"content":{"rendered":"\n<p>Increasingly, I want to run the 23.x branch and stay no more than a few weeks behind the branch without waiting for a minor release. &nbsp;my hope is that this is more \u201ccloud like\u201d. &nbsp; I also thingk that a few smaller sites running near the edge of 23.x in production makes these branches safer to use and lowers the risk of the minor releases. &nbsp;It also means that when we back merge a fix to a branch these \u201clatest 23.x\u201d servers can help verify the back-ports work.<\/p>\n\n\n\n<p>I have been running servers on 23.x and master now for several years. &nbsp; These are small servers with folks I generally know so little glitches can be quickly handled.<\/p>\n\n\n\n<p>My greatest frustration when I move a server forward along a branch is missing a conversion that was just added to the conversion scripts for the next release of the branch.<\/p>\n\n\n\n<p>So I have built a tool that runs in Sakai and when a simple bit of SQL is added to the conversion script it can be added to Idempotent. &nbsp;That way &#8211; without scanning the whole conversion script to see what has and has not been applied &#8211; I just Idempotent to check and optionally conversion SQL.<\/p>\n\n\n\n<p>It is cool. &nbsp;It does it all in a servlet &#8211; so hot-deploy is super easy. &nbsp;It has a bunch of utility classes to do things like check if a table exists or a column exists or even is a particular but of conversion SQL has already been run.<\/p>\n\n\n\n<p>In the future &#8211; I think this needs to be part of Sakai. &nbsp;Ia a person makes a patch that needs a conversion script, (in the future) they would also add a few lines to Idempotent. &nbsp;So if someone did a git pull, recompile, and restart &#8211; with a few seconds of startup &#8211; all the conversions would be run.<\/p>\n\n\n\n<p>There is a lot of test and work to be done &#8211; but I am now running this in production in all my Sakai servers. &nbsp;For now, I will watch the conversion scripts for 23 and 24 and keep my copy of idempotent up to date. &nbsp; Frankly it is easier for me to put the conversion in idempotent than figuring out which ones to apply by hand in the MySQL command line.<\/p>\n\n\n\n<p>I would like to advocate including this in Sakai 24 and 23 &#8211; but that will require a bunch of dicussion and take some time. &nbsp;This email is the start of that discussion &#8211; here is the source code:<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/csev\/idempotent\">https:\/\/github.com\/csev\/idempotent<\/a><\/p>\n\n\n\n<p>It has a README.md and DESIGN.md.<\/p>\n\n\n\n<p>It is not much code. &nbsp;It could be improved. &nbsp;If this did go into the main repo, I would take some of the bits in the Util class and move them into the SQL service. &nbsp;For now I kept things in idempotent so it would work with any version of Sakai.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Increasingly, I want to run the 23.x branch and stay no more than a few weeks behind the branch without waiting for a minor release. &nbsp;my hope is that this is more \u201ccloud like\u201d. &nbsp; I also thingk that a few smaller sites running near the edge of 23.x in production makes these branches safer [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6004","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/6004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/comments?post=6004"}],"version-history":[{"count":1,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/6004\/revisions"}],"predecessor-version":[{"id":6005,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/6004\/revisions\/6005"}],"wp:attachment":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/media?parent=6004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/categories?post=6004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/tags?post=6004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}