Keep It Simple: Building a Scalable URL Shortener with Kutt and Nano ID

Поделиться
HTML-код
  • Опубликовано: 10 окт 2024
  • НаукаНаука

Комментарии • 2

  • @randomtutorials9628
    @randomtutorials9628 Год назад

    Couple of questions: 1. What is this 302 response code ? 2. Indexing will make the write operations slower , if you are already using a cache , does it make sense to index ?

    • @anubhav_shrivastava
      @anubhav_shrivastava  Год назад

      1. 302 Http response code is a result code for redirection. The server returns the result code along with redirection url. Then the browser redirects the page to the redirection url. You can read more about it here: developer.mozilla.org/en-US/docs/Web/HTTP/Status. Bonus: checkout difference between 301 and 302 result code. Both can be used for redirection but with slightly different use case,.
      2. Although indexing might make the write operation a bit slow, but it makes the query operation very fast. That diff while insertion is very minimal unless you index too many columns. Generally you would have lesser data in cache and majority data in db. So, you would still want the database to be fast while querying.