Comments (2)
Thanks for asking!
I think we are interested to support any reliable database management system that is capable of supporting atomic transactions and uniqueness constraints.
The library's "aggregate recorder" class can be implemented on most databases. If the DBMS doesn't support atomic transactions on multiple aggregate sequences, then the aggregste recorder will need to make this apparent, somehow, to avoid potential inconsistency.
If the DBMS supports auto-incrementing a counter, or otherwise putting the aggregate events in a "total order", the aggregate recorder can be extended to implement an "application recorder". This allows the state of an application (domain model comprising many aggregates) to be propagated reliably. An application recorder is the type of recorder normally used by an application class.
If the DBMS also allows tracking records to be written atomically with new state (aggregate events, materialized views, etc), then the application recorder can be extended to implement a "process recorder". A process recorder is the type of recorder normally used by a "process application" in an event processing system.
So, yes, to the extent that MongoDB is capable of supporting these things, there is interest in adapting it to work with the library.
If you are interested to help with this, please let me know. I don't have much experience with MongoDB.
from eventsourcing.
Hey John,
Thank you for the information. I will keep this in mind, as I plan to write a mongo recorder for this repo. I am working on an app right now using this library. I actually just implemented my own Mongodb recorder, but I can easily submit a more final product to the codebase.
class MongoRecorder(AggregateRecorder):
def __init__(self, db_host, db_port):
self._client = get_client(db_host=db_host, db_port=db_port)
self._db = get_database(client=self._client, db_name='AggregateRecorder')
self.collection = get_collection(database=self._db, collection='aggregate_events')
def insert_events(self, stored_events: List[StoredEvent], **kwargs: Any) -> None:
results = add_many_items(
collection=self.collection,
items=[asdict(event) for event in stored_events],
ordered=True
)
def select_events(
self,
originator_id: UUID,
gt: Optional[int] = None,
lte: Optional[int] = None,
desc: bool = False,
limit: Optional[int] = None,
) -> List[StoredEvent]:
cursor = get_item(collection=self.collection, item_id=originator_id, item_key='originator_id')
return [
StoredEvent(
originator_id=record['originator_id'],
topic=record['topic'],
originator_version=record['originator_version'],
state=bytes(record['state'])
) for record in cursor
]
from eventsourcing.
Related Issues (20)
- Postgres does not accept idle_in_transaction_session_timeout as float string HOT 2
- Postgres schema change possibility HOT 5
- Investigating potential problem when saving events for multiple aggregates HOT 2
- Custom Postgres schema breaks followers HOT 3
- Aggregate Not Found when AGGREGATE_CACHE_MAXSIZE not set HOT 13
- monotonic HOT 2
- support postgresql as alias for postgres persistence module HOT 3
- Support for rabbitmq HOT 10
- Best way to befriend sqlalchemy database and eventsourcing HOT 6
- Is it necessary to re-hydrate an aggregate to check it exists in a repository? HOT 4
- Suggested approach to Entities in 9.x? HOT 1
- Slack invite not working HOT 3
- Snapshot in aggregate8 example won't work for custom object in aggregate HOT 8
- `Follower(Application)` does not call `self.construct_mapper()` HOT 5
- Additional examples HOT 2
- How to set aggregate/application state for tests? HOT 1
- Automatic snapshotting not work for functional style aggregate HOT 8
- Use ProcessApplication build materialized view HOT 2
- Question: How to best integrate with token based authentication for Postgres HOT 16
- Question: how to avoid performance bottleneck with huge number of events HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eventsourcing.