Difficulty: Beginner
Estimated Time: 10 minutes

Streams are the corner stone of creating distributed systems, allowing you to design and create decoupled systems. In this scenario you will learn how to implement the Publish/Subscribe pattern with streams to replicate changes globally between two different Python applications.

The scenario explains:

  • Creating and Connecting to Fabric

  • Connecting to a Stream

  • Creating Producer

  • Creatig Subscriber

  • Publishing Data

  • Deleting Data

In this scenario you learned how to implement the Publish/Subscribe pattern with streams to replicate changes globally.

The scenario explained:

  • Creating and Connecting to Fabric

  • Connecting to a Stream

  • Creating Producer

  • Creatig Subscriber

  • Publishing Data

  • Deleting Data

These Python functions and streams can be combined with Serverless technology to automatically scale depending on load and capabilities. Follow the Serverless scenario at https://www.katacoda.com/macrometa/scenarios/deploying-serverless-functions

Stream Changes Globally with Python

Step 1 of 7

Setup

To access the Streams C8 API with Python you can use an existing package called pyC8. This provides a native-Python approach to working with Streams and the rest of the C8 API.

The package can be installed using pip3. Execute the command below to install the package within the environment.

pip3 install pyC8

producer.py
subscriber.py