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 …
-
Clean Architecture with Spring Boot and MongoDB
Table of Contents Prerequisites1. What is Clean Architecture?2. Project structure3. Building the domain layer4. Building the application layer5. Building the MongoDB adapter6. Wiring everything with Spring BootConclusion Most Spring Boot tutorials tightly wire everything together. Controllers call services, services call …
-
Building Reactive Data Streams with Project Reactor
Table of Contents Creating Non-Blocking Streaming Endpoints for High-Throughput ApplicationsFrom Snapshots to StreamsProject SetupDomain Model: Telemetry as a Streamable DocumentReactive RepositoryService Layer: Explicit Backpressure StrategyStreaming Endpoint with Server-Sent EventsThe Real Bottleneck: Waiting, Not WorkingThe Most Dangerous Line of CodeResource Efficiency …
-
Build a Spaced Repetition Flashcard API with Spring Boot & MongoDB (Part 1)
Table of Contents GitHub Repository: Complete SRS Flashcard App CodeHow to Create a Spring Boot Project with Spring InitializrConfigure MongoDB Connection URI in Spring BootFlashcard System: Logical Data Model & ERDMongoDB Schema Design: One-to-Many RelationshipsJava Model Classes: Deck and FlashCard …
-
Atlas Online Archive: Efficiently Manage the Data Lifecycle
Table of Contents Problem statementResolutionAdvantagesLimitationsPre-requisitesOnline archival configuration setupConclusion Problem statement In the production environment, in a MongoDB Atlas database, a collection contains massive amounts of data stored, including aged and current data. However, aged data is not frequently accessed through …
-
Event-Driven Architecture in Java and Kafka
Table of Contents Streaming Data – The Air Traffic Control Example.Reactive Java – a brief historyReactive Java with MongoDB and KafkaBlocking Code VersionReactive Code VersionBlocking Versus Reactive Application Performance.Final Thoughts Reactive Java is well suited to modern streaming, event driven …