📜  namasha (1)

📅  最后修改于: 2023-12-03 15:17:49.829000             🧑  作者: Mango

Namasha - A scalable, fault-tolerant event stream processing framework

Namasha is an open source framework for building event-driven applications. It provides a scalable and fault-tolerant platform for processing data streams in real-time.

Features
  • Scalable: Namasha is designed to scale horizontally, allowing you to add more processing nodes as your workload grows.
  • Fault-tolerant: Namasha provides automatic fault-tolerance by replicating data across multiple nodes.
  • Real-time processing: Namasha is designed for real-time processing of data streams, allowing you to quickly react to events as they happen.
  • Easy to use: Namasha provides a simple API for building event-driven applications.
Architecture

Namasha is built using a distributed architecture, allowing it to scale to handle large workloads. At its core, Namasha uses Apache Kafka for message queuing and Apache ZooKeeper for coordination and leader election.

Namasha provides a set of APIs for building processors that can consume data from Kafka topics and write results to other Kafka topics or external stores, such as databases or file systems.

Example Code
from namasha import Stream

# create a Namasha stream
stream = Stream()

# define a processing function
def process_event(event):
    # do some processing
    return processed_event

# define the pipeline
(stream
 .from_kafka_topic('input_topic')
 .map(process_event)
 .write_to_kafka_topic('output_topic'))

# start the stream
stream.start()

In this example code, we create a Namasha stream, define a function to process events, and create a pipeline that consumes events from a Kafka topic, processes them using the processing function, and writes the results to another Kafka topic.

Conclusion

Namasha is a powerful framework for building event-driven applications that require real-time processing of data streams. Its scalable and fault-tolerant architecture makes it suitable for handling large workloads, and its easy-to-use API makes it a favorite among developers.