News for hackers. Stuff that matters.
Re:Show HN: s3-lambda – Lambda functions over S3 objects: ea... by afandian on Monday February 13, 2017 @07:41AM (#13634811)
As someone heading down a similar path (and I'm fairly sure I've got sensible prefixes) can you share an example of a prefix that caused you trouble. Is it something like

    /path/to/big-dir/«lots-of-sequential-filenames»

?
Re:Show HN: s3-lambda – Lambda functions over S3 objects: ea... by lobster_johnson on Monday February 13, 2017 @11:15AM (#13636356)
Exactly. It works fine for most tasks, of course, but if you ever want to process the contents of the S3 bucket in bulk, nothing will ever be able to parallelize that one list request to /path/to/big-dir.

If you don't use the evenly-distributed-prefix trick, your only chance of speeding it up is knowing the file names beforehand. If they're all sequentially numbered, you might do that, of course.

The shardable prefix doesn't need to be at the top level. So you could also organize it like so, for example:

    /secret/documents/2016-01-01/00000001.doc
Re:Show HN: s3-lambda – Lambda functions over S3 objects: ea... by afandian on Monday February 13, 2017 @12:32PM (#13637054)
Thanks! I've read the docs and blog posts, but it was interesting to see a real live antipattern.
Re:Show HN: s3-lambda – Lambda functions over S3 objects: ea... by akx on Monday February 13, 2017 @08:52AM (#13635144)
I suppose it's like with regular file systems -- don't have too many files in a directory.

In your use case, consider `/path/to/big-dir/AA/AABB/AABBCC` or similar?

Re:Show HN: s3-lambda – Lambda functions over S3 objects: ea... by afandian on Monday February 13, 2017 @11:06AM (#13636272)
Sorry, that example wasn't my data, it was to illustrate question.