Comments (9)
@TyGuy hi!
Sorry, but I couldn't take some time to start something on this. You can do it, if you have time for it.
The solution I suggested could be a good one, but as usual, it must first be validated on the field.
I hop you'll find more time than me 😅 Good luck !
from node-eventstore.
Sounds like a breaking change for the redis implementation... (have to write this at least in the release notes)
As far as I know your production data is the biggest for redis... so you're the expert ;-)
from node-eventstore.
I managed to make something work, but I need to do more tests.
I was also wondering if I should modify the existing redis implementation, or if I should apply Open Closed Principle and extend the existing implementation, and add a new database type (called indexedRedis
?), compatible with the existing implementation.
What do you think about it ?
from node-eventstore.
I think it's ok to replace the current implementation when we can proof the new one to be better in form of performance etc...
from node-eventstore.
Sure, but the store needs to be indexed, before any usage. It is done on init
.
And it can take quite a long time (I've indexed my 122K+ events store in 170 sec on my Mac Book Pro 😅, because of the full scan made on all events), and might be done outside of the application (using a dedicated node task), depending on the size of the db.
So I was thinking about the best option not to break compatibility (or at least, here, not to cause an overhead when the application starts the first time with this option). It could be done using a dedicated option, or using another implementation.
from node-eventstore.
But is the already stored data compatible with the new implementation?
So really only this indexing task is what it's needed?
So perhaps the indexing in the init is ok... but we can offer a script to execute to do this indexing on an other process?
from node-eventstore.
Yes sure, it's fully compatible.
The events are not updated. Only some keys are added to better index events and snapshots.
But once you switch to an indexed redis store, the indexation is done. You can go back to a not indexed redis store, but you will have to do it manually (by removing a dedicated key).
What I can do, when you want to use an indexed redis store, is:
- checking if the database is already indexed (using a dedicated key). if not, you will have to do it manually using a call to an
index()
method on the store (maybe in a script). - if you don't do the indexation, the common
scan()
method will be used, usingSCAN
redis command - once the indexation is done, the
scan()
method will use indexes
Why not offering a script for this, but I was wondering how to discover all the options needed to connect to the redis instance. Maybe giving a common example in the documentation would be a first step forward.
You're OK with that?
from node-eventstore.
from node-eventstore.
@rehia do you still have interest in this, or plans to execute on it?
We are sitting with around 30k events in redis, and noticing it slowing down as well. I think this solution (indexing on aggregateId
and using sorted sets) would be awesome!
If you don't have plans to continue it or work on it, would you be willing to share a WIP branch with your implementation? If/when I find some time, I could pick up where you left off, and carry this forward.
from node-eventstore.
Related Issues (20)
- Mongo URL parser deprecated. HOT 2
- PostgreSQL data store HOT 4
- override commitStamp ? HOT 3
- Replaying events to rebuild aggregates HOT 2
- Release a new version with new lodash HOT 2
- Auto-reconnect MongoDB HOT 2
- Calling `es.init()` multiple times causes multiple `connect` & `disconnect` listeners to be added HOT 2
- When using tingodb, no more events are published after restarting app HOT 4
- Flag for dropping existing data when initializing? HOT 3
- Method for testing if there are any or how many events are stored? HOT 5
- MongoDB connection fails with current default options HOT 14
- DeprecationWarning: current Server Discovery and Monitoring engine is deprecated HOT 3
- User Interface HOT 1
- Question: Can I query snapshots by date? HOT 3
- MongoDB: "revision" field type should be casted to number when createSnapshot HOT 4
- [MongoDB] BUG: streamEventsByRevision omits first event and repeats last event. HOT 1
- Opposite of getEventsSince
- npm audit fail on dotty HOT 1
- Azure table is deprecated HOT 1
- batch workflows HOT 1
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 node-eventstore.