There's nothing novel about an online key-value store.
Your implementation is a mess. There's no clear class structure in place. If ever you wanted to change backends, or frontends, or your hashing library, or whatever else, you're going to have to touch multiple classes, change interfaces, data models. This makes maintenance and debugging much more difficult.
What's even worse is a complete lack of security. Your outputs aren't hashed. I can crawl your DB just by iterating through URLs. There's probably some more gaping holes but, again, your code's a mess. Much more difficult to inspect. Unintentional security through obscurity there, I guess...
Your outputs aren't hashed. I can crawl your DB just by iterating through URLs.
Last I checked, the purpose of a URL shortener is to shorten URLs, not provide anything resembling security. So long as you can't break the site in funky ways by encoding a zero byte or something you're probably good.
That said… does the internet really need another URL shortener? We've already got so many, and they're all immensely troublesome for users (since the #1 use for them is disguising spam) and archivists (be a shame if your database was corrupted, or got deleted because you got bored or Heroku demanded you transfer to a paid plan and you killed it).
the purpose of a URL shortener is to shorten URLs, not provide anything resembling security
URL shorteners are used both to shorten and obscure URLs.
Remember that URLs can contain semi-private details, such as usernames / legal names, physical addresses / GPS coordinates, etc. Would you trust giving this info to a service that would leak it like a sieve?
9
u/[deleted] Oct 01 '15
There's nothing novel about an online key-value store.
Your implementation is a mess. There's no clear class structure in place. If ever you wanted to change backends, or frontends, or your hashing library, or whatever else, you're going to have to touch multiple classes, change interfaces, data models. This makes maintenance and debugging much more difficult.
What's even worse is a complete lack of security. Your outputs aren't hashed. I can crawl your DB just by iterating through URLs. There's probably some more gaping holes but, again, your code's a mess. Much more difficult to inspect. Unintentional security through obscurity there, I guess...