This repository contains a data pipeline designed to automate the process of extracting data from a source database, loading it into a destination database, and then performing data transformations using dbt (data build tool).
- Data Extraction: Extracts data from a specified source database.
- Data Loading: Loads the extracted data into the destination database for further processing.
- Data Transformation with dbt: Utilizes dbt to transform the loaded data, ensuring it is optimized and ready for analysis.
- Extract: The pipeline connects to the source database, extracts the necessary data, and prepares it for loading.
- Load: The extracted data is then loaded into the destination database, setting the stage for transformation.
- Transform: dbt is employed to transform the loaded data, applying necessary business logic and preparing the data for analytics or reporting.
- Source Database: [Specify Database Type, e.g., MySQL, PostgreSQL]
- Destination Database: [Specify Database Type, e.g., PostgreSQL, Redshift]
- dbt: For data transformation and modeling
- Docker: To containerize the environment for consistent and isolated execution.
- Subprocess: For running command-line processes programmatically within the pipeline.
- Cron Job: For scheduling and automating the pipeline execution at specified intervals.
- Ensure that Docker is installed and running on your system.
- Install
dbtand configure it for the destination database.
-
Clone the repository:
git clone https://github.com/your-username/your-repo-name.git cd your-repo-name -
Configure the connection settings for both the source and destination databases. Update the configuration files in the
config/directory. -
Configure dbt:
pip install dbt-core dbt-postgres --user
-
Build and run the Docker containers:
docker-compose up --build
-
Run the pipeline:
- The pipeline can be executed manually using the command:
python run_pipeline.py
- Alternatively, you can set up a cron job to run the pipeline automatically at scheduled intervals. Example:
0 0 * * * /usr/bin/python3 /path/to/your/repo/run_pipeline.py
- The pipeline can be executed manually using the command:
-
Stop the Docker containers and remove volumes:
docker-compose down -v
. Monitor and review the transformation results: Check the destination database for the transformed data, or review dbt logs and reports for more details.
Pipeline Configuration: Detailed information about configuring the source and destination databases can be found in the docs/configuration.md file.
- Running dbt: Refer to the
docs/dbt.mdfile for instructions on setting up and running dbt within the pipeline. - Docker Setup: Instructions for setting up and troubleshooting Docker can be found in the
docs/docker.mdfile.
Docker: To containerize the application and ensure consistent environments.
Python: For writing and managing the pipeline scripts.
Subprocess: To manage the execution of command-line tools within the pipeline.
SQL: For querying and managing data within databases.
Bash: For scripting and automation tasks.
Cron Job: To schedule automated execution of the pipeline.
dbt: For data transformation and modeling.
For questions or support, please contact ME at devvardhan456@gmail.com