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

DynamoDB Streams #67

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kiril-pirozenko-home24
Copy link

This is rough implementation of DynamoDB Streams API. The intent of this PR is to gather feedback.

TODO:

  • Add streams support to following actions:
    • UpdateTable
    • DeleteTable
    • BatchWriteItems
  • Improve streams support:
    • ListStreams does not filter streams by table name
    • Respect StreamViewType from StreamSpecification (currently they always work as if NEW_AND_OLD_IMAGES was provided)
    • Stream records have eventID equal to SequenceNumber
    • Shard iterator is valid indefinitely (should be valid only for 15min)
  • Improve tests:
    • Add tests to check request validations
  • Consider adding following functionality (optional):
    • Support for multiple shards per stream (DynamoDB does not specify maximum shard size, so it's perfectly fine to have only one per stream, but it might be useful to be able to emulate multiple shards)
    • Support for record trimming (DynamoDB stores items for 24h only, but I'm not sure whether it would be useful to emulate that)

Implements: #66

@mhart
Copy link
Collaborator

mhart commented Dec 20, 2016

Wow, @kiril-pirozenko-home24 this is a huge undertaking – respect!

Before you go any further though – my original thoughts were that it would be a lot easier to just borrow a lot of the stream code from https://github.com/mhart/kinesalite – considering that Kinesis and DynamoDB Streams are very similar.

Is this something you considered at all?

@kiril-pirozenko-home24
Copy link
Author

Thank you!

No, haven't checked kinesalite at all. Our first goal was to have basic working mock for our services.

Could you have a look at code/functionality/TODO posted above and add what's missing for this PR to be mergeable? Maybe a checklist of your requirements to accept a PR? Because, you know, other business priorities... need to balance all this stuff 🙂 It would be helpful to see a scope of this task.

In general I approve of code borrowing 🙂 How about using more modern JS features? Do you have any requirements for minimum Node version supported? What's your take on tools like Typescript?

@mcwhittemore
Copy link

mcwhittemore commented Jan 3, 2017

Oh man. This is amazing!

From a usability point of view, it would be nice to be able to wire up triggers with something like dynalite.stream('table', function(){}). It would also be nice to know how many records are in the stream so you can wait for the streams to empty before continuing.

@jakubriedl
Copy link

Hi, I love this (and actually need this). Can I help you with finishing this?

@andrewkrug
Copy link

+1 on the request for stream support and triggers

@ZECTBynmo
Copy link

ZECTBynmo commented May 1, 2017

I just wanted to write to report that I've used @kiril-pirozenko-home24's fork and his streams implementation seems to work extremely well. I hope this PR gets accepted eventually

andriiberezhynskyi and others added 2 commits September 28, 2017 12:24
Date.now() returns milliseconds which is interpreted incorectly by
boto3. For example boto3 will interprete the ApproximateCreationDateTime as something like `Fri Jan 08 49712 17:18:22`. This crashes boto3 with an error `year is out of range`. We need unix timestamp there (seconds)
@ryanblock
Copy link
Member

Revisiting this now (7 years later!), also seeing what went down over in #88, I'm wondering if we can't reignite this PR by pulling out the Kinesalite internals we want and using them here (with credit!), without adding it as a dependency? I'm open to ideas, would love to see this move forward again as well.

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

Successfully merging this pull request may close these issues.

10 participants