Posts

kafka

  ✅ spring.kafka.bootstrap-servers=localhost:9092 🧠 Meaning: The address of the Kafka broker (the server that stores and processes messages). ✅ Why: This tells Spring Boot where to send/receive Kafka messages. 🛠 If you’re running Kafka locally, use localhost:9092 . In production, you may have multiple brokers: kafka1:9092,kafka2:9092,... ✅ spring.kafka.consumer.group-id=my-group 🧠 Meaning: Assigns the consumer group ID to your consumer. ✅ Why: Kafka uses this to track which consumer read which message. If two consumers share the same group ID, Kafka will load-balance messages between them. 🔄 Helps in parallel processing and message tracking ✅ spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer ✅ spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer 🧠 Meaning: Kafka sends binary data . These settings tell Kafka how to convert data back into Java strings (deserialize). ✅ W...

Shorten URL

  let’s design URL Shortener for interview prep, fully in HLD notes format (no code), starting from functional requirements → non-functional requirements → API endpoints → design approach → components → data model → scaling strategy . I’ll make it structured so you can directly speak this in an interview . 1️⃣ Problem Statement Design a service like Bitly that converts long URLs into short, unique aliases and redirects when someone accesses the short link. 2️⃣ Functional Requirements Must-have Shorten URL User provides a long URL, system returns a unique short URL. Redirect Accessing a short URL should redirect to the original long URL. Analytics (Basic) Count number of times the short URL is used (click count). Custom Alias (Optional) Users can provide their own alias if available. Good-to-have Expiration date for short links. Support for user accounts and history of their created links. 3️⃣ Non-Functional Requirements Scalab...