Table of Contents Pre-requisitesRelational MigratorMigrating the data from the PostgreSQL schema to MongoDBAnalysing the Postgres schemaCreating mappings to generate the equivalent MongoDB schemaMigrating the data into MongoDBCode generation with Relational MigratorBuilding Spring Boot applicationExamples of aggregation pipelinesConclusion Imagine this: You’re …
-
Data Modeling for Java Developers: Structuring With PostgreSQL and MongoDB
Table of Contents Relationships in databasesOne-to-one relationshipOne-to-many relationshipMany-to-many relationshipRelational vs. document databasesPostgres implementation with JavaMongoDB implementation with JavaScalability and performanceMigration considerationsRethinking schema designReplacing joins with aggregationsConclusion Application and system designs have always been considered the most essential step in application …
-
Java Virtual Threads in Action: Optimizing MongoDB Operation
Table of Contents PrerequisitesStep 1: Create the Product entityStep 2: Create the ServiceStep 3: Expose the Camera APIStep 4: Build and run the applicationStep 5: Test the APIConclusion Virtual threads have become one of the most popular resources in Java …
-
How to Identify the Underlying Causes of Connection Timeout Errors for MongoDB With Java
Table of Contents Network Configuration IssuesServer LoadResource ExhaustionApp-Side Chaos: Java Threads or Memory Maxed Out, Leaving No Room for New MongoDB ConnectionsServer-Side Crunch: MongoDB Running Out of File Descriptors or Ram on a Shared HostConnection Pool MisconfigurationIncorrect MongoDB URIConclusion Java …
-
Clean and Modular Java: A Hexagonal Architecture Approach
One of the discussions that always leaves me with both doubts and excitement is the one about system architecture. Ever since I started diving deeper into programming, I’ve encountered questions like how to separate packages and modules: is it really …
-
Multi-cloud Strategies With MongoDB Atlas
Table of Contents Why use a multi-cloud strategy?Setting up a multi-cloud deployment in MongoDB AtlasSummary In the technological world, the cloud has become more prevalent. It brings many benefits, including flexibility, scalability, faster innovation, and collaboration. Plus, when it comes …
-
Your Complete Guide to Diagnose Slow Queries in MongoDB
Table of Contents 1. MongoDB’s Query ProfilerWhat we’ll needWhat is MongoDB’s Profiler?MongoDB Atlas Query Profiler in the Atlas UIA few important considerationsMongoDB Database ProfilerLet’s make something slow on purpose2. Understanding execution plans with explain()What we’ll needWhat is explain()?Verbosity modesLet’s use …
-
Performance Best Practise No. 1: Optimize Database Operations
Table of Contents How GlassFish helps with improving database performanceConnection pool configurationJDBC batchingJakarta Persistence (JPA) batchingNext Steps Database operations are a very critical part of most applications in regards of performance. There are multiple reasons why database operations can significantly …
-
Intro to RAG: Foundations of Retrieval Augmented Generation, part 2
Table of Contents GenAI systems as layersVector RAGGraph RAGAI AgentsModel Context Protocol (MCP)What should you choose?Wrapping up!Resources In the last post, we discussed the basics of Retrieval Augmented Generation (RAG) and how it enhances the capabilities of Large Language Models …
-
MongoDB Aggregation Framework: A Beginner’s Guide
Table of Contents Aggregation pipelineAggregation stages$Match$Project$Unwind$Group$Sort$AddFieldsCombining stagesWrapping up Finding exactly the data we need isn’t always a simple task. You’ve probably faced situations where you needed to filter information, group it, and even perform calculations to produce a final result. …
-
Testing MongoDB Atlas Search Java Apps Using TestContainers
Table of Contents What is MongoDB Atlas Search, anyway?Local development and testing with MongoDB Atlas SearchWhat’s TestContainers?Let’s write some code!Simple CRUD data access and unit testsMongoDB Atlas Search with seed data and index waitAdvanced seed data loading: MongoDB Database ToolsLoading …