项目作者: kunwar97

项目描述 :
URL Shortener Service (TypeORM + MongoDB)
高级语言: TypeScript
项目地址: git://github.com/kunwar97/url-shortener-backend.git
创建时间: 2021-06-13T16:37:22Z
项目社区:https://github.com/kunwar97/url-shortener-backend

开源协议:

下载


URL Shortening Service (TypeORM + MongoDB)

Prerequisites:

  • Install memcached Ubuntu: apt-get install memcached or MacOS: brew install memcached.
  • Install MongoDB using this link.
  • Install Node.js v12+ using this link

Steps to run this project:

  1. Run npm i command to install the dependencies.
  2. Create .env by copying or renaming .env.example.
  3. Replace variables in .env from local variables.
  4. Run npm run debug command to start the server.

System Architecture

alt System Architecture

  • Using memcached for LRU Caching.
  • Generating short url by hashing using MD5 & then encoding it to base64.
  • Can generate 64^8 = ~281 trillion possible strings without collision.

Improvements for Future

  • Load Balancing
  • Distributing Data across regions
  • Missing User APIs
  • Improved analytics

Postman