เพื่อนๆ เคยปวดหัวกับ Request เยอะๆ จนทำให้ระบบล่มกันมั้ย? หากเคยเป็นแบบนี้แอดขอแนะนำให้รู้จัก Kafka 👏
.
📚 Kafka เป็น Distributed message queue สร้างขึ้นโดย LinkedIn เป็น Open Source ซึ่งเป็น ลองนึกภาพตามง่ายๆ หากระบบของเรามีผู้เข้าใช้งาน 1,000,000 คนภายในไม่กี่นาทีมันก็จะทำให้เกิดปัญหาตามมามากมาย ไม่ว่าจะเป็น Data lost บ้าง ระบบล่มบ้าง ทำให้แตกกันไปข้างนึงเลยจ้ะพี่จ๋า555
.
✨ Kafka ก็จะมาช่วยแก้ปัญหาตรงนี้ ด้วยการจัดการ queue ให้เข้ามาทีละ request และเมื่อพร้อมก็ค่อยเรียกใช้งานแบบ asynchronous การใช้งานจริงๆ มันจะทำเรื่องนี้ได้ไวมากๆ เลยนะ ทีนี้จะกี่ request ก็ไม่มีดราม่า...เพราะเรามี Kafka นั่นเอง!!
.
📍 การทำงานของ Kafka มีดังนี้
.
✏️1) Producer - จะทำการส่ง Message ไปหา Kafka Server ในรูปแบบของ Array โดยทีละ record
.
✏️2) Consumer - จะทำการรับ Message จาก Kafka Server ที่ Producer ส่งมาและนำไปประมวลผลต่อ
.
✏️3) Kafka Server หรือ Broker เป็นตัวกลางในการ Exchange message โดยจะมี Zookeeper เป็นผู้ควบคุม
.
✏️4) Cluster เป็นกลุ่มของคอมพิวเตอร์ที่ทำงานร่วมกัน หรือ Multiple Broker ในเมื่อ Producer มีหลายอัน ก็ต้องมีหลายๆ Broker ด้วยนะ เวลารับ-ส่ง Message จะได้ไม่ติดขัด
.
✏️5) Topic เป็นที่เก็บชื่อ หรือ Key ทำให้ Kafka Server รู้ว่า Message ด้านในคืออะไร
.
✏️6) Partitions เนื่องจากเวลารับส่งข้อมูล อาจจะมีข้อมูลที่ใหญ่มาก Partitions ก็จะทำการแบ่งข้อมูลเป็นส่วนๆ เพื่อให้ Server รับไหว
.
✏️7) Offset เป็น Sequence id ของ Partitions เมื่อรับ-ส่งข้อมูลจะได้รู้ว่าข้อมูลไหนมาถึงก่อน
.
✏️8) Consumer Groups ก็คือกลุ่มของ Consumer นั่นแหละซึ่งจะช่วยกันทำงานรับข้อมูลจากหลายๆ Producer มาประมวลผลต่อก่อนจะส่งให้ Data Center
.
💥 เพื่อนๆ คนไหนอยากลองใช้งาน Kafka สามารถกดลิงค์นี้ไปลองใช้งานได้เลย >> https://docs.confluent.io/clients-confluent-kafka-python/current/overview.html
.
borntoDev - 🦖 สร้างการเรียนรู้ที่ดีสำหรับสายไอทีในทุกวัน
同時也有10000部Youtube影片,追蹤數超過2,910的網紅コバにゃんチャンネル,也在其Youtube影片中提到,...
「message queue python」的推薦目錄:
- 關於message queue python 在 BorntoDev Facebook 的最佳解答
- 關於message queue python 在 コバにゃんチャンネル Youtube 的最佳貼文
- 關於message queue python 在 大象中醫 Youtube 的精選貼文
- 關於message queue python 在 大象中醫 Youtube 的最佳解答
- 關於message queue python 在 prakhar308/message-queues-in-python 的評價
- 關於message queue python 在 Background job processing using Python, FastAPI and Redis ... 的評價
- 關於message queue python 在 PyRSMQ - Redis Simple Message Queue 的評價
- 關於message queue python 在 python - Need a thread-safe asynchronous message queue 的評價
- 關於message queue python 在 Python message queue的問題包括PTT、Dcard、Mobile01 的評價
- 關於message queue python 在 Python message queue的問題包括PTT、Dcard、Mobile01 的評價
- 關於message queue python 在 Python message queue的問題包括PTT、Dcard、Mobile01 的評價
- 關於message queue python 在 JSON messaging queue with transformation and dispatch ... 的評價
message queue python 在 Background job processing using Python, FastAPI and Redis ... 的推薦與評價

Background job processing using Python, FastAPI and Redis Queue | Python | Message Queue. 3K views · 4 months ago ...more. CodeWithRajRanjan. ... <看更多>
message queue python 在 PyRSMQ - Redis Simple Message Queue 的推薦與評價
Python Implementation Notes. NOTE This project is written for Python 3.x. While some attempts to get Python2 support were made I am not sure how stable it would ... ... <看更多>
message queue python 在 prakhar308/message-queues-in-python 的推薦與評價
Message queuing allows applications to communicate by sending messages to each other.The message queue provides temporary message storage when the destination ... ... <看更多>