Search code examples
amazon-s3xquerymarklogic

xquery api to upload data from marklogic to amazon s3


I have a requirement to save files to amazon S3 from my xquery, instead of storing it locally in my marklogic server box (using xdmp:save right now). Is there an xquery api to upload this file to S3 from my xquery?


Solution

  • If you are running MarkLogic on an EC2 instance, then the solution is there already.. S3 is treated like a native filesystem, so using xdmp:save("S3://bucket/..." bla) works. But you need to fill in your credentials in the admin panel.

    Docs are here: https://docs.marklogic.com/guide/ec2/managing#id_98406

    Note that you can even store forests on S3 as well (but not with journalling turned on)