# Type-2 Slowly Changing Dimension (SCD) คือ?

**URL:** <https://discuss.dataengineercafe.io/t/type-2-slowly-changing-dimension-scd/132>\
**Category:** General Discussion เรื่อง Data Engineering\
**Tags:** data-warehouse, scd\
**Created:** [March 14, 2022, 3:21pm UTC](https://discuss.dataengineercafe.io/t/type-2-slowly-changing-dimension-scd/132 "2022-03-14T15:21:31Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![yothinix](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dataengineercafe.io/yothinix/32/147_2.png) [@yothinix](https://discuss.dataengineercafe.io/u/yothinix)\
**Post date:** [March 15, 2022, 3:40am UTC](https://discuss.dataengineercafe.io/t/type-2-slowly-changing-dimension-scd/132/2 "2022-03-15T03:40:49Z")

</div>

อันนี้ดีมาก ผมเคยทำระบบที่เป็น pub/sub หลายปีมาแล้ว เคยเจอปัญหาว่า worker มัน failed แล้วมันไม่หยิบของไป processing เลย ซึ่งตอนแรกไม่ได้ design แบบนี้ ข้อมูลช่วงที่ worker failed คือทำ manual ใหม่หมดเลย

แต่พอใช้ท่าเก็บข้อมูลแบบข้างบน ตอนนั้นคือพอเกิดปัญหาอีกรอบ เราสามารถ re-execute worker ให้มันกลับมาทำต่อจากจุดที่เรารู้ว่ามัน failed ได้เลย เพราะ state ของข้อมูลมัน trace ไปได้หมดเลย

ข้อเสียเดียวที่ผมนึกออกตอนนั้นคือตัว change log อันนี้มันบวมมาก ตอนทำโปรเจ็คนั้นแล้วต้องคอยเคลียร์ทุกๆ เดือน แต่ถ้าเป็นสมัยนี้ของพวกนี้น่าจะเก็บลง Data lake ได้สบายๆ แล้วครับ

---

_[View the full topic](https://discuss.dataengineercafe.io/t/type-2-slowly-changing-dimension-scd/132)._
