# platform-design

Raquel Pau Fernandez

05/18/2022, 1:08 PM
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?

Joram Visser

05/18/2022, 1:21 PM
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

Raquel Pau Fernandez

05/18/2022, 1:34 PM
Thanks @Joram Visser!
I would appreciate if anyone reads this message and let me know if agrees or disagrees with Joram,

jonny s.

05/18/2022, 3:23 PM
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.
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

Johannes Würbach

05/18/2022, 4:26 PM 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

Karen Taggart

06/01/2022, 7:43 PM
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

Shakeel Hussain

06/09/2022, 9:02 AM
We are experimenting with init containers, is it good way to go ?

Johannes Würbach

06/09/2022, 9:04 AM
It still means you are taking out pod(s) from the rotation and I've personally found init container failures hard to debug.