Что нужно унести с занятия
- Разбить изменение схемы/API на безопасные этапы.
- Сохранить совместимость старых и новых потребителей.
- Задать сигнал завершения и план отката.
Одна версия API уже в production, другая ещё у старого клиента. Как изменить поле без окна простоя?
Old mobile app still reads status; new API wants task_state. If the server renames immediately, an old client fails. Map deploy order and supported versions first.
old client → status new client → task_state server must support both during migration
Add new field/API version, allow old and new readers; deploy code that can read both. Add schema without destructive rename.
DB: status + task_state (temporary) API: accept old request; emit new field safely
Copy values with repeatable migration; verify row counts, nulls and mismatches. Keep progress cursor/checkpoint. Decide how changes during backfill are handled.
backfill by id ranges compare status == task_state track lag/errors; retry safely
Move one consumer at a time; watch old field reads and errors. Roll back to old reader if mismatch or traffic remains. Communicate deprecation date.
switch client A → monitor switch client B → monitor rollback reader if error rate ↑
Only remove old field after old traffic is zero for agreed period and restore/migration rollback plan is understood. Keep audit/backup where needed.
stop old writer → wait window backup/checkpoint → drop old field verify application and restore procedure
Keep rollback feasible until data and callers have crossed the migration boundary.
План миграции с этапами, совместимостью и rollback.
Составьте план из четырёх совместимых шагов для изменения API или схемы; для каждого укажите проверку и путь остановки.
Одним предложением: какая потребность обосновывает ключевое решение, что оно стоит команде и чем это проверить?