I’m looking for a scalable solution for my users to upload some static files that I would host for them.
I’m thinking one s3 bucket with a ‘folder’ per customer. and then creating a CF distribution for every customer so they would all get a different domain.
I see AWS has an increasable quota of 200 distributions, but im worried it could be a bad design to create a distribution for each of them once I reach 10000 distributions
Thanks for the response, if I go with a single CF, I need to add a CNAME for every customer (aws seems to have a limit of 100 cname per CF) or is there an other way?
I can’t go for a url based redirect, because they would have to share localstorage
indeed it does not I liked the thought experiment of OP.
btw /u/gautier_ if you have paid suport, can you ask them your use case ? I’d be curious to know if your use case could genuinely allow you to have, say, a soft limit upgraded in the multiple thousands or not
I’m not expert on CF, I didn’t know you could have wildcard subdomain in CNAME !
so if I can use 10k subdomains on the same CF and redirect to different folder on s3 based on the domain that would work !
Thanks /u/SnooBooks7891 and /u/digitizemd I’ll try this
Wildcard is one way to go. Most places doing what you’re doing will instead have a media.companyname.tld (or static, or images or whatever in place of media) type domain though, because juggling CNAMES etc ultimately turns into a whole ton of tech debt and extra things you have to monitor.
np. I think it’s a pretty common pattern to have a setup like with a public ALB fronting an nginx cluster who will use the subdomain of the $host to create headers for downstream applications behind private ALBs to make use of.
My company have several thousands Cloudfront instances, 1 per domain name (not subdomain but really different domains), use case is for a SaaS where customers can connect their own domains.
It was not an issue for aws to raise the limit to 10k
We also create one CloudFront distribution per domain/subdomain. We made the mistake early on to put multiple domains on the same distribution, but then we couldn’t customize behaviors per domain and the metrics weren’t separated by domains.