Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4688

zstd automatic platform detection is an obstacle to bundling dependencies for aws lambda

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Not Needed

      How are you using Mongo? What version of the server and driver are you using?

      Using the latest Node.js Driver with zstd network compression is difficult when you are uploading zip files to AWS Lambda that bundles all dependencies. Locally npm will install the operating system version I'm depending on, but lambda will need a specific linux version.

      This would similarly impact Snappy, and CSFLE. However, CSFLE does not have the install platform specific version workaround.

      What is the feature/improvement you would like?

      We should have some documentation/tutorial on how users could manually specify the linux version so that both are installed and the ZSTD package's import logic will figure out the correct one to import depending on the platform.

      Manually adding an incompatible module isn't possible npm throws on install (See comment).

      Using force install can get both versions downloaded from npm but then every subsequent npm command will fail without the force flag.

      npm install --force @mongodb-js/zstd-linux-x64-gnu @mongodb-js/zstd
      

      We can consider bundling the native dependencies.

      What use case would this feature/improvement enable?

      AWS Lambda + native dependencies.

            Assignee:
            Unassigned Unassigned
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: