Another curiosity about (Spotify) Golden Paths. So...
# platform-blueprints
r
Another curiosity about (Spotify) Golden Paths. Sorry for having so many questions 😅. I perceive that the happy path is 1 golden path (e.g to deploy a Java/Go/whatever microservice in K8s) per repository. But, in case that a microservice needs to apply a schema change, is this part of the same golden path, or do you consider that is a different service that needs to be coordinated in the same flow?
j
I would say it is the same golden path (if the assumption that schema migrations are common for your organization is true). How you facilitate this golden path is up to you. (I would incorporate it in CI/CD pipelines. But I’ve also seen schema change execution on service startup. As long as you can automate the process, it would be great for facilitating the golden path (this also includes accounting for when and how to roll back (or have a solid only roll forward policy)).) Also, I don’t perceive the golden path as a happy path. More as a common path which you want to make easier for others to stay on.
👍 1
r
Thanks @Joram Visser!
I would appreciate if anyone reads this message and let me know if agrees or disagrees with Joram,
j
I’ve done schema changes on startup, depending on what you’re using you can usually have stuff that only runs on one instance of you app.
1
I’m not super familiar with spotify’s model, but another way I’ve seen it done is to have a DB schema pipeline and an app deployment pipeline, and the app deployment pipeline checks the schema version before it deploys
👍 1
You could do it all in one pipeline, I suppose; just have the schema migration step before the deployment step
I think the big thing is the engineers have to make non-breaking DB changes, so that v1 app can work with v2 DB
👍 1
Sorry for having so many questions
This is the most useful conversation I’ve seen on this slack in a while, so thank you for asking them!! 🙂
❤️ 2
2
j
https://platformengin-b0m7058.slack.com/archives/C037XDKEDNW/p1652887535761699?thread_ts=1652879323.381759&cid=C037XDKEDNW this is likely a good idea in any case as otherwise rolling releases (the k8s default for deployments) will be difficult and rollbacks likely impossible.
I've made fairly good experiences with having a pre-deploy job, which executes all pending migrations. This ensures that no app pods are taken out for a potentially long migration, ensures no restart loops when the migration was actually faulty and it is way less scary if just the migration job failed vs. having a couple of crash-looping pods.
👍 2
k
did someone say schema change?? 🙂 pretty much all of us at Liquibase would be happy to talk to anyone about this at any time!
😁 1
👍 3
s
We are experimenting with init containers, is it good way to go ?
j
It still means you are taking out pod(s) from the rotation and I've personally found init container failures hard to debug.