التوسيع والانكماش
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
restructure a column without downtime.
الموضوعات المخطط لها
- Expand: add the new column (nullable); deploy code that writes to both and reads the old.
- Migrate: backfill old rows in batches; verify.
- Switch: deploy code that reads the new column; keep writing both for a while.
- Contract: stop writing the old column, then drop it in a later release.
- Each step is backward compatible with the previous app version, so any step can be rolled back.
تفاصيل المخطط المبدئي
عرض عملي
a five-release table for renaming customer.name to full_name: add column, dual-write, backfill, switch reads, drop old.
اختبر فهمك
Why is ALTER TABLE customer RENAME COLUMN in one step unsafe while old app instances run?
أظهر الإجابة
Old instances still use the old name and fail immediately.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.