Which gem is better for working with AWS: aws-sdk or fog?
Asked Answered
T

3

5

I am just about to start working with AWS (s3 and ec2) and I was wondering which gem is better: aws-sdk or fog?

Trepang answered 4/1, 2012 at 15:20 Comment(0)
A
20

I would say AWS-SDK. I have not used fog, but have used the AWS gem, and switched. I have found that the official support and bug fixing from the ruby person at Amazon has been pretty good. Also the code in AWS-SDK is nice and clean, and I like the approach. When AWS announces a new feature, the AWS-SDK client seems to get updated within days to support it.

I looked at fog, and immediately decided against it: a) Too many gem dependencies. b) Lowest common denominator, and c) Internal complexity, needed because it supports many different protocols.

Anchovy answered 31/1, 2012 at 15:46 Comment(1)
Every time I try to use fog (for custom projects, not e.g. Carrierwave integration), I end up diving into the code to try to understand the very basics, instead of actually using it. I can't seem to wrap my head around it. Actually, it may be because the only documentation I've found is either 1) trivial examples or 2) the dry API documentation for everything under the sun. /rantBonzer
K
1

I would say fog.

All I know is that it's the one I've been using and it's fine. It supports almost all of the AWS services except for sns I think. It might be easier to test as well, since it has mock services.

It's the one recommanded for working with carrierwave also.

Fog also seems to be well maintained.

But on the other hand, aws-sdk is done by amazon, and might become the standard.

Kursh answered 4/1, 2012 at 15:27 Comment(5)
Can't say I recommend this answer. The aws-sdk is clearly becoming the winner. The code is excellent, and it is updated quickly when new APIs come out.Arabel
For as long as I used AWS-SDK, I had to monkey patch it. I recently switched to fog and am very pleased with it.Econah
fog is thread safe, aws-sdk requires working around autoload.Ingeingeberg
The workaround is simply AWS.eager_autoload!. A pretty minor bit of effort to get around the thread-safety issue.Monti
It is worth noting that AWS.eager_autoload! is only necessary if you are on Ruby 1.8/1.9, as standard autoload is thread safe in Ruby 2.Chanellechaney
F
0

I would say if you're only using amazon services, just use aws-sdk.

Look at the fog source code, it's awesome but also scary how many services are handled and built in the core gem: https://github.com/fog/fog/tree/master/lib/fog

Think that all those service drivers are part of your application build for nothing.

Flasher answered 3/3, 2015 at 14:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.