紀錄一下Mage這款工具的使用。
這工具是因為公司要做 ETL (Extract, Transform, Load),所以才開始使用的工具。
首先先講一下,在Mage 中,每項任務都是一個 pipeline
pipeline 除了空白外,還有一些寫好的,例如 Standard (batch)、Data integration、Streaming……等。
相關說明可參閱官方文件Concepts > Pipeline Management
現在要備份資料,可以直接選擇 Data integration pipeline
Source 是來源資料庫。例如我來源是 MySQL,連線可能如下
database: example
host: foo.barexample001.ap-northeast-1.rds.amazonaws.com
port: 3306
username: admin
password: password不同的資料庫寫法不同,官方各種不同資料庫的寫法放在 Github 上:mage-ai: mage_integrations/mage_integrations/destinations
然後按下 按鈕選擇你要備份的 table。
如果你的 table 來源和備份不同,例如來源叫做 sys_customer ;備份的 table 要叫做 ec_customer,在以下的區塊填寫你匯出的 table 名稱即可
Output
Destination table name
Transformer 區塊,除非你備份時有要調整,例如清除重複資料,否則不需更動
而 Destination 則是填寫匯出的資料庫的資訊,寫法和 Source 相同
沒有留言:
張貼留言