BigData/Apache Airflow

[Airflow] Metastore version, RDBMS 종류에 따른 차이 정리

스파이디웹 2024. 4. 27. 11:58
728x90

최근에 Airflow Metastore에 있는 데이터 이관을 하면서 Metastore 이관 관점에서 Metastore에 관련된 테이블, 컬럼 정보들을 정리해봤습니다.

1. Airflow version별 metastore의 구성 차이

2.1.3(PostgreSQL)

1) 테이블 수

28개 테이블

  • ab_permission
  • ab_permission_view
  • ab_permission_view_role
  • ab_register_user
  • ab_user
  • ab_user_role
  • ab_view_menu
  • alemberic_version
  • connection
  • dag
  • dag_code
  • dag_pickle
  • dag_run
  • dag_tag
  • import_error
  • job
  • log
  • rendered_task_instance_fields
  • sensor_instance
  • serialized_dag
  • sla_miss
  • slot_pool
  • task_fail
  • task_instance
  • task_reschedule
  • variable
  • xcom

2) 컬럼 순서

connection테이블

id conn_id conn_type host schema login password port extra is_encrypted is_extra_encrypted description

 

variable 테이블

id key val is_encrypted description

2.5.3(PostgreSQL)

1) 테이블 수

42개 테이블

  • ab_permission
  • ab_permission_view
  • ab_permission_view_role
  • ab_register_user
  • ab_role
  • ab_user
  • ab_user_role
  • ab_view_menu
  • alembic_version
  • callback_request
  • connection
  • dag
  • dag_code
  • dag_owner_attributes
  • dag_pickle
  • dag_run
  • dag_run_note
  • dag_schedule_dataset_reference
  • dag_tag
  • dag_warning
  • dagrun_dataset_event
  • dataset
  • dataset_dag_run_queue
  • dataset_event
  • import_error
  • job
  • log
  • log_template
  • rendered_task_instance_fields
  • serialized_dag
  • session
  • sla_miss
  • slot_pool
  • task_fail
  • task_instance
  • task_instance_note
  • task_map
  • task_outlet_dataset_reference
  • task_reschedule
  • trigger
  • variable
  • xcom

2) 컬럼 순서

connection 테이블

id conn_id conn_type description host schema login password port is_encrypted is_extra_encrypted extra

 

variable 테이블

id key val description is_encrypted

2.7.1(PostgreSQL)

1) 테이블 수

42개 테이블

  • ab_permission
  • ab_permission_view
  • ab_permission_view_role
  • ab_register_user
  • ab_role
  • ab_user
  • ab_user_role
  • ab_view_menu
  • alembic_version
  • callback_request
  • connection
  • dag
  • dag_code
  • dag_owner_attributes
  • dag_pickle
  • dag_run
  • dag_run_note
  • dag_schedule_dataset_reference
  • dag_tag
  • dag_warning
  • dagrun_dataset_event
  • dataset
  • dataset_dag_run_queue
  • dataset_event
  • import_error
  • job
  • log
  • log_template
  • rendered_task_instance_fields
  • serialized_dag
  • session
  • sla_miss
  • slot_pool
  • task_fail
  • task_instance
  • task_instance_note
  • task_map
  • task_outlet_dataset_reference
  • task_reschedule
  • trigger
  • variable
  • xcom

2) 컬럼 순서

connection 테이블

id conn_id conn_type description host schema login password port is_encrypted is_extra_encrypted extra

 

variable 테이블

id key val description is_encrypted

 

결론

  • 2.1.3과 상위버전(2.5.3, 2.7.1)의 테이블 수 및 컬럼의 순서는 차이가 있지만 비교적 상위버전인 2.5.3, 2.7.1의 테이블 수 및 컬럼 순서의 차이는 없음
  • 하위버전에서 상위버전으로 이관 할 때는 필요한 정보만 이관을 시키고, 상위버전끼리의 이관은 어렵지 않을 것으로 보임

2. RDBMS 종류 별 metastore 구성 차이

MySQL(2.7.1)

1) 생성 위치

  • airflow.cfg에 정의한 result_backend host에 언급한 DB 하위에 table로 생성
  • values.yaml에 언급한 DB하위에 table로 생성

2) 컬럼 순서

connection 테이블

id conn_id conn_type description host schema login password port is_encrypted is_extra_encrypted extra

 

variable 테이블

id key val description is_encrypted

PostgreSQL(2.7.1)

1) 생성 위치

  • values.yaml에 언급한 DB하위의 public schema에 table로 생성
  • public schema를 사용하지 않으려면, values.yaml에 지정된 user의 search_path(schema)경로를 지정해줘야 함
ALTER USER airflow SET search_path = metadatabase;

2) 컬럼 순서

connection 테이블

id conn_id conn_type description host schema login password port is_encrypted is_extra_encrypted extra

 

variable 테이블

id key val

 

결론

  • 테이블 수는 당연히 동일하고, 컬럼 순서 또한 RDBMS관계 없이 버전이 같으면 동일함
  • 사용하는 메타스토어의 rdbms종류를 바꾸는 것은 어렵지 않아 보임
728x90