Closed garrows closed 11 years ago
@chilts notice I finally figured out how to properly rebase. Took me long enough :P
Oh, a bit more information too. The performance gain I got connecting from home doing reads was:
AU Sydney 240ms --> 160ms average request
US Virginia 1150ms --> 610ms average request
And to use it, you would do this...
var ddb = new DynamoDB({
'accessKeyId' : 'blah',
'secretAccessKey' : 'blah blah blah blah',
'region' : amazon.AP_SOUTHEAST_2,
'protocol' : 'http'
});
I have no idea how I closed the pull request. Must have miss clicked.
Hi Glen,
Hey, thanks for this. It's probably a good option though I'm thinking of the best way of implementing it. Actually, what you have is probably a good start. What we need to decide is, if this is something you would change per request or per client and I think you're right - it's a per client option. :)
I have another branch where I'm making some things about the client more configurable so I'll probably pull this when I'm working on that stuff. So don't be alarmed if it doesn't get merged for a few days.
Thanks and it's really helpful to see the performance increase.
Cheers, Andy
Hey Andy,
Yeah I think per client is right.
That's cool about the configurable client. I was thinking that we could get even more of a performance increase if we kept the connection alive instead of opening and closing a new connection each request. That might be a little tricky to do right though. You would probably want to use the TTL on the DNS response as the maximum connection time since I'm pretty sure that is how they are load balancing. Https would probably end up being just as fast as http if we did this since most of the performance loss is on the initial connection.
Cheers Glen
Hey Andy, You didnt forget about this did you?
Hi Glen,
Sorry, I didn't forget it, just not really had that much time recently to go over a few issues and get them released. Am hoping to find time in the next week or so. :)
Cheers, Andy
This has been fixed in the following commit:
You can just pass a 'protocol' to the options (exactly what you've suggested) but implement in the AwsSum base class rather than in DynamoDB. :)
Published to npm in v1.0.0-beta.
You should just depend on v1.0.x of awssum-amazon-dynamodb.
Thanks Glen and sorry it took so long. AwsSum's new plugin architecture took me a while and wanted to get that done before hitting all my issues. :)
You can now optionally specify 'protocol' in the options for the DynamoDB class as either http or https. This makes the requests significantly faster.
I'm not too sure if this is consistent with the way you use optional parameters in other classes so feel free to reject.