by yzmtf2008 · 8y ago · 0 comments
You can build your own private URL shortener with AWS Lambda, for a dozen cents a month [0]. I've made some modification to it so that it supports customized short name, but the changes are trivial to implement. You could (should?) also probably consider a short domain name to pair with it, but those are also cheap ($10/yr, perhaps depend on the TLD).
[0]: https://aws.amazon.com/blogs/compute/build-a-serverless-priv...
With Google Or Twitter, at least, they have some semblance of permanence, but with everyone hosting their own private shortener, will just lead to madness.
[0]: https://blog.codinghorror.com/url-shorteners-destroying-the-...
What's another level of indirection between the browser and your CDN, your reverse proxy, your cache and your web framework?
1) User clicking on a URL: the latency of this action is mostly determined by the latency of cloudfront, which is pretty fast [1]. (Except in the case of a first-click when cloudfront has to do a pull from S3, which is also not bad [1])
2) Creation of a new short URL: this action is the execution of a lambda function, which in my experience is ~1s in cold-start scenarios, and near instant otherwise.
[0]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-...
[1]: https://www.quora.com/What-are-typical-latencies-for-static-...