Code Monkey home page Code Monkey logo

rmq2psql's Introduction

rmq2psql: RabbitMQ to PostgreSQL Data Pipeline

rmq2psql investigates various approaches for a data pipeline that retrieves messages from RabbitMQ and stores them in PostgreSQL using Golang and Python, including benchmarks.

Performance Analysis

Each benchmark conducts 10,000 reads from RabbitMQ and executes bulk inserts of 100 records into PostgreSQL, with results shown per second.

Goland vs Python

rmq2psql    (Golang)                        | 2.480
rmq2psql.py (Python, best of)               | 3.612

Python JSON libraries

rmq2psql.py (Python, msgspec)               | 3.638
rmq2psql.py (Python, msgspec_struct)        | 3.642
rmq2psql.py (Python, orjson)                | 3.612
rmq2psql.py (Python, ujson)                 | 3.741

Python RabbitMQ Types Consuming

rmq2psql.py (Python, message processing)    | 3.717
rmq2psql.py (Python, queue without timeout) | 4.564
rmq2psql.py (Python, queue with timeout)    | 4.742

Profiling

For per-line rmq2psql.py profiling of JSON libraries and RabbitMQ Types Consuming, the following files are provided in logs/

Recommendations

  • JSON Library:

    • needs to be investigated further with actual JSON data from the project
  • RabbitMQ Types Consuming:

    • use message_processing for optimal performance:
              channel.set_qos(prefetch_count=0)
              async for message in queue:
                  async with message.process(ignore_processed, ...):
                      await self.rmq_callback(message=message)
      

rmq2psql's People

Contributors

gglluukk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.