share / sharedb-mongo

MongoDB database adapter for ShareDB
MIT License
152 stars 65 forks source link

Does sharedb Mongo support double write databases? #125

Open tuluffy opened 2 years ago

tuluffy commented 2 years ago

For example, one database performs OP persistence (old OPS will be deleted at intervals), and the other database records all OPS (for behavior analysis). thx!

alecgibson commented 2 years ago

This sounds like a classic case for op submission middleware — you want to add a hook to eg afterWrite, and then save the op (and potentially snapshot, metadata, etc.) to whatever database/store/warehouse/lake you want to stash it in for later analysis.