Skip to main content

HTTP Event Notifications Server - Asynchronous Communication Engine

Project description

AMEBO

Amebo is the simplest pubsub server to use, deploy, understand or maintain. It was built to enable communication between applications i.e. microservices or modules (if you are using monoliths) collectively called producers, and hopes to be able to serve as a small but capable and simpler alternative to Kafka, RabbitMQ, SQS/SNS.

  1. Availability: Amebo runs on battle tested open source tools i.e. Redis, Postgres and provides the same level of availability guarantees

  2. Reliability: Amebo has been used at scale by open source projects to handle 100's of millions of request

  3. Latency: Amebo guarantees sub 100ms latencies at scale (barring network and hardware limitations)

 

How It Works


Amebo has only 4 concepts (first class objects) to understand or master.

 

1. Producers


These can be microservices or modules (in a monolith) - that create and receive notifications about events. All applications must be registered on amebo ;-) before they can publish events.

2. Action


This is something that can happen in an application i.e. creating a customer, deleting an order. They are registered on Amebo by their parent application, and all actions must provide a valid JSON Schema (can be empty "{}") that Amebo can use to validate action events before sending to subscribers.

3. Events


An event is the occurence of an action and in practice is a HTTP request sent by an application to Amebo to signal it about the occurence of an action locally. Events can have a json payload that must match the JSON Schema of its parent action.

4. Subscribers


These are HTTP URLs (can be valid hostname for loopback interface on TCP/IP as well) endpoints registered by applications to receive action payloads.

 

GETTING STARTED

This assumes you have installed Amebo on your machine. Amebo requires Python3.6+

# the easy path
pip install amebo
amebo --workers 2 --address 0.0.0.0:8701


# the hardway (manual installation) BUT not the only way... Sorry, I couldn't resist the pun ;-)
git clone https://github.com/tersoo/amebo
mv amebo /to/a/directory/of/your/choosing
export $PATH=$PATH:/to/a/directory/of/your/choosing/amebo  # add amebo location to your path
ambeo -w 2 -a 0.0.0.0:8701

 

1st : Tell Amebo about all your event producers


endpoint: /v1/producers

Schema Example Payload
{
    "$schema": "",
    "type": "object",
    "properties": {
        "microservice": {"type": "string"},
        "passphrase": {"type": "string"},
        "location": {"type": "web", "format": "ipv4 | ipv6 | hostname | idn-hostname"}
    },
    "required": ["microservice", "passphrase", "location"]
}
{
    "microservice": "customers",
    "passphrase": "some-super-duper-secret-of-the-module-or-microservice",
    "location": "http://0.0.0.0:3300"
}

 

2nd : Register actions that can happen in the registered producers


endpoint: /v1/actions

Endpoint JSON Schema Example Payload
{
    "type": "object",
    "properties": {
        "action": {"type": "string"},
        "microservice": {"type": "string"},
        "schemata": {
            "type": "object",
            "properties": {
                "type": {"type": "string"},
                "properties": {"type": "object"},
                "required": {"type": "array"}
            }
        }
    },
    "required": ["action", "microservice", "schemata"]
}
{
    "action": "customers.v1.created",
    "microservice": "customers",
    "schemata": {
        "$id": "https://your-domain/customers/customer-created-schema-example.json",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
            "customer_id": {"type": "number"},
            "first_name": {"type": "string"},
            "last_name": {"type": "string"},
            "email": {"type": "string", "format": "email"}
        },
        "required": ["customer_id", "email"]
    }
}

 

3rd : Tell Amebo when an action occurs i.e. create an event


endpoint: /v1/events

Key Description
action Identifier name of the action. (As registered in the previous step.)
deduper Deduplication string. used to prevent the same event from being registered twice
payload JSON data (must confirm to the schema registerd with the action)

 

Endpoint JSON Schema Example Payload
{
    "type": "object",
    "properties": {
        "event": {"type": "string"},
        "microservice": {"type": "string"},
        "schemata": {
            "type": "string",
            "format": "ipv4 | ipv6 | hostname | idn-hostname"
        },
        "location": {"type": "web"}
    },
    "required": ["microservice", "passphrase", "location"]
}
{
    "event": "customers.v1.created",
    "microservice": "customers",
    "schema": {
        "$id": "https://your-domain/customers/customer-created-schema-example.json",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
            "event": {"type": "string"},
            "microservice": {"type": "string"},
            "schemata": {"type": "string", "format": "ipv4 | ipv6 | hostname | idn-hostname"},
            "location": {"type": "web"}
        },
        "required": ["microservice", "passphrase", "location"]
    },
    "location": "http://0.0.0.0:3300"
}

 

Finally: Create an endpoint to receive action notifications from Amebo


Other applications/modules within the same monolith can create handler endpoints that will be sent the payload with optional encryption if an encryption key was provided by the subscriber when registering for the event.

Why? Advantages over traditional Message Oriented Middleware(s)

  1. Amebo comes complete with a Schema Registry, ensuring actions conform to event schema, and makes it easy for developers to search for events by microservice with commensurate schema (i.e. what is required, what is optional) as opposed to meetings with team mates continually.

  2. GUI for tracking events, actions, subscribers. Easy discovery of what events exist, what events failed and GUI retry for specific subscribers

  3. Gossiping is HTTP native i.e. subscribers receive http requests automatically at pre-registered endpoints

  4. Envelope format and transmission is web native and clearly outlined by schema registry

  5. Topic management is simplified as actions with versioning support baked in

  6. Infinite retries (stop after $MAX_RETRIES and $MAX_MINUTES coming soon)

Trivia

The word amebo is a West African (Nigerian origin - but used in Ghana, Benin, Cameroon etc.) slang used to describe anyone that never keeps what you tell them to themselves. A talkative, never mind their business individual (a chronic gossip).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amebo-0.5.1.tar.gz (453.3 kB view details)

Uploaded Source

Built Distribution

amebo-0.5.1-py3-none-any.whl (475.9 kB view details)

Uploaded Python 3

File details

Details for the file amebo-0.5.1.tar.gz.

File metadata

  • Download URL: amebo-0.5.1.tar.gz
  • Upload date:
  • Size: 453.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for amebo-0.5.1.tar.gz
Algorithm Hash digest
SHA256 12c6bd4041c91da031d4aa46a05eb4090c22e1c24d83d9d838400ca55b066ee5
MD5 6d4d5c3f2a4101034ea99057f47fb16f
BLAKE2b-256 d6b24ee3d58efd00e05dbf750107f783092ee7b790dd4d9de6c7ed40437b3a0e

See more details on using hashes here.

File details

Details for the file amebo-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: amebo-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 475.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for amebo-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 00c6fbf474e535b814b3cd67be2cb9a47c1f579e6c828461575f1de132ab5d69
MD5 3f06f855b4ad60010ae430917c090ce5
BLAKE2b-256 b203f91da1d0f0c89d2e3ace4c468e330ea8f2a0b565e0bb47c568f0fb3bcb7f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page