# Incremental Models ## Trade-Offs 1. အကယ်ရွေ့ data တွေက နောက်ကျပြီးမှ ဝင်လာတဲ့အခါ ဘယ်လို လုပ်မလဲ။ ## Strategies - ပထမဆုံး ကိုယ်က ဘယ် database ကို အသုံးပြုမလဲ ဆိုတာ စဥ်းစားရမယ်။ ဘာကြောင့်လဲ ဆိုတော့ database ပေါ် မူတည်ပြီး support လုပ်တဲ့ strategies တွေက ကွဲသွားလို့။ - dbt [Official Documentation](https://docs.getdbt.com/docs/build/incremental-strategy#supported-incremental-strategies-by-adapter) ထဲမှာ ပြထားတဲ့ Table ကို reference ပြုလုပ်ပါ။ | Data platform adapter | append | merge | delete+insert | insert_overwrite | microbatch | | ------------------------------------------------------------------------ | ------ | ----- | ------------- | ---------------- | ---------- | | dbt-postgres | ✅ | ✅ | ✅ | | ✅ | | dbt-redshift | ✅ | ✅ | ✅ | | ✅ | | dbt-bigquery | | ✅ (D) | | ✅ | ✅ | | dbt-spark | ✅ | ✅ | | ✅ | ✅ | | dbt-databricks | ✅ | ✅ | | ✅ | ✅ | | dbt-snowflake | ✅ | ✅ | ✅ | ✅ | ✅ | | dbt-trino | ✅ | ✅ | ✅ | | ✅ | | dbt-fabric | ✅ | | ✅ | | | | dbt-athena | ✅ | ✅ | | ✅ | ✅ | | dbt-teradata | ✅ | ✅ | ✅ | | ✅ | | [dbt-duckdb](https://github.com/duckdb/dbt-duckdb/blob/master/README.md) | ✅ | | ✅ (Default) | | | Visualizations credits to [Joon Solutions](https://joonsolutions.com/dbt-incremental-choosing-the-right-strategy-part-1/) #### Append - Target table ထဲကို new rows များကိုသာ ပေါင်းထည့်သည်။ - duplicate များကို မစစ်ဆေး။ - updates (မည်သည့် row များတွင် မည်သို့ ပြုပြင်ပြောင်းလဲမှု changes များ လုပ်လိုက်သည် ကို) မစစ်ဆေး။ - အသုံးပြုနိုင်တဲ့ ဒေတာများ - ပြုပြင်ပြောင်းလဲရန် မလွယ်ကူသော event streams/log data များ - `INSERT INTO` sql ကို အသုံးပြုသည်။ #### Merge #### Delete + Insert #### Insert - Overwrite #### Microbatch