-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RDBMS support #96
Comments
I can take it to the core lib. I'd say that the first version can implement I see that some people might want to have the checkpoint to be updated in the same transaction as the read models, if both the sub, and its projections are using the same database. It only makes sense for non-idempotent projections, and I personally would not do it, but I can expect some demand for it. I assume it should be possible by passing the transaction as part of the context, but I need to check. |
@claudiuchis I finished the PR if you want to review it. Found a couple of small unrelated bugs when making subscriptions work... There's a bit of a mismatch between what I expect to be in the checkpoint record (starting from 0) and what the first sequence element is (one), but it works. |
@alexeyzimarev All looks good to me. Very nicely done! For subscriptions, I see that you haven't added any delay if no new messages are available. I guess the network latency between each read (which could be 10 to 50 ms) and the fact that a new connection is created with each read should be enough to avoid hammering the db, even for higher loads, right? I'll be looking to use this with my next project, and provide more feedback. |
It's the same way as, for example, NServiceBus SQL transport works. The database doesn't suffer from repeated calls that much when the query is so simple, I can see on a monitoring dashboard of the production MS SQL Server instance that a simple query that hits the database 2K times per minute uses very little CPU (as an example). It bothers people who look at query logs in the Management Studio, and they start to freak out, but in reality it's ok :) |
Plus, although the connection is created for each call, it comes from the pool anyway. |
Postgres support release in 0.9.0. |
Hello, |
MS SQL and Postgres are available. If anyone wants to pick up things like SQLite and MySQL - feel free. I might do MySQL as I want to try it with Aurora. |
@alexeyzimarev: I've got a very crude implementation of subscriptions using polling: https://github.com/claudiuchis/eventsourcing.sql. I have created tests to cover the event store, aggregate and subscriptions (all stream, single stream), for now using Postgresql. But this implementation can work with any SQL database with very little changes, including Sqlite. (Postgresql has a very basic notification mechanism to observe changes to a table, so that could be used for subscriptions using Postgresql to switch from polling to pushing). If you think this is worth adding to the contrib repo, let me know and I can add support for other SQL databases (MySql, SqlServer, Sqlite).
Originally posted by @claudiuchis in #19 (comment)
The text was updated successfully, but these errors were encountered: