Discover Your Ideal Airbnb: Implementing a Spring Boot & MongoDB Search With Kotlin Sync Driver
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, …
-
Atlas 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 …
-
Role-Based Access Control in Java Applications
Table of Contents Authorization Is a Business ConcernModeling Permissions FirstUsing MongoDB for User MetadataFrom Infrastructure Model to Application PrincipalCentralizing Authorization LogicContextual Rules: Where RBAC StopsRBAC vs ABAC: When Roles Are Not EnoughThe Architectural PayoffConclusion We often work with Java applications …
-
Data Enrichment in MongoDB
Table of Contents Concurrency in data enrichmentMachine concurrency Human concurrencySchema design patternsBest practicesPlan for concurrencyUse a separate collection for pessimistic lockingAdd an auto-save to your application when humans and locks are involvedRelease the lock app-side on logout Anti-patternsUsing separate (temporary) collections to …