1

I have seen that it is possible to use S3 as a storage backend for vector tile servers such as Tegola. These work by fetching the tile from S3, then serving it through an application server.

Is there any possible mechanism by which tiles would be fetched directly from S3 in the browser? Having a massively scalable infrastructure like S3 piped through a tiny server seems like a bottleneck to be avoided.

4

It is possible. I recommend you to use Route 53, S3, CloudFront.

  1. Host your domain name on AWS via AWS Route 53 DNS (yourdomain.com) to create a public zone.
  2. Create a SSL Cert for your domain name via AWS ACM
  3. Create a S3 Bucket (yourdomain.com) with the same domain name and enable website hosting.
  4. Use the S3 Bucket Hosted Name to map into your recently created public zone via Route 53 using A Record with "Yes" for alias target with your S3 Bucket hosted name.
  5. Create a AWS CloudFront Distribution (CDN) with SSL support and put in your domain name in CloudFront's Alternative Domain Names (CNAMEs) section.
  6. You can publish using OSM data with XYZ layer (pbf) or using mbutil by mapbox if you have mbtiles to convert into pbf or using tippecanoe from github.
  7. Upload all the contents of the folder structure of the pbf (Example: /0/0/0.pbf).
  8. Ensure you have .pbf and .json has the respective metadata. (.pbf needs to have gzip and application/x-protobuf while .json only has application/json).
  • Thanks for the answer. Is CloudFront and Route 53 really necessary? What roles do they play? – Steve Bennett Dec 2 '18 at 22:57
  • @SteveBennett Route 53 (DNS Control) is necessary when you want it to have a better DNS within AWS env control as the S3 Hosted endpoint works well with it. CloudFront (CDN) is one of the cheapest CDN option to serve out the static files caching and it works well with AWS Route 53 DNS Hosting. Not recommended to have double caching if you are using CloudFlare. – Kyros Koh Dec 3 '18 at 1:45
  • 1
    @SteveBennett I have found a related resources about your question. You may see this github for reference. github.com/addresscloud/serverless-tiles – Kyros Koh Dec 3 '18 at 1:58
  • Wow, that tutorial is perfect. – Steve Bennett Dec 3 '18 at 4:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.