Usually I store my images using the database, like so:
I'm trying to find a way to use external URLS as an alternative, to make my app more efficient by using a decentralized cloud called StorJ(similar to Google Drive).
The idea behind this is to reduce the load on my personal environment and simulate CDN(since it's a decentralized cloud) and learn an alternative way to store images instead of using the database provided by outsystems.
You can get an idea of what I want to do with the banners:Upload, display for a period of time, schedule them.How can I do so, using StorJ, or GDrive even?
The images can always be accessed by linkshare how ever I would need to upload them manually in the cloud before having this URL.Any idea?
Hi, just read thru the storj documentation. The region you provided is the storj region endpoint for their s3 gateway api. The region is another configuration
Please not that u cannot use the official AWS S3 component from Forge to connect to different Endpoints. The OutSystems S3 connector simply does not allow you to configure it (while the SDK is supporting it, the OutSystems Platform team did not add it to the component).
You either have to create your own connector with AWS SDK or use an equivalent c# library for storj (i havent noticed one, but did not look around).
I also read that storj has some sort of a CDN itself (not sure). So no need to add it as an origin to e.g. cloudfront.
Hi @Pedro de Sousa, please look at this YouTube video on
How to use Google Drive API to upload, delete and create a public URL for a file.ThanksGitansh Anand
Hello, I did some reading after watching the suggested video. This Google Drive API, you are suggesting this because google cloud CDN is paid right? Only reason I could think of since they do offer the service themselves.Well to implement this in OutSystems seems to be tricky, I know nothing of js :|
Hi,
i have written an article on medium on how to serve files using s3 and cloudfront. https://medium.com/itnext/serve-files-at-scale-with-outsystems-and-aws-s3-and-cloudfront-6f0b11a37866
Another one on direct uploading files to s3 here https://medium.com/itnext/file-uploads-from-outsystems-reactive-web-client-to-aws-s3-using-pre-signed-urls-18e9a42dee17
You may find those helpful.
Best
Stefan
I have to read more about AWS S3 CloudFront. Apparently it does what I'm looking for as it IS CDN and it's included in the always free tier.So I presume there is no option to use StorJ as an alternative? If I wanted to use that for an instance?
Sure. You can go with any cloud storage provider. If you do not need to secure your content - as described in my article - it is actual easier as you just need to make sure that your storage is public and you set a proper cross origin policy.
Spent some time this weekend trying to make this work. I had to read more about Cloudfront as it's a new concept for me.
I modified my SaveDetail to upload an image to my Storj Bucket as my first attempt and I'm having trouble getting past the Amazon Simple Storage component as I get this error:
I've placed this endpoint as it was handed to me by Storj when creading S3 credentials and after reading their documentation it states:"Regions and Points of Presence
We currently have hosted Gateways in several regional locations and expect to expand as needed. The Gateway endpoint https://gateway.storjshare.io is configured to automatically route the traffic from the instance closest to your location."So this should work, unless I've missed something?
Update:I now realize I've missed on an important step: Cloudfront.Had to have a better look into what Cloudfront is and what origins are:https://www.youtube.com/watch?v=2LPVCiN9Izk&ab_channel=CloudemyTVAlso if we can use non-amazon origin servers:https://aws.amazon.com/cloudfront/faqs/#:~:text=Does%20Amazon%20CloudFront%20work%20with,to%20use%20a%20custom%20origin.Amazon S3 Storage, the origin is free for 12 months, 5GB limit:https://aws.amazon.com/s3/reduced-redundancy/A comparison between Amazon S3 and Storj DCS:https://www.taloflow.ai/compare/aws-s3-vs-storj-dcsSo I decided to follow your guide every step, this time without using Storj to better understand these concepts surrounding CDN first :)
Hello Stefan. I tried what you wrote and it works, all using AWS. Storj, not possible without a connector sadly. Sorry for the delay. It took me a long while to get back to this topic!