Skip to content
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

dynamic addition of collections to sync #26

Open
miraculixx opened this issue Jul 11, 2019 · 1 comment
Open

dynamic addition of collections to sync #26

miraculixx opened this issue Jul 11, 2019 · 1 comment

Comments

@miraculixx
Copy link

miraculixx commented Jul 11, 2019

What would be the best way to add a dynamic sync, i.e.

  1. automatically detect new, unsynced collections in mongo db
  2. add all fields of a collection without having to specify in momyfile.json
  3. re-read momyfile.json regularly, possibly from a remote location (http), with auto --import on detecting new collections

With at least 3. implemented 1. & 2. would basically come for free, as one could write some application/mongodb-side script to publish a new momyfile when needed, without having to restart momy.

@cognitom
Copy link
Owner

Hi @miraculixx, an interesting question, eventhough I have no good answer about it now...

I think, typically, your 1. & 2. are not easy for automation because there's no perfect way to convert the data from NoSQL to SQL. How about separating the problem and focus to these steps below at first?:

  1. add some field definitions to momyfile manually
  2. detect momyfile changes and add some column to MySQL DB (not implemented)
  3. add some new fields to a document in the Mongo DB collection, then momy will detect the changes

At this point, we need to drop and recreate a table in MySQL, but it would cost too much. It seems that we need some implementation to handle the diff of momyfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants