Most cases we do have database schema change with new versions. I think in that case this pattern does not fit, or rather some sort of downtime is to be planned. Am I correct or is there a pattern which is solving the database schema updates too?
there is a separate pattern you need to do related to breaking database schema changes. Google expand + contract migrations. As an example, if you need to rename a column, you'd: 1. add the new field 2. have your code write to both old and new fields 3. write a script to move all data's old field into new field (some background process) 4. deploy code to now read + write only from the new field 5. run migration to remove the old field
Does it make sense to do this "Switching" on DNS level? Personally I try to prevent DNS for anything like this because it's so unpredictable. I mean, even if your TTL is 1 second, users their machines can do whatever they want. It's more of a suggestion. I've never tried it but I'd be afraid of breaking prod because caches. You've never run into problems with this? I personally do something similar but I have sort of like a proxy that redirects traffic to the new machine after health checks have passed. You have complete control of the proxy and does not depend on any caches you don't control.
Awesome stuff, keep the AWS/system design content coming!
Good job babe!!
Most cases we do have database schema change with new versions. I think in that case this pattern does not fit, or rather some sort of downtime is to be planned. Am I correct or is there a pattern which is solving the database schema updates too?
there is a separate pattern you need to do related to breaking database schema changes. Google expand + contract migrations. As an example, if you need to rename a column, you'd:
1. add the new field
2. have your code write to both old and new fields
3. write a script to move all data's old field into new field (some background process)
4. deploy code to now read + write only from the new field
5. run migration to remove the old field
Does it make sense to do this "Switching" on DNS level? Personally I try to prevent DNS for anything like this because it's so unpredictable. I mean, even if your TTL is 1 second, users their machines can do whatever they want. It's more of a suggestion. I've never tried it but I'd be afraid of breaking prod because caches. You've never run into problems with this?
I personally do something similar but I have sort of like a proxy that redirects traffic to the new machine after health checks have passed. You have complete control of the proxy and does not depend on any caches you don't control.
Hello 👋