Table of Contents 1. Use the MongoDB Kubernetes Operator2. StatefulSets and persistent volumes: Running MongoDB the right wayExample: Recommended multiple volume configuration3. Set CPU and memory resources for MongoDB and the OperatorMongoDB Kubernetes Operator: Plan for initial spikesMongoDB replica set …
-
MongoDB Schemas in Java
Table of Contents Why MongoDB and Java are such good friendsThe missing schema of loosely typed systems Bringing schema back Example: Spring Boot sea temperature service Sea temperatures Weather reports Schemas Data access Creating our API Why not Spring Data? Java benefits Schema in one place Database pollution API input pollution Compile-time and …
-
Building REST APIs in Java with Spring Boot
Table of Contents How can Spring help?PrerequisitesCreating our appConnecting our databaseOur Book modelBook repositoryOur REST controllerCreateReadUpdateDeleteAdding DTOs and validationBookRequestBookResponseUpdating the controllerTesting the APIRun the APICreateReadUpdateDeleteConclusion REST has become the default choice for building web services, and for good reason. It’s …
-
MongoDB Aggregations: Organizing Recipes by Meal Type with $group
Table of Contents Why Use $group for Organizing Recipes?Setting Up the DataUsing $group to Organize Recipes by TypeStep 1: Grouping Recipes by TypeStep 2: Including Recipe Details in Each GroupGrouping Recipes by TagsStep 1: Using $unwind to Break Down TagsAdvanced …
-
Queryable Encryption With Spring Data MongoDB: How to Query Encrypted Fields
Table of Contents Why Queryable Encryption?A quick look at Spring Data MongoDBUse case: HR system with encrypted fieldsSetting up the projectConfiguring dependencies and propertiesAdding mongodb-cryptApplication.yml configurationAccessing properties in the codeBuilding the application layersThe domain modelThe repositoryThe serviceThe controllerSetting up encryptionConfiguring …
-
What happens when a Primary fails in a MongoDB replica set? Automatic failovers?
In distributed systems, high availability is not a luxury—it’s a necessity. And one of the very important parts of that is automatic failovers. What are automatic failovers and how do they work? Let’s see today! These concepts are actually similar …
-
Managing MongoDB Database Changes Using Liquibase Pro
Table of Contents What is Liquibase?What is MongoDB?Setting up a local MongoDB instance on WindowsUse Liquibase with MongoDBPrerequisitesInstall supporting driversConnection configurationConnection testHands-on execution steps detailed1. Create project and add files2. Project structure in VS Code3. Lifecycle of Liquibase4. Verify the …
-
Domain-Driven Design in Java: A Practical Guide
Table of Contents Understanding the “Airport” domainModeling the core Airport domain in JavaIdentifying aggregates and entitiesImplementing entities and value objectsBounded contexts and modularizationRepositories, domain services, and factoriesRepositoriesDomain servicesFactoriesApplication layer and integrationTesting and evolving the modelComplete DDD implementation source codeTesting scenarios …
-
Enforcing Governance in MongoDB Atlas with Resource Policies
Table of Contents What Are Resource Policies?Why Use Them?Available CapabilitiesApplying Resource Policies with Terraform🔐 Example 1: Allow clusters only on AWS🌐 Example 2: Block public IPs (0.0.0.0/0)🔒 Example 3: Enforce TLS 1.2 or higherValidation and Testing🚫 Attempt to create a …
-
Run an Atlas Cluster Locally in Minutes
Run an Atlas cluster locally in minutes You no longer need a cloud account to try MongoDB Atlas features. Spin up a fully compatible local cluster in seconds, with no login, no credit card, and no friction. 🕒 Reading time: …
-
Why Mirroring Production in Dev Helps You Avoid Costly Mistakes
Table of Contents The setup: A realistic aggregation scenarioThe application behind the testTesting on M0: The hidden riskTaking it to production: Same query, different outcomeReal-time metrics: Detecting the bottleneckQuery insights: The detective toolDon’t guess, let Performance Advisor show the wayResilience …