Skip to content

Instantly share code, notes, and snippets.

View rajkundalia's full-sized avatar

Raj Kundalia rajkundalia

View GitHub Profile
+------------+-----------------------+--------------------+---------------------------+----------------------------------+
| Protocol | Model | Transport | Architecture | Key Innovations |
+------------+-----------------------+--------------------+---------------------------+----------------------------------+
| REST | Request-Response | HTTP/1.1 or HTTP/2 | Stateless, resource-based | Standard HTTP verbs |
| gRPC | Unary + Streaming | HTTP/2 | RPC, contract-first | Multiplexing, header compression |
| GraphQL | Flexible Queries | HTTP/1.1 (usually) | Schema-first | Client-driven queries |
| WebSockets | Full-Duplex Streaming | TCP (upgraded) | Connection-oriented | Persistent, bidirectional |
| SOAP | Request-Response | HTTP/1.1, SMTP | Strict XML contract | WS-* standards, WSDL |
+------------+-----------------------+--
BDD (Behavior-Driven Development) TDD (Test-Driven Development) Traditional Development
Focuses on behaviors and outcomes Focuses on code implementation and unit testing Often focuses on features without explicit test criteria
Tests written in natural language Tests written in programming language Testing often done after development
Encourages collaboration between technical and non-technical team members Primarily developer-focused Often has communication gaps between teams
Examples and scenarios describe expected behavior Tests verif
Feature Lambda Architecture Kappa Architecture
Data Ingestion Typically involves landing raw data into a distributed file system (e.g., HDFS, S3) for the batch layer, and a message queue (e.g., Kafka, Kinesis) for the speed layer. Primarily relies on a durable, ordered message queue (e.g., Apache Kafka) as the central point of data ingestion for all data.
Design Philosophy Dual pipeline for batch a
@rajkundalia
rajkundalia / SingleWindowCheckUsingCookie.js
Last active August 17, 2021 10:20
The approach for limiting user to single window using document cookie
/**
* This function checks if multiple tabs for the application are not using the document.cookie.
* The approach here is as follows:
* 1. Fetch the cookies and split it and then fetch the value for the cookie name i.e. tabNumber.
* 2. We check if the cookie is value for tabNumber is > 0, for the first time it won't be and we go to the else part
* where we set the value to be tabNumber=1. The tab would load successfully.
* 3. Now when we open the second tab in the same browser session, the cookie will have tabNumber=1, we extract the value
* and we check if cookieValue > 0 and we show an alert saying second tab was opened.
* 4. The line window.open(window.location, '_self') was added so that we get redirected using the same URL and we don't
* let the user open the tab anyhow (my main requirement).
@rajkundalia
rajkundalia / SingleWindowCheckUsingSessionStorageAndLocalStorage.js
Last active August 18, 2021 06:33
The approach for limiting user to single window using local storage and session storage
function createGUID() {
let guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
let r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
return guid;
}
/**