Posts

Oauth & Docker

Spring Boot: Dockerization Oauth https://speakerdeck.com/championswimmer/authentication-done-right-consuming-and-serving-oauth2-dot-0?slide=21 Identification -> Identifying the request uniquely(saying I am Venkat) Authentication -> registered identity(Proving with ID card) Authorization -> permission to resources(giving car key to another person) HTTP error 401 -> not authenticated 403 -> authenticated but NOT authorized Authentication via Authorization Services that don't save password. Rather it accepts/saves only phone and sends OTP. Service/app is authorized to read sms/email. Given I am authorized to read sms/email which indirect way of authentication. Single signon First party sso Google sites with google authenticator Third party sso Spotify using google authenticator Oauth  client/apps sends request to github(oauth provider) with client id & request uri oauth provider shows UI to end user to provide login page user authenticates & accepts the authoriz...

Fullstack

 How internet works Internet flows thru optical fiber cable (not thru satellites) cables are layed across seas In India most of cables are layed by TATA Why optical fiber cost is cheap what happens when you hit any site like www.scaler.com Browser contacts isp for DNS lookup to get ip address types of cache for lookup browser os router isp -> arranged as tree Look for DNS Do recursive search for website .com scaler.com www.scaler.com Resolution of DNS & get ip address(Name server is the server that has the ip address value for the website) nslookup scaler.com named server returns the ipaddress for the sitename Browser will do tcp/ip connection with server 3 way handshake client sends SYN packet to server SYN/ACK packet back to client send back ACK to server named server returns the ipaddress for the sitename When you register on Amazon route53, it provides a set of named servers. Those 4 named servers that you register across your domain.  Flow Domain(scaler.com) is map...

Backend

Backend: Git and Github - 1  Version Control System Track different changes made to files Revert to previous version Distributed Version Control System Multiple instance of system A type of version control where the complete codebase - including its full version history - is mirrored on every developers computer. Git Open Source  Distributed VCS GitHub online tool where repositories are hosted Commands git init create .git directory It has HEAD, description, info, refs, config, hooks, objects directories .archive has historical changes refs have pointers to different stages of system git add git status git commit git log Pointers 2 types  Main -> Pointer to Base and always stays at Base. It is base as well as pointer. Head -> Points to latest change made - Current snapshot HEAD points to latest change in the branch Backend: Git and Github - 2 Encode Standard algorithm to Translate from one format to another.  No key publicly reversable eg: base64, UTF-8 En...

High Level Design

 HLD Basics & Consistent Hashing Technologies keep changing. What matters is building the intuition what systems fit best. How architecture works.  LLD is about how to structure code HLD is about how to structure components, machines & what are those machines doing.  Both LLD & HLD combine system design del.icio.us(built during 2005/06) -> acquired by Yahoo at later point ICANN -> non profit central authority that manages domain names GoDaddy or domains.google.com -> resellers who sell on behalf of ICANN to get domain name to ip mappings ISPs(airtel, jeo, google, cloudflare(CDN), .. ) maintains DNS server with copy from ICANN for faster internet speed DNS propagation takes 24 hours to sync across the world ISP One can connect to internet only via ISP(Internet service provider) Every isp has range of ip addresses allocated to them.  ISP picks one available ip address in the range and allocate to system One has option to ask for static IP address b...

Low Level Designs

Introduction to OOP & LLD High level Design HLD Deals with different infrastructure layers that are going to work together for efficient working of a system. Load balancer, appln servers, DB, Cache Low Level Design(Object oriented design) Deals with details/implementation of software/code that is running A research says that an software engineer only spends 12% of time doing coding. Other 88% goes in other productive things like meetings, reviews, testing, automation. LLD helps make better use of 88% of time LLD includes Readable & understandable Requirement gathering Extensible system -> easy to add new features Maintainable system -> Easy to keep current system(w/o new requirements) working. Bugs/updates/3rd party library changes, Programmatic Paradigm Procedural -> C Set of instructions(Function),  Action is performed on Entities(in real world Entities perform action) Any procedure can play around with entity attributes Object Oriented -> Java, Python, JS, c#...