Zurück zum Ranking

damklis/DataEngineeringProject

Python

Example end to end data engineering project.

big-datascrapingmongodbelasticsearchdata-engineeringkafkakafka-connectdebeziumdjango-rest-frameworkredisairflowminio
Sterne-Wachstum
Sterne
1.4k
Forks
277
Wochenwachstum
Issues
1
5001k
Sept. 2020Aug. 2022Aug. 2024Juli 2026
ArtefaktePyPIpip install dataengineeringproject
README

Data Engineering Project

Build Status Coverage Status Python 3.8

Data Engineering Project is an implementation of the data pipeline which consumes the latest news from RSS Feeds and makes them available for users via handy API. The pipeline infrastructure is built using popular, open-source projects.

Access the latest news and headlines in one place. :muscle:

Table of Contents

Architecture diagram

MVP Architecture

How it works

Data Scraping

Airflow DAG is responsible for the execution of Python scraping modules. It runs periodically every X minutes producing micro-batches.

  • First task updates proxypool. Using proxies in combination with rotating user agents can help get scrapers past most of the anti-scraping measures and prevent being detected as a scraper.

  • Second task extracts news from RSS feeds provided in the configuration file, validates the quality and sends data into Kafka topic A. The extraction process is using validated proxies from proxypool.

Data flow

  • Kafka Connect Mongo Sink consumes data from Kafka topic A and stores news in MongoDB using upsert functionality based on _id field.
  • Debezium MongoDB Source tracks a MongoDB replica set for document changes in databases and collections, recording those changes as events in Kafka topic B.
  • Kafka Connect Elasticsearch Sink consumes data from Kafka topic B and upserts news in Elasticsearch. Data replicated between topics A and B ensures MongoDB and ElasticSearch synchronization. Command Query Responsibility Segregation (CQRS) pattern allows the use of separate models for updating and reading information.
  • Kafka Connect S3-Minio Sink consumes records from Kafka topic B and stores them in MinIO (high-performance object storage) to ensure data persistency.

Data access

  • Data gathered by previous steps can be easily accessed in API service using public endpoints.

Prerequisites

Software required to run the project. Install:

Running project

Script manage.sh - wrapper for docker-compose works as a managing tool.

  • Build project infrastructure
./manage.sh up
  • Stop project infrastructure
./manage.sh stop
  • Delete project infrastructure
./manage.sh down

Testing

Script run_tests.sh executes unit tests against Airflow scraping modules and Django Rest Framework applications.

./run_tests.sh

API service

Read detailed documentation on how to interact with data collected by pipeline using search endpoints.

Example searches:

  • see all news
http://127.0.0.1:5000/api/v1/news/ 
  • add search_fields title and description, see all of the news containing the Robert Lewandowski phrase
http://127.0.0.1:5000/api/v1/news/?search=Robert%20Lewandowski 
  • find news containing the Lewandowski phrase in their titles
http://127.0.0.1:5000/api/v1/news/?search=title|Lewandowski 
  • see all of the polish news containing the Lewandowski phrase
http://127.0.0.1:5000/api/v1/news/?search=lewandowski&language=pl

References

Inspired by following codes, articles and videos:

Contributions

Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Please feel free to contact me if you have any questions. Damian Kliś @DamianKlis

Ähnliche Repositories
binhnguyennus/awesome-scalability

The Patterns of Scalable, Reliable, and Performant Large-Scale Systems

MIT Licensesystem-designbackend
72.6k7k
ClickHouse/ClickHouse

ClickHouse® is a real-time analytics database management system

C++Apache License 2.0dbmsolap
clickhouse.com
48.8k8.7k
apache/spark

Apache Spark - A unified analytics engine for large-scale data processing

ScalaApache License 2.0pythonscala
spark.apache.org
43.7k29.3k
donnemartin/data-science-ipython-notebooks

Data science Python notebooks: Deep learning (TensorFlow, Theano, Caffe, Keras), scikit-learn, Kaggle, big data (Spark, Hadoop MapReduce, HDFS), matplotlib, pandas, NumPy, SciPy, Python essentials, AWS, and various command lines.

PythonPyPIOtherpythonmachine-learning
29.3k8k
apache/flink

Apache Flink

JavaMavenApache License 2.0scalajava
flink.apache.org
26.2k14k
thingsboard/thingsboard

Open-source IoT Platform - Device management, data collection, processing and visualization.

JavaMavenApache License 2.0visualizationiot
thingsboard.io
22.1k6.4k
amark/gun

An open source cybersecurity protocol for syncing decentralized graph data.

JavaScriptnpmOthermachine-learningartificial-intelligence
gun.eco/docs
19.1k1.2k
heibaiying/BigData-Notes

大数据入门指南 :star:

JavaMavenhadoophdfs
16.9k4.3k
prestodb/presto

The official home of the Presto distributed SQL query engine for big data

JavaMavenApache License 2.0javapresto
prestodb.io
16.7k5.5k
andkret/Cookbook

The Data Engineering Cookbook

PythonPyPIApache License 2.0data-engineerdata-engineering
learndataengineering.com
15.2k2.7k
trinodb/trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)

JavaMavenApache License 2.0javapresto
trino.io
13.1k3.7k
apache/predictionio

PredictionIO, a machine learning server for developers and ML engineers.

ScalaApache License 2.0scalabig-data
predictionio.apache.org
12.5k1.9k