8 ms·
Amazon S3 Object Lambda
- blunte 6y agoWe do this all the time already when we write various interface services to access a common data store. Each service provides whatever interface is appropriate and performs any desired transformations. It's not clear to me what the real benefits of Object Lambda provides. Indeed it could move your transformation code closer to its data, but the cost of doing that is the management and complexity of the lambdas. I am curious what a best use case example would be for this.
- chrisandchris 6y agoFor my use-cases, this would be a huge benefit: > Resizing and watermarking images on the fly using caller-specific details, such as the user who requested the object. Now we need to either do rescale directly after storing or need to use another service (on EC2) to do the resize. With Object Lamda, we could do it on-the-fly as the user calls the image. This is operational a lot easier.
- ec109685 6y agoEven without this feature, you could stand up a lambda and do the resize on the fly. Advantage here is that clients can just continue to use their existing S3 interface yet your lambda is still invoked.
- captn3m0 6y agoDoes this get triggered over the S3-over-HTTPS (the one used for websites) served objects? (instead of S3 APIs)
- deleted 6y ago[deleted]
- matt-attack 6y agoHow are parameters passed? That is how does Lambda get its resize parameters from just an S3 GET? Are they query params?
- jon-wood 6y agoIn the example use case for that they suggested baking the size into the filename, like image_500_240.jpg
- skynet-9000 6y agoYou might want to build some rate limiting into your lambda as well!
- ralusek 6y agoAt the moment this is currently handled with lambda @ edge with Cloudfront. The benefit with Cloudfront over S3 lambda is that the image is automatically cached after the resize is computed.
- mwarkentin 6y agoYou could cache the image with s3 lambda too, no? Edit: I guess you meant that cloudfront caches it for you automatically.
- ralusek 6y agoExactly, yup. Whatever it returns is automatically cached at the key.
- joshuanapoli 6y agoThe benefit of S3 Object Lambda is that your function is adapted to the S3 API. If you already have an application integrated with S3, then you can use Object Lambda to provide some new behavior to the data without changing the application.
- barbazoo 6y agoYour example is way better than what AWS has on their page (marketing, analytics) which made me think immediately: you shouldn't use a file store for that but a database.
- lambda_obrien 6y agoS3 is basically a database. You can store everything there and interact with it via SQL with Athena, for example. I could see utilizing all of Amazon's "infinitely scalable" services to build very simple and powerful software really easily.
- barbazoo 6y agoI think Athena has to get a lot less expensive for that to become true.
- kryptk 6y agoFor small numbers of large queries, Athena has been an incredible technology stack .. I pay pennies a month to run my analytics jobs on it (aggregates across a few hundred million rows, joins with tens of millions of rows into hundreds of thousands of rows). I start my data as .csv.gz but the first step is a CTAS to extract columns and convert to compressed parquet. This step basically costs the most but gives a 10x data size reduction to downstream steps. Athena does not work at all if you perform large numbers of small indexed read queries, definitely use a traditional database for that.
- lambda_obrien 6y agoYes, it's great if you setup the data structures properly, we pay a few bucks a month to run a lot of infra on it to query telemetry data over a few hours to a few days at a time. I think an equivalent cost in just a database server instance to run the same load would be at least 25 to 50 a month. You're not really locked into athena, either, it just takes standard sql, so you could easily transition to a dedicated box later.
- SoapSeller 6y agoIf S3 is database - Object Lambda is stored procedure? I guess that for some systems that are heavily S3-based it will help adding new features without needing to rewrite the interface or duplicate the functionality. It's nice to know that AWS achieved such lock-in with some customers.
- kbumsik 6y agoOur team write complex code for Spark to sanitize/anonymize personal data before processing. With this we might simplify the pipeline because we can keep the same S3 interface.
- mxz3000 6y agoThis. This allows sensitive data to never leave the storage layer.
- lettergram 6y ago> the cost of doing that is the management and complexity of the lambdas The lock-in mechanism. Imo this isn’t more functional than other approaches, it’s a way to ensure you don’t switch services.
- mr_toad 6y ago> It's not clear to me what the real benefits of Object Lambda provides. It’s basically doing the same thing as an SQL view. It just hides and abstracts away some complexity.
- sneak 6y agoThis is both amazing/cool/awesome, as well as simultaneously a brilliant way of more tightly coupling customer data to AWS services. The brilliant part is that it works even if you don't use AWS for compute: they can start making money on per-request compute for S3 "only" customers.
- Datagenerator 6y agoDoes this feature add proprietary musings to the S3 protocol? Vendor lock-in?
- bitshifta 6y agoThe "S3 Protocol" is REST over HTTP, I would imagine nothing changes from the client side, it's still a regular GET request.
- mcintyre1994 6y agoThey show an example further down - the client just uses a different bucket name in the exact same call.
- uncledave 6y agoI treat AWS like a mainframe. Always remember you’re renting it and make sure you cost an exit plan or persistent payments and you’re fine.
- djhworld 6y agoAt my last job we had a lot of data in S3 queried using the data tooling like Athena or EMR. This was useful to a lot of teams in the org but the downside was trying to lockdown certain fields like IP address to people who needed access to that data for support/operational reasons. Amazon did come up with some IAM/grouping policy things but these were a bit clunky from what I recall. I wonder if something like this would have made it a bit more flexible to allow us to redact the IP address on the fly EDIT: although I wonder about the performance implication of this for the "big data" use cases
- JshWright 6y ago> like Athena or EMR Despite being familiar with both of those individually, the combination of the two words side by side switched me into an entirely different context that took several tries to escape from... https://en.wikipedia.org/wiki/Athenahealth https://en.wikipedia.org/wiki/Athenahealth https://en.wikipedia.org/wiki/Electronic_medical_record https://en.wikipedia.org/wiki/Electronic_medical_record
- minaguib 6y agoIf I understand things correctly, the modern way to to read-time masking in the AWS ecosystem is to introduce AWS Lake Formation ( https://aws.amazon.com/lake-formation/ https://aws.amazon.com/lake-formation/ ) as the abstraction layer between Athena and S3.
- cyberdummy 6y agoMy use case would be to transform log files from something like TSV to JSON, but without being able to stream the output seems like the file size is going to be limited to the lambda memory size or the /tmp 512MB.
- orf 6y agoBut you can stream the input and the output?
- cyberdummy 6y agoThanks missed that bit: For larger objects, the WriteGetObjectResponse API supports chunked transfer encoding to implement a streaming data transfer.
- jakozaur 6y agoI wonder how well this could work as performance optimization. When you do some data crunching you can offload some work to lambda. Theoretically, bringing execution closer to data brings more efficiency. Though AWS Lamba was very expensive for CPU intensive steady workload. Few times than using EC2 is some use cases.
- benlwalker 6y agoThey don't actually say that the lambda executes any closer to the data than any other instance. It would make sense for these to operate on the S3 nodes of course, but the description doesn't say one way or the other.
- strogonoff 6y agoIt looks like from within an S3 Object Lambda object handler you can do pretty much everything you can in a regular Lambda, including querying other S3 objects or performing any number of HTTP requests. This opens up some interesting use cases, as well as some extreme footgun scenarios.
- benjaminjackman 6y agoThere is a 60 second limit which seems to be the biggest difference.
- strogonoff 6y agoInteresting, I didn’t spot that. Regular Lambda functions seem to run for up to 15 minutes, so that’s a substantial (and reasonable) limitation.
- jacurtis 6y agoTrue. But the idea is that these functions run in between your server/application requesting the object and AWS returning the object to your server. In other words, they happen synchronously with the object request. So you don't want your server waiting around for 15 minutes on an open request, and most systems won't let you do that anyway (browsers definitely won't). 60 seconds is about as long as you'd want to wait around for your object, and arguably even that is too long. If you need to do some sort of lengthy process to your objects then it should probably be done in some sort of asynchronous queue using a normal Lambda.
- koolba 6y agoIs this how Athena (query files in S3) itself operates internally?
- rafaelturk 6y agoS3 is now Turing Complete
- deleted 6y ago[deleted]
- poundofshrimp 6y agoLambda all the things!
- santiagobasulto 6y agoHow far ahead is AWS in comparison of other Cloud Providers? I only use the basic services (compute, storage, cloud functions, etc). But for people with advance use cases, are GCP and others even comparable?
- jw887c 6y agoGCP is behind. They're are behind in niche services to be fair but behind nonetheless. Nothing that prevents building similar services, but coming from AWS, I routinely feel frustrated by lack of finesse and comparable offerings. IMO, GCP's greatest benefits over AWS are: * BigQuery * Tighter k8s integration with GKE * Single message service (PubSub) Unless BigQuery is your first class citizen, I would avoid GCP.
- nullserver 6y agoGoogle also has a trust problem. As in they lose interest in things quickly. I would only consider them if I need a massive scale of something they are cheaper on, that can quickly be migrated elsewhere.
- granzymes 6y agoThis is such an overblown talking point. If you sign a service contract with Google (which you will if you are spending any amount of serious money), then you will have a precisely defined guarantee that they will continue operating GCloud.
- namdnay 6y agoI doubt anyone’s service contract stipulates that Google will continue to invest heavily to keep feature parity with AWS and Azure for the next 20 years
- nullserver 6y agoBingo. I’ve had to move a companies entire platform multiple times because of similar issues. I want boring on infrastructure.
- benjaminjackman 6y agoTwo questions I had was: 1. is there some way to cache (eg LRU upto a size limit) the results of transformation functions. 2. They mentioned custom header fields as a way for clients to pass along data what about query parameters do those get passed along?
- jrowley 6y agoRe 1) Maybe you could cache with cloud front?
- nickreese 6y agoThere is speculation that Cloudflare will drop durable objects next week. This appears to be AWS trying to get ahead of that.
- napsterbr 6y agoWait, what? Would you have additional context to share regarding this speculation?
- sudhirj 6y agoDurable objects launched ages ago, and they’ve already built COVID vaccination waitlists on it. Different use cases too, Durable Object is for running JS code as a long lived object that resides at an edge close to your user.
- ChicagoDave 6y agoI'm always amused at the vendor lock-in conversations. It's never about technology. It's about cost. If AWS ever priced themselves wildly above Azure or GCP or ___, shit would hit the fan. Outside of that, who cares if you're locked into one cloud or another? Features? Maybe if you're super picky about Power BI or SQL Server? It's never made any sense to me. S3 Lambdas look like a solid addition to AWS.
- cm2187 6y agoYou should talk to someone at Parler.
- lolinder 6y agoParler would not have been saved by being more mobile between clouds, no provider would have them. Only self hosting would have saved them, which is rarely what people are proposing when they talk about vendor lock-in.
- freedomben 6y agoI would have agreed with you a year or two ago, but times are changing. Vendor lock-in isn't just about cost anymore. You're also gambling on ideology that the provider you are locking in to won't decide to terminate your account and destroy your business because they disagree with your philosophy or politics.
- antihero 6y agoIn Parler's case their platform was proudly used to organise illegal activity. Which is against ToS, not ideological. If someone hosted an MP3 piracy site or torrent tracker or carding forum on AWS, it would likely terminated too, regardless of whether Amazon are ideologically against piracy.
- freedomben 6y agoI'm no fan of the content on Parler, but Twitter (who uses AWS) was used for far more organization of illegal activity than Parler was. Twitter wasn't targeted though. I don't think it was ideologically agreement with Twitter (although I'm sure there is much ideological agreement as the tech industry has become quite the echo chamber) as much as Twitter is just far too rich and powerful to be shut down. If you're a big fish with powerfu rich users like Twitter, then vendor lock-in isn't a risk. If you're a small, inconsequential platform that can be smashed like a fly on the window, then you really need to care about such things.
- orasis 6y agoIt looks like there is no support for a custom listObjects result?
- johanneskanybal 6y agoWhat's the difference here from the fairly standard flow of triggering lambdas on s3 object changes?
- Gaelan 6y agoThis looks like it’s triggering a lambda to modify the object returned from a read.
- barbazoo 6y agoThis here happens on the retrieving side so clients can get a different "view" of the data.
- mcintyre1994 6y agoWe use the triggered lambda at work to do image resizing on upload and likely won’t be moving to this. This looks really cool for if you wanted to let clients request at whatever size they want instead of defining them in advance for example - you can resize on the fly. Their watermarking example is clever too IMO. I think it’s basically that this is s3 object + request details -> response, whereas the flow you talk of is just s3 object as input.
- dhbradshaw 6y agoThis could be a fairly clean way to smooth out data schema changes over time. Could also be a way to mess with people -- for example, you could have an image src that gives different results depending on the recipient.
- raverbashing 6y agoThe caveat I would see here is that Lambdas are very limited (memory/disk) so if you're dealing with a big json/xml file you'd need specialized libraries to redact it.
- the_arun 6y agoThis is really cool. Imagine we build non-relational simple read-only APIs powered by s3 with lambda authorizing, filtering, paginating requests? We have another lambda function poplulating s3 for writes.