Skip to main content

Event store for Python

Project description

ᚨᛖᛏᛏ (Aett) is an Event Store for Python

Provides a framework for managing and storing event streams.

Usage

The CommitStore interface is used to store and retrieve events from the event store. The SnapshotStore interface is used to store and retrieve snapshots from the event store.

A CommitStore and SnapshotStore implementation exists for each type of storage class. Use the appropriate module for your chose storage.

Example:

from aett.eventstore.topic_map import TopicMap
from aett.domain.conflict_detector import ConflictDetector
from aett.domain.default_aggregate_repository import DefaultAggregateRepository
from aett.storage.synchronous.postgresql.commit_store import CommitStore
from aett.storage.synchronous.postgresql.snapshot_store import SnapshotStore

commit_store = CommitStore(
    connection_string="Your connection string",
    topic_map=TopicMap(),
    conflict_detector=ConflictDetector(),
)
snapshot_store = SnapshotStore(
    connection_string="Your connection string"
)
aggregate_repository = DefaultAggregateRepository(
    "tenant_id",
    store=commit_store,
    snapshot_store=snapshot_store
)

aggregate: YourAggregateType = aggregate_repository.get(YourAggregateType, "stream_id")

The CommitStore takes in a way to connect to the database as well as:

  • a TopicMap to map events to their application types
  • and ConflictDetector to detect conflicts between competing commits

Domain Modeling

The Aggregate class is used to model domain aggregates. The Saga class is used to model domain sagas.

The loading and saving of aggregates is managed by the DefaultAggregateRepository and the DefaultSagaRepository classes respectively.

Both repositories use the CommitStore and SnapshotStore interfaces to store and retrieve events and snapshots from the persistence specific event stores.

See also:

  • Domain Modeling for more information on how to model your domain aggregates and sagas.
  • Domain Storage for more information on how to store and retrieve aggregates and sagas.

Currently supported persistence stores are:

Storage Engine Sync Async
Sqlite + +
DynamoDB + +
MongoDB + +
PostgreSQL + +
MySql + +
MS SQL Server + -
S3 + +
In-Memory + -

Downloads

Package Downloads
aett Downloads

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

aett-3.4.0.tar.gz (37.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aett-3.4.0-py3-none-any.whl (98.0 kB view details)

Uploaded Python 3

File details

Details for the file aett-3.4.0.tar.gz.

File metadata

  • Download URL: aett-3.4.0.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aett-3.4.0.tar.gz
Algorithm Hash digest
SHA256 99730022fa3fb56596fb6b4bcea9c0fd75cd2bcfcaa48a698db8b4b93556e1aa
MD5 e02b6328ab1db0a9d9028b7c6a1768e2
BLAKE2b-256 5a1db2ddfba1adf7f2389fe49af302a4f116639b1e1f29b87522124c7534983e

See more details on using hashes here.

File details

Details for the file aett-3.4.0-py3-none-any.whl.

File metadata

  • Download URL: aett-3.4.0-py3-none-any.whl
  • Upload date:
  • Size: 98.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aett-3.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5cf2b058c884d93c98b24dae250a12f2316d73fd6598fe62caa76d259dcd39df
MD5 8203610d299e720973e3e92abfac493a
BLAKE2b-256 17033f582783c237809bc9811ed21013108c600cc6cf174d1d9863f51e1fed32

See more details on using hashes here.

Supported by

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