Git Product home page Git Product logo

Comments (3)

sonmezonur avatar sonmezonur commented on May 18, 2024

Seems like we cannot use s3manager.BatchDelete for this release.

There are two different approaches to use s3manager.BatchDelete API.

  1. Create paginator and use this paginator on delete operations.
  input := &s3.ListObjectsInput{
    Bucket:  aws.String("bucket"),
    Prefix: aws.String("prefix")
  }
  iter := s3manager.NewDeleteListIterator(svc, input)

This is fast but will not work since it removes the list result directly. We also need to remove keys that match with wildcard strings (not whole listing result). As an alternative, maybe we can write custom paginator (since it is an interface) and use this paginator on batch delete operations. But this does not reduce the complexity (I prefer our current architecture).

  1. Give the list of objects to DeleteObjectsIterator and use this iterator on delete operations.
batcher.Delete(ctx, &s3manager.DeleteObjectsIterator{Objects: objects})

This is super easy and clean but slow. It won't perform well since it is required to list and collect all objects first and pass collected objects to DeleteObjectsIterator. Currently, we don't block during S3 pagination (listing). We are directly sending these keys into the URL channel and it works asynchronously.

That is why I am proposing to close this issue and remove from this milestone :)

@igungor What do you think? You can close the issue if you agree.

from s5cmd.

igungor avatar igungor commented on May 18, 2024

Thank you Onur.

Not a blocker. Let's keep the issue open for a while.

from s5cmd.

igungor avatar igungor commented on May 18, 2024

s3manager.BatchDelete does not provide any improvement over our solution.

from s5cmd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.