Building an AI-Powered Operations Assistant with Spring AI and MongoDB Atlas — Part 1: RAG Foundation
Table of Contents The problemWhat we are buildingWhy RAG and why MongoDB AtlasHow the Pieces Fit TogetherGetting the Project RunningThe Ingestion PipelineThe Retrieval PipelineThe Atlas Vector Search IndexTrying It OutConclusion and What’s Next This is the first article in a ...
-
When Should You Use a Cache With MongoDB?
Table of Contents Why were caches like Memcached & Redis invented, and why do they thrive?So, what’s wrong with having a caching tier?What’s different with MongoDB?What does AI think?SummaryLearn more about MongoDB design reviews From time to time, I’ll run …
-
Large-Scale ETL Pipeline Architecture
Table of Contents Rethinking ETL for modern systemsArchitectural building blocksEmbracing concurrency with reactive pipelinesBackpressure: the hidden heroDesigning for failure: error handling strategiesRetry and recovery patternsIdempotency: the cornerstone of safe retriesBatching vs streamingParallelizing transformationsIntegrating with messaging systemsObservability and monitoringPutting it all …
-
Building a Personalized Content Delivery System
Table of Contents Prerequisites1. Data model2. Project setup3. Building the content-based recommendation engineUserProfileControllerGameRepositoryRecommendationService core logicRecommendationControllerManual test4. User ratings and affinity adjustmentRatings endpointAffinity adjustment logicMongoDB updateBefore and after demo5. Adding Spring AI embeddings and MongoDB Atlas Vector SearchSpring AI setupGenerating embeddingsDataSeeder …
-
Distributed Cache Invalidation Patterns
Table of Contents Why Cache Invalidation Becomes Hard in Distributed SystemsTime-Based Expiration (TTL)The Cache-Aside PatternEvent-Based Cache InvalidationVersioned Cache KeysMulti-Layer CachingEvent-Driven Cache RebuildsChoosing the Right StrategyFinal Thoughts Caching is one of the most powerful tools developers have at their disposal for …
-
CQRS in Java: Separating Reads and Writes Cleanly
Table of Contents What you’ll learnThe Spring standard repositoryCreating separate repositories for the read and writeThe read RepositoryThe write repositoryWhen requirements changeThe double-edged sword of Spring updates in MongoDBIncreased network trafficOplog bloat and replacing documentsConclusionFurther reading What you’ll learn The …
-
Building a Kotlin App with Spring Boot and MongoDB Search
Table of Contents DemonstrationPre-requisitesWhat is MongoDB Search?Load sample datasetCreating the MongoDB Search indexTesting our index in MongoDB CompassBuilding a Kotlin applicationCreating the projectAdding MongoDB driver dependencyEstablishing a connectionCreating the repositoryCreating a serviceCreating a controllerFinal application structureApplication structureRunning the applicationConclusion One …
-
Building Distributed HTTP Sessions with Spring Session MongoDB
Table of Contents PrerequisitesProject DependenciesSpring WebSpring Data MongoDBMongoDB Spring SessionApplication ConfigurationBootstrapping the ApplicationEnabling MongoDB HTTP SessionsBuilding the Theme APIRunning the ApplicationTesting Session Behavior with curlReusing the SessionInspecting the Session in MongoDBWhy This MattersConclusion Spring Session MongoDB is a library that …
-
Java Faceted Full-Text Search API Using MongoDB Atlas Search
Table of Contents Let’s build!Prerequisites1. Project setup2. COCO dataData modelRunning MongoDB AtlasData ingest into MongoDB AtlasCreating an Atlas Search indexExample search3. Java service implementation4. Java searchPagingFilter clausesFacetsSearch(Optional) Refactoring to a better structureWrapping up This is going to be a fun, …
-
MongoDB Search Score Breakdown
Table of Contents Relevancy riddleScore detailsLucene insideLucene indexingLucene scoringBest matchesBreaking down the score detailsPretty printing the score detailsMystery solved!Compound is kingBoosting clausesRelevancy tuning: a delicate balance Full-text search powers all of our digital lives — googling for this and that; …
-
Modeling One-to-Many Relationships in Java with MongoDB
Table of Contents What You’ll LearnPrerequisitesProject SetupConfiguring the MongoClient with POJO SupportWhat Is a One-to-Many Relationship in Java?How Does MongoDB Store Documents Differently Than a Relational Database?Pattern 1: Embedded DocumentsWhen Should You Embed?Modeling Embedded Documents in JavaInserting and Querying Embedded …