-
Caching: Stale while Revalidate
Caching strategy, I tried to understand Situation/context: I got to know about a situation called cache stampede. In this scenario, a lot of requests when misses the cache and all of them hits the DB to get the data. I got to know about polling locks and stale while revalidate to mitigate this issue. How…
-
FastAPI Backend: Part 4 (Authentication)
Logs for implementing authentication what I want: Login: So for login, we need to make: Auth Route: Description: Auth Service: Description: Security Utils: Description: Auth DB Handler: Description: Auth Guard: Description: Refresh Token Guard: Description: This finishes our authentication. I will be implementing RBAC after this in the next article.
-
Flexible Products List and Quick View Modal Components Group
context: I was making an ecommerce app in React. I should have made in Next or similar tech, as it would be easier for SEO and other things, but I have chosen React as of now. So, it has a search page, where all the products would be listed, along with it is filters and…
-
Fastapi Backend: Part 2 (DB layer)
Database Layer In this post, we will be building the database layer, which can be used to connect the database for querying. Requirements: environment Variable Need to add the DB url in .env file so that I can access the url and provide to SQLAlchemy to connect the app to DB. I am using asyncpg…
-
Fastapi Backend: Part 1 (Routing Layer)
This is a log of my fastapi backend development. Requirements: basics: route/controller layer: I wanted to make versioning of routes like api/v1/books and extend to as many version I want so that my results can change as per the version if I want to upgrade or my data/requirements hets changed in future. I might use…
-
Flexible Storage Providers in Nest.js
Implementing file upload service Requirement: I needed a generic file uploader service which have the following functionalities: Also, I might change the service provider later. Currently, I wanted to use ImageKit but later I might change to dropbox or aws s3 or onedrive, etc. But, I want minimal changes in my code with a single…
-
Golang Basics
Its just the basics, where I have summed up the syntaxes for writing golang You atleast should know some programming basics to understand this. It is for my journal, as I would approach myself to learn golang. I have worked in javascript and trying out golang for my learning. And this is how I learn…