4 ms·
Sketchviz [1] runs almost entirely in free tiers from Cloudflare and AWS: - Cloudflare to avoid big bandwidth bills from AWS for the wasm-compiled graphviz tha
by cldellow 5y ago
Sketchviz [1] runs almost entirely in free tiers from Cloudflare and AWS:
- Cloudflare to avoid big bandwidth bills from AWS for the wasm-compiled graphviz that is on every page
- AWS Lambda's 1M free requests and 400,000 GB-seconds for expressjs (web serving) and graphviz (rendering hostable .png images)
- API Gateway's 1M free requests for routing HTTP -> AWS Lambda (for the app) or S3 (for hosted PNGs)
- S3's 20K GET requests/mo (for hosted PNGs)
The only one I exceed is S3, but it's dirt cheap.
[1]: https://sketchviz.com/new https://sketchviz.com/new
- coopreme 5y agoBravo. Very cool leveraging services this way, I like your idea of architecting to optimize free tier svcs.
- zoover2020 5y agoCool stuff! Inspiring :)
- watermelon0 5y agoNice. I assume you are hosting PNGs for 'get embed code' feature? Could you instead store diagram definition in DynamoDB free tier, and create PNGs on the fly?
- cldellow 5y agoYeah, it's for get embed code. Could definitely have used Dynamo as a persistent layer, but the PNGs are transient - the definition is stored in a GitHub gist owned by the user (another free tier! :). But generating the PNGs is expensive, so they get cached in S3. An S3 lifecycle rule automatically prunes PNGs older than a month, and they'll get regenerated from the gist if needed.
- orf 5y agoA month seems like a long time, I’d have assumed you could probably delete 95% of the images within 3 days. Out of interest is the month long expire rule a guesstimate or something based on actual numbers?
- cldellow 5y agoIt's just a number, I haven't looked at any request logs to see what hit rates are like. From a money perspective, expiring them never would be fine, and a good trade off to get better latency on subsequent loads. However, if the underlying gist is deleted, I'd like the PNG to eventually go away.
- sireat 5y agoSuper cool! Curious does your implementation of DOT support embedding of images? Theoretically it should be possible: http://www.graphviz.org/doc/info/attrs.html#d:image http://www.graphviz.org/doc/info/attrs.html#d:image