MongoDB Sharding: What to Know Before You Shard
Table of Contents Sharding as a horizontal scaling strategyUnderstanding a sharded cluster architectureShardsConfig serversMongosDistributing data in a sharded clusterWhen should you shard a collection?Vertical limits or costLarge datasetsFaster backup and restore timesHigh write or throughput requirementsZonal or regional data requirementsChoosing ...
-
Reactive Java with Project Reactor
Table of Contents Reactive Streams: The Contract Behind ReactorProject Reactor Core ConceptsBackpressure: The Hard Part Reactive Does Not Mean FasterMongoDB Reactive Driver: Architecture OverviewIntegrating MongoDB Reactive Driver with Project ReactorPerformance Considerations with Reactive MongoDBReactive Architecture Patterns with MongoDBWhen NOT to Use …
-
MongoDB 8.0 Migration Guide: What You Need to Know Before Upgrading
Table of Contents What’s new in version 8.0? General changesQueryable EncryptionExpress query stagesQuery shape and query settingsCompatibility and deprecationsQuery behaviorIndex filtersMigration planning and strategyPre-migration assessment Staging cluster: your testing hubUpgrade production clusterMonitoringCluster node metrics RecapHow complex is your upgrade?Straightforward upgradesMore complex upgradesConclusion Have …
-
GraphQL for Java Developers: Building a Flexible Data Layer
Table of Contents GraphQL fundamentals Why GraphQL fits well in the Spring ecosystemChoosing Netflix DGS with Spring for GraphQLProject setupDependenciesDomain model overviewDefining the GraphQL schemaPersistence with MongoDBQuery resolvers with Netflix DGSMutations and input validationResolving relationships in MongoDBThe N+1 query problemUsing DataLoader …
-
Abstracting Data Access in Java With the DAO Pattern
Table of Contents A simple implementationPrerequisitesThe domain classThe DAO APIThe ProductDao classUsing the DAOUsing MongoDB as the persistence layerSetting up MongoDBThe MongoDBProductDao classConnecting to MongoDBThe application classAdvanced considerationsPreventing business logic leakageAdding custom query methodsError handlingConclusion The Data Access Object (DAO) …
-
Introduction to Behavior Driving Development with Java and MongoDB
Table of Contents PrerequisitesStep 1: Create the project structureStep 2: Create the test infrastructureStep 3: Generate our first scenario testConclusion When we face software development, the biggest mistake is about delivering what the client wants. It sounds like a cliché, …
-
MongoDB and WiredTiger: A Journey Through the Storage Engine
Databases are the backbone of modern applications, and MongoDB stands out with its flexibility and scalability. Central to its functionality is the WiredTiger storage engine. WiredTiger, as MongoDB’s default engine, seamlessly merges document-level concurrency for high throughput, advanced compression techniques …
-
Inside the Engine: The Sub-Millisecond Performance Relay of MongoDB 8.0
Table of Contents Stage 1: Network Arrival & Task DispatchStage 2: OperationContext & ACL/ParsingStage 3: PlanCache Lookup & Query PlanningStage 4: SBE Execution & Cooperative YieldingStage 5: WiredTiger MVCC, Cache & JournalingStage 6: Index Mastery & Pre-SplitsStage 7: Replication & …
-
Building Java Microservices with the Repository Pattern
Table of Contents What you’ll learnThe Spring standard repositoryCustom repository functionsWhen requirements changeThe double-edged sword of Spring updates in MongoDBIncreased network trafficOplog bloat and replacing documentsWhy schema and indexing matterConclusionFurther reading What you’ll learn The repository pattern is a design …
-
Spring Boot 4 OpenTelemetry Guide: Metrics, Traces, and Logs Explained
Table of Contents Key TerminologyWhy OpenTelemetry?Step-by-Step GuideTesting with Docker ComposeConclusionReferences In my previous article, I outlined a comprehensive list of features introduced in Spring Framework 7 and Spring Boot 4. In this series of articles, we will explore these features in …
-
Optimizing MongoDB Queries in Java Applications
Modern Java applications often struggle with performance bottlenecks that have little to do with the JVM itself. In most cases, the culprit lies deeper in how the application interacts with its database. Slow queries, missing indexes, or inefficient access patterns …