mapbox / dyno

simple dynamodb client
MIT License
78 stars 28 forks source link

Refactor to make better use of native aws-sdk #105

Closed rclark closed 8 years ago

rclark commented 9 years ago

I've been thinking critically over the weekend about dyno. I'm feeling like several of the helpful aspects that dyno has provided have become convoluted or are now supported by the AWS SDK for JS:

This has left me trying to list out what dyno's biggest contributions are at this point. I wonder if dyno needs to undergo some significant refactoring to focus on these aspects:

I believe we might be able to make dyno more maintainable by building the dyno client as an extension of an aws-sdk client, without overriding that client's methods like we do now. We could inherit getItem, putItem, etc. from the aws-sdk, and provide our own methods focused on the things dyno can still contribute.

Definitely looking for thoughts and input on this @mick @willwhite. Did I miss anything that you consider important dyno functionality that's not offered by the aws-sdk? Talk me back from the ledge please.

rclark commented 9 years ago

I sketched out what an index.js might look like in my mind's eye, including notes on what/why certain things. https://gist.github.com/rclark/5fd3fe13205230fced66

mick commented 9 years ago

I think this all makes sense, and its good to rely more on aws-sdk now that it has caught up. This is going to include a lot of small breaking changes, but probably worth it.

rclark commented 9 years ago

a lot of small breaking changes

Wonder if you have something else in mind... but I'm seeing fairly solid breaking changes. Would you want to try and map the dyno-style expression of conditions and stuff into aws-sdk parameters still? While I don't mind the format niceties, I also really like the aws-sdk's docs.

rclark commented 8 years ago

Done in #106.