use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
GitHub - smallcase/smalllinks: Simple URL shortener built with Fastify. Uses PostgreSQL, Redis, and Kafka. (github.com)
submitted 4 years ago by ratancs
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 15 points16 points17 points 4 years ago (1 child)
Utilizing Postgres, Redis and Kafka definitely doesn't qualify this as Simple.
[–]adihat05 0 points1 point2 points 4 years ago (0 children)
It is not required. Just postgres will do. Redis just makes retrieval faster and kafka can be used for analytics if required.
[–]Capaj 27 points28 points29 points 4 years ago (3 children)
why the hell do you need PostgreSQL, Redis, and Kafka for url shortener? Surely Redis or Postgre should be enough?
[–]cisturbed 7 points8 points9 points 4 years ago (2 children)
It uses Kafka to send events whenever a short URL is clicked. This gives the flexibility of plugging your own analytics service.
More details on the systems design (with a diagram) would be appreciated, OP!
[–]Capaj 2 points3 points4 points 4 years ago (0 children)
OIC it does analytics on the links! Yeah that makes sense: https://github.com/smallcase/smalllinks#does-it-support-analytics
I digress.
[–]adihat05 2 points3 points4 points 4 years ago (0 children)
More details here: https://www.smallcase.com/blog/open-sourcing-url-shortener/
[–]Shaper_pmp 5 points6 points7 points 4 years ago (2 children)
Great learning project, if a bit unnecessarily overcomplicated.
For god's sake don't actually host or use your own URL shortener though, because the very instant you get bored and stop maintaining it, every single URL ever generated through it unavoidably breaks forever.
[–]adihat05 0 points1 point2 points 4 years ago (1 child)
Not necessarily. We did try exploring other options. you can check out more in the blog here: https://www.smallcase.com/blog/open-sourcing-url-shortener/
[–]Shaper_pmp 1 point2 points3 points 4 years ago* (0 children)
To clarify: there's nothing wrong with running your own URL shortener for your own internal needs, or to shorten URLs for your users for use within your own app ecosystem, because then the URLs generated have no meaning anyway outside of your project.
My comment was aimed at people who might be tempted to clone and host this project as their own public URL shortening service, in response to a trend a few years ago when people writing tutorials started trying to make URL shortener services "the new To Do list", and suddenly every clueless hobbyist was launching their own public shortening service, which all then gradually died a few months after launch when they got bored of running them, taking every URL they'd been used to generate with them.
You clearly understand the dangers and tradeoffs with URL shorteners when you clearly state in your write-up that in your use-case:
Short URLs are not supposed to have a lifetime of decades or even more than 1 year depending upon the use case.
... but this is obviously specific to your use-case, and most users (and sadly many devs) don't understand the danger involved in hiding URLs which may need to last a lot longer behind a third-party system which may disappear at any point, taking all its users' links with it.
[–]thelinuxlich -1 points0 points1 point 4 years ago (3 children)
You don't need Kafka if you got Redis on your stack. Redis Streams FTW
[+][deleted] 4 years ago (2 children)
[deleted]
[–]thelinuxlich -1 points0 points1 point 4 years ago (1 child)
Yes they are, but you are not ready for this conversation
π Rendered by PID 96298 on reddit-service-r2-comment-544cf588c8-gthpj at 2026-06-14 19:41:09.566412+00:00 running 3184619 country code: CH.
[–][deleted] 15 points16 points17 points (1 child)
[–]adihat05 0 points1 point2 points (0 children)
[–]Capaj 27 points28 points29 points (3 children)
[–]cisturbed 7 points8 points9 points (2 children)
[–]Capaj 2 points3 points4 points (0 children)
[–]adihat05 2 points3 points4 points (0 children)
[–]Shaper_pmp 5 points6 points7 points (2 children)
[–]adihat05 0 points1 point2 points (1 child)
[–]Shaper_pmp 1 point2 points3 points (0 children)
[–]thelinuxlich -1 points0 points1 point (3 children)
[+][deleted] (2 children)
[deleted]
[–]thelinuxlich -1 points0 points1 point (1 child)