GithubHelp home page GithubHelp logo

dynamodb-table-sync's People

Contributors

crgwbr avatar echernyavskiy avatar er1c avatar jthomerson avatar onebytegone avatar pbredenberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dynamodb-table-sync's Issues

Global Table Support

When syncing to/from dynamodb global tables, the diffing should ignore the additional global-table related fields.

I technically haven't tested this, simply looking at the code trying to figure out if this would work for global table replication, I think this would fail. I think the diffing would need to ignore any of the aws: prefixed fields. For reference: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables_HowItWorks.html

Example

{
  "aws:rep:deleting": {
    "BOOL": false
  },
  "aws:rep:updateregion": {
    "S": "us-west-2"
  },
  "aws:rep:updatetime": {
    "N": "1542916362.440001"
  },
  "created_on": {
    "N": "1539334691"
  },
  "id": {
    "S": "CatalogId-B2ZyEvviYV5CdgBwjbAN6"
  },
  "key": {
    "S": "catalog.autocare_webservice_enabled"
  },
  "updated_on": {
    "N": "1539334691"
  },
  "value": {
    "BOOL": false
  }
}

The work around would simply be to specifically use your --ignore-att flags, but the new "official" attributes should probably be added to the default list. (I'm not sure if this is best handled in the cli.js or part of the Synchronizer.js in the omit function?

Using as a Library

I'm having issues understanding how to use this as a library. I'm able to get it to work using the cli but when I try to use it as a lib it doesn't seem to find any differences.
This is what I get back when using as a Lib:

{ 'us-east-1:my-slave-table': { extra: 0, sameAs: 0, differing: 0, missing: 0 } }
exports.handler = async () => {
      const sync = new Synchronizer(
        { region: 'us-east-1', name: 'my-master-table' },
        [{ region: 'us-east-1', name: 'my-slave-table' }],
        {
          writeMissing: true,
          writeDiffering: true
        }
      );
      console.log(sync._stats)
};

And using CLI:
image

Configure automated builds on Docker Hub

Now that #16 has been merged in it'd be great to configure automated builds on Docker Hub so that people could take advantage of pre-built Docker images.
This shouldn't involve much more than signing up for a Docker Hub account and giving it permissions to access this organization's Github repositories.

Add verbosity parameters

Especially when copying from a prod table to a brand new table, the "ERROR: ..." scrolling by gets a bit distracting.

It might be nice to have a --summary or --log-level or ??? flag for tweaking output and minimizing console logging - especially if this gets crontab'ed.

feat: Add support for local synchronization.

Use Case

At current, it is not possible to synchronize from a remote DynamoDB to a local instance (e.g. running the local emulator or Docker image) due to how the client connection is constructed.

This functionality can be really useful to create a local copy of a remote DDB for testing and development purposes (or possibly even in a CI pipeline).

Proposal

Reuse the existing command line flag --slave-profile to accept a URL endpoint for the localhost when running in local mode.

This will allow synchronization between a remote DynamoDB instance and a local DynamoDB instance.

Key Changes

  • Update the argument processing to detect the local endpoint
  • Update the client connection to use the local endpoint
  • Update documentation on how to use the local mode.

ERROR: unprocessed keys in batchGet

I haven't dug into this, but I got this error on my first run at the end (and at the end of a 2nd run too)

https://github.com/silvermine/dynamodb-table-sync/blob/master/src/Synchronizer.js#L527

    at /c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/src/Synchronizer.js:527:22
    at _fulfilled (/c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/node_modules/q/q.js:854:54)
    at self.promiseDispatch.done (/c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/node_modules/q/q.js:883:30)
    at Promise.promise.promiseDispatch (/c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/node_modules/q/q.js:816:13)
    at /c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/node_modules/q/q.js:624:44
    at runSingle (/c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/node_modules/q/q.js:137:13)
    at flush (/c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9) Error: ERROR: unprocessed keys in batchGet
    at /c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/src/Synchronizer.js:527:22
    at _fulfilled (/c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/node_modules/q/q.js:854:54)
    at self.promiseDispatch.done (/c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/node_modules/q/q.js:883:30)
    at Promise.promise.promiseDispatch (/c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/node_modules/q/q.js:816:13)
    at /c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/node_modules/q/q.js:624:44
    at runSingle (/c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/node_modules/q/q.js:137:13)
    at flush (/c/Users/Eric Peters/.npm-packages/lib/node_modules/silvermine-dynamodb-table-sync/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.