@SmaineDev
๐ www.smaine.me
ย ย ย @SmaineDev
๐ ย smaine-milianni.medium
ย ย ย ismail1432
ย ย ย smainemilianni
๐ฟ github.com/ismail1432/conferences
Smaรฏne Milianni
@SmaineDev
@SmaineDev
Production Version
Release Version
Version N+1
Version N
@SmaineDev
Production Version
Version N
Release Version
Version N+1
@SmaineDev
Realease Version
Version N+1
Productionย Version
Version N
@SmaineDev
ZDD*: Zero downtime deployment but you already know this ๐
โ Deploy a new release without Downtime
โ Deploy a new release without Downtime
๐ Release at any time (even on Friday ๐คช)
โ Deploy a new release without Downtime
๐ Release at any time (even on Friday ๐คช)
๐ Release is transparent for the users
โ Deploy a new release without Downtime
๐ Release at any time (even on Friday ๐คช)
๐ Release is transparent for the users
๐ No more waking up at dawn ๐ or at night ๐
โ Deploy a new release without Downtime
๐ Release at any time (even on Friday ๐คช)
๐ Release is transparent for the users
๐ No more waking up at dawn ๐ or at night ๐
โฎ๏ธ Make the rollback easier
@SmaineDev
1๏ธโฃ The changes should be backward compatible!
ย
2๏ธโฃ The changes should be done per release.
@SmaineDev
@SmaineDev
Version N + 1
Version N
WWW
Version N
release tag 7.10.24
Version N + 1
release tag 8.10.24
Version N + 2
release tag 9.10.24
@SmaineDev
@SmaineDev
Deployย โถ๏ธ
Version N
@SmaineDev
Deployย โณ
Version N
Deployย โ
Version N
Version N+1
@SmaineDev
Deployย Failย ๐ฑ
Version N
Version N+1
Version N
@SmaineDev
Deployย โ
Version N
Version N+1
Version N+1
@SmaineDev
Principal Engineer
@Back Market
@SmaineDev
@SmaineDev
@SmaineDev
Version N
Version N+1
Version N
Version N+1
DEPLOYMENTย ๐
Code version Nย is alive with
Database schema version N+1
@SmaineDev
๐ก Prepare all pull request to not forget
@SmaineDev
Make your migrations safer:
ย
$ bin/symfony console d:m:m
[notice] Migrating up to DoctrineMigrations\Version20231224200000
09:30:38 WARNING [app] (1/3) Lock timeout reached: retrying in 10 seconds...
["sql" => "ALTER TABLE test_retry ADD COLUMN name text DEFAULT NULL"]
09:30:51 WARNING [app] (2/3) Lock timeout reached: retrying in 10 seconds... ["sql" => "ALTER TABLE test_retry ADD COLUMN name text DEFAULT NULL"]
09:30:51 WARNING [app] (3/3) Lock timeout reached: retrying in 10 seconds... ["sql" => "ALTER TABLE test_retry ADD COLUMN name text DEFAULT NULL"]
[error] Migration DoctrineMigrations\Version20231224200000 failed during Execution.
Error: "An exception occurred while executing a query: SQLSTATE[55P03]: Lock not available: 7
ERROR: canceling statement due to lock timeout"
09:31:17 CRITICAL [console] Error thrown while running command "'d:m:m'".
@SmaineDev
@SmaineDev
2๏ธโฃ Checkout on the `production` branch & run tests
1๏ธโฃ Load the DB schema in the branch you want to merge
Version N
Version N+1
๐ง Add an environment var to allow failure when needed
@SmaineDev
Serialization
Deserialization
Publisher
Consumer
Version N
@SmaineDev
Publisher
Version N
๐ Consumers are stopped during the deployment
๐ Deploy Version N+1
Serialization
Deserialization
Publisher
Consumer
Version N
Version N+1
Serialization
Deserialization
Publisher
Consumer
Version N
Version N+1
Publisher
Consumer
Version N
Version N+1
Publisher
Consumer
Version N+1
Release 1๏ธโฃ
Version N+2
Release 2๏ธโฃ
Remove a property
Rename the class
Update property type
...
2๏ธโฃ Consume them with the version of the branch you want to merge
1๏ธโฃ Publish messages with the production version
๐๏ธ Helpers to generate message(s)
๐๏ธ Validate messages can be unserialized
FRONT
BACKEND
FRONT
BACKEND
Version N
Version N+1
BACKEND
Make the property required
FRONTEND
Writeย in the property
BACKEND
Make the property optional
FRONTEND
๐ด
BACKEND
Remove the property
FRONTEND
Stop writingย in the property
BACKEND
Make the property optional
FRONTEND
๐ด
BACKEND
Removeย the old endpoint
FRONTEND
BACKEND
Addย the newย endpoint
Use the new endpoint
FRONTEND
๐ด
BACKEND
Version N
Version N+1
FRONT
FRONT
BACKEND
๐๐ฝ https://github.com/thephpleague/openapi-psr7-validator
ย ๐ก OpenAPI Specification
https://swagger.io/specification/
๐ Make sense if your release frequently
๐ Make sense if your release frequently
โน Critical changes still need maintenance
๐ Make sense if your release frequently
โน Critical changes still need maintenance
๐น System unstable until the last step
๐ Make sense if your release frequently
โน Critical changes still need maintenance
๐น System unstable until the last step
๐ง Most changes require reflection and discipline
๐ Educate your team (workshops, code review...)
๐ Educate your team (workshops, code review...)
๐ Documentation (reference each case)
๐ Educate your team (workshops, code review...)
๐ Documentation (reference each case)
๐งช Learn from your failures (postmortems, feedback...)
๐ Educate your team (workshops, code review...)
๐ Documentation (reference each case)
๐งช Learn from your failures (postmortems, feedback...)
โ Tests
๐ Educate your team (workshops, code review...)
๐ Documentation (reference each case)
๐งช Learn from your failures (postmortems, feedback...)
โ Tests
๐ฆธโโ๏ธ Assign a ZDD hero