Posts

Showing posts with the label async

Kafka with KRaft (Kafka Raft)

Image
                                                            image credit Kafka 1. What is Kafka? Kafka is a distributed event streaming platform designed for high-throughput, fault-tolerant, real-time data streaming. It is used for publish-subscribe messaging, event sourcing, log processing, and real-time analytics . Key Features: Scalability : Distributes data across multiple brokers. Durability : Stores data persistently. High Throughput : Handles millions of messages per second. Fault Tolerance : Replicates data across nodes. Core Components: Producers : Send messages (events) to Kafka. Topics : Logical channels where messages are stored. Partitions : Sub-divisions of topics for parallel processing. Consumers : Read messages from topics. Brokers : Kafka se...

FastAPI with async

 In FastAPI , using ` async ` functions is optional, but it provides certain advantages, especially in scenarios where your application may need to handle multiple concurrent operations without blocking the execution of other tasks. The use of `async` is closely tied to asynchronous programming in Python, often referred to as asyncio. Here are some reasons why you might choose to use `async` functions in FastAPI: 1. Concurrent Operations:    - Async functions allow your application to handle multiple operations concurrently without waiting for each operation to complete before moving on to the next one.    - This can be beneficial for I/O-bound operations like making multiple API requests, database queries, or other network-related tasks. 2. Improved Performance:    - Asynchronous programming can improve the overall performance of your application, especially in scenarios where there are many I/O-bound tasks.    - Instead of waiting for one t...