top of page


Tutorials, Errors and Exceptions
Its a journey to understand things better. It will have tutorials, any error/exceptions encountered, its resolutions and lots of learning.

Search


Building DevOps Intelligence using MCP Server with Spring AI: Tools, Challenges & Solutions
Devops Intelligence Today, I successfully built and deployed a Model Context Protocol (MCP) server using Spring AI that exposes real DevOps infrastructure through intelligent tools. But the journey? Let's just say it involved more debugging than coding. In this post, I'll walk you through: What we built (the DevOps Intelligence Platform) The tools we created (K8s, Prometheus, Logs, Deployments) Every challenge we faced (and how we solved them) Why Spring AI 2.0.0-M2 is the s
Ankit Agrahari
Mar 147 min read
Β
Β
Β


From Localhost to Kubernetes: Deploying StreamMetrics at Scale
Part 4 of the StreamMetrics Series Previous parts: Part 1: Kafka Producer | Part 2: Consumer + DLQ | Part 3: Real-Time Aggregations Streammetric Bottleneck Explainer by NotebookLM Love how after building something locally, you think " okay, it works on my machine! " and then reality hits when you try to deploy it. Docker says " works on my machine " is not an excuse anymore, and Kubernetes says " hold my beer, let's make it production-ready. " This is the tale of taking Str
Ankit Agrahari
Mar 28 min read
Β
Β
Β


Real-Time Aggregations with Kafka Streams at 10K Events/Sec
Part 3 of the StreamMetrics Series Previous parts: Part 1: Kafka Producer | Part 2: Consumer + DLQ | Part 4: From Localhost to Kubernetes Building production-grade streaming analytics: windows, state stores, and performance validation Overview In Parts 1 and 2, we built a Kafka producer and consumer that process individual events reliably. But processing 10,000 raw events per second creates a new problem: How do you extract insights from that fire hose of data? Enter Kafka
Ankit Agrahari
Feb 217 min read
Β
Β
Β


Building Production-Grade Apache Kafka Consumer Patterns
Part 2 of the StreamMetrics Series Previous parts: Part 1: Kafka Producer | Part 3: Real-time Aggregation | Part 4: From Localhost to Kubernetes A deep-dive into manual offset management, dead letter queues, and observability with Spring Boot + Apache Kafka. This is part 2 of the series Stream Metrics application. In Part 1 we built the producer, today we add the consumer. Why This Matters Most tutorials show you how to build a Kafka consumer. They show you @KafkaListener
Ankit Agrahari
Feb 186 min read
Β
Β
Β


Building a Production Kafka Producer
Part 1 of the StreamMetrics Series Previous parts: Part 2: Consumer + DLQ | Part 3: Real-Time Aggregations | Part 4: From Localhost to Kubernetes Love how it rhymes "Production Kafka Producer". Here's to coding in an era of AI Agents. They suggest and are confident that this time it will work, but then this cluster has its own plan, and it starts misbehaving -- sometimes listens, and on others, feels cornered by his other siblings. This is the Tale of making the brothers
Ankit Agrahari
Feb 166 min read
Β
Β
Β


Reactive Programming in Java with Spring (AI Generated)
Generative AI Harnessing the power of reactive programming in Java opens up endless opportunities for crafting responsive, resilient...
Ankit Agrahari
May 9, 20253 min read
Β
Β
Β


Β
Β
Β


Aspect Programming in Spring - Logging
Spring provides a simple and powerful way of writing custom wrappers function which can be executed around a range of methods....
Ankit Agrahari
Oct 27, 20235 min read
Β
Β
Β


Externalize Spring Boot Configuration
In this post, we will discuss on fetching the Spring boot configuration values from outside the application jar file. We will discuss on...
Ankit Agrahari
Sep 20, 20224 min read
Β
Β
Β


Reactive Programming in Java
In this post, we will try to understand the basics of the Reactive programming, what are the core features of it and how to handle the...
Ankit Agrahari
Sep 11, 20223 min read
Β
Β
Β


Dynamic Scheduling any REST API's
Spring boot provides an easy option of scheduling tasks which will be triggered when the interval or time is right. We can use the...
Ankit Agrahari
Jul 19, 20224 min read
Β
Β
Β


Spring Boot Application External Configurations
Spring boot application provides a quick and elegant way to create REST API's with minimal boiler plate code and resolves any dependency...
Ankit Agrahari
May 29, 20225 min read
Β
Β
Β


Junit5 with Mockito Framework
In this blog post we will talk about one of the testing framework which I wanted to try it on, and rather use it in my day to day coding....
Ankit Agrahari
Apr 18, 20227 min read
Β
Β
Β


Spring4Shell - Zero Day Vulnerability in Spring Framework
In the days of Vulnerabilities, the famous Spring framework is the latest victim, which has quite a turns of event for the CVE identified...
Ankit Agrahari
Apr 1, 20223 min read
Β
Β
Β


Spring Data JPA with MongoDB
In this post we will create a simple Spring JPA project which will connect to MongoDB and create a document, where we will save records...
Ankit Agrahari
Dec 3, 20213 min read
Β
Β
Β


Testing in Microservices
In this post we will go through the integration testing of the controller of any Spring Boot project. We will be using an existing Spring...
Ankit Agrahari
Dec 1, 20213 min read
Β
Β
Β


Exploring Spring Thymeleaf
In this post we will be creating a registration form which will include textbox, dropdown with multi-select option, file pickers and then...
Ankit Agrahari
Nov 17, 20216 min read
Β
Β
Β


Authentication With LDAP in Spring
Referring to the Spring Guide to Spring security for authenticating a user with LDAP, this blog is to create the working example for...
Ankit Agrahari
Nov 12, 20212 min read
Β
Β
Β


Produce & Consume Messages Using Apache Kafka
In this post, we will create a Kafka producer which will produce string messages as Rest call and a consumer which will consume the...
Ankit Agrahari
Nov 12, 20214 min read
Β
Β
Β
Contact
bottom of page



![If this shifted how you think about AI β
you're ready to Harness it. π₯
π¬ Comment "HARNESS" below
β I'll DM you the open-source agent template
π Save this carousel β refer back when you build
π€ Share with one engineer who's still copy-pasting
Follow @backendbrilliance for more content on
AI agents, Spring Boot architecture & backend systems
that actually scale.
#AIHarnessing #BackendBrilliance #JavaDeveloper
#SpringBoot #SpringAI
[AIAgents SystemDesign BackendEngineering SoftwareDevelopment LLMOps]](https://scontent-den2-1.cdninstagram.com/v/t51.71878-15/729219604_894359219640315_5276418046541229917_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=102&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=ZArsYJt35hwQ7kNvwFcOy-u&_nc_oc=AdqeYCcI-GaJXKWw04ZCBsYHZQhZW7nOcJBNQgwbNyoGIMPUziUUrTq7MoAx7tYKnHo&_nc_zt=23&_nc_ht=scontent-den2-1.cdninstagram.com&edm=ANo9K5cEAAAA&_nc_gid=OTqBRic6nDRu1ls242dWwQ&_nc_tpa=Q5bMBQGLZDpS2pst43r-qKowJU8HG1nxgVFnXd-hMOk5ryglctEg4qvU3HpXnRjB2A7dGxqmv-9GKk_Z&oh=00_AQD8XR7XpFE7teK3GQx07BX88nkd_NHSyEVTd1OLM2jV3g&oe=6A5CEF6F)























![You think HashMap is always O(1).
It isn't. Here's what actually happens. π§΅
HashMap stores pairs using `index = hash(key) % capacity` β direct slot access, no scanning. Pure O(1). Until two keys land on the same slot. That's a collision β not a bug, a math inevitability.
Two ways to fix it π
π Chaining β each bucket holds a linked list. Collisions append to the list. Simple, handles high load, easy deletion. Downside: pointer overhead, poor cache performance, chains degrade to O(n) at high load. Java's fix? At 8 nodes, the list auto-converts to a Red-Black Tree β O(log n) worst case.
π¦ Open Addressing β no linked lists. Collision at slot X? Probe X+1, X+2 until empty. Cache-friendly, zero memory overhead. Downside: deletion needs tombstone markers, and keys cluster together making future collisions worse. Used by C++, Go, Redis.
βοΈ Load Factor = entries Γ· capacity
π’ Below 0.5 β rare collisions, wasted memory
π 0.75 β Java's sweet spot, triggers resize + rehash
π΄ Above 0.9 β collision cascade, O(n) territory
Double hashing kills clustering by varying the probe step per key:
`probe(i) = (h1 + i Γ h2) % m`
Elements scatter evenly. No bunching. O(1) preserved.
The truth: HashMap is O(1) until a bad hash function, wrong load factor, or wrong strategy turns it into O(n).
Three things protect you:
β Well-distributed hash function
β Load factor under 0.75
β Right collision strategy for your use case
π¬ Java interview question: what happens when a chain hits 8 nodes?
Drop your answer below π
π Save this before your next interview.
#java #hashmap #datastructures #dsa #algorithms
[codinginterview programming 100daysofcode]](https://scontent-den2-1.cdninstagram.com/v/t51.71878-15/641188820_1859196944673752_5535080284006983284_n.jpg?stp=dst-jpg_e35_tt6&_nc_cat=102&ccb=7-5&_nc_sid=18de74&efg=eyJlZmdfdGFnIjoiQ0xJUFMuYmVzdF9pbWFnZV91cmxnZW4uQzMifQ%3D%3D&_nc_ohc=ffhGGgNASMAQ7kNvwHeiwde&_nc_oc=Ado88o-Ya6YyKCCTVtQu88zVJxhVSHeLoPUxC2e9wrBUshN5vhD3qkrED_tXqPxZ1oQ&_nc_zt=23&_nc_ht=scontent-den2-1.cdninstagram.com&edm=ANo9K5cEAAAA&_nc_gid=OTqBRic6nDRu1ls242dWwQ&_nc_tpa=Q5bMBQEBZ-OTcGQeve_k4pVSxSi53KOKl1lGTj_am3GNDyayW-EU4tzCk_hHcOUzAKGVJtFFHXdH6dA9&oh=00_AQAHoydmSJ008McxkHmjwzubOZMKWJ2qv8LkSnGlsm4wLg&oe=6A5CE3BE)


