How arturovaine/airflow-web-scraper-etl works
Main Components
• Docker Compose Container Environment: Emphasize that Docker Compose orchestrates several containers.
• Apache Airflow Container: This includes the Airflow Scheduler, Web Server (UI), and Worker(s) as necessary. This container runs the DAGs from the dags/ directory.
• PostgreSQL Container: Dedicated to storing the scraped data (quotes) and accessed by Airflow during the load step.
• (Optional) Additional Auxiliary Containers: If the project were to expand, you might have separate containers (for logging or custom plugins) but here note that directories like logs/ and plugins/ provide support to the Airflow setup rather than separate services.
• Host/Local Machine: Although many components run in containers, note that the bootstrapping is initiated by a shell script (create_airflow_scraper_project.sh) that sets up the environment.
Relationships and Data Flow
• A feedback loop where the Airflow UI provides monitoring and trigger capabilities for the ETL process.
Architectural Patterns and Design Principles
• Decoupled services: Airflow and PostgreSQL communicate through network links defined in Docker Compose, which encourages modularity and separation of concerns.
• ETL Flow: Illustrate the “Extract-Transform-Load” process by labeling the DAG’s stages (extracting data with BeautifulSoup, transforming it as needed, and loading it into PostgreSQL).
Relevant Technologies and Their Roles
• Apache Airflow: Manages scheduling, execution, and monitoring of the ETL DAG.
• Docker & Docker Compose: Used to containerize all components, ensuring environment consistency.
• PostgreSQL: Serves as the data storage back end.
• BeautifulSoup: The Python library used for scraping data from web pages.
• Shell Script (create_airflow_scraper_project.sh): Bootstraps the environment setup and container deployment.