<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Databases on foojay.io - Friends Of OpenJDK</title><link>https://foojay.io/today/category/databases/</link><description>Recent content in Databases on foojay.io - Friends Of OpenJDK</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 26 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://foojay.io/today/category/databases/index.xml" rel="self" type="application/rss+xml"/><item><title>One Database, Two Models: Building AI-Friendly Java Applications with MySQL JSON Duality Views</title><link>https://foojay.io/today/one-database-two-models-mysql-json-duality-views-java/</link><pubDate>Sat, 26 Sep 2026 00:00:00 +0000</pubDate><guid>https://foojay.io/today/one-database-two-models-mysql-json-duality-views-java/</guid><description>&lt;p&gt;MySQL can now hand your application a complete JSON document, such as an order with its customer and line items, while the data stays in normal relational tables. You can even send the document back and MySQL updates the right rows. I built a small Java app to see how far that goes. Reading got much simpler. Writing works too, but it comes with a few sharp edges you should know about before you use it.&lt;/p&gt;</description></item><item><title>How I Built an AI Assistant for My Career with Java, Spring AI, and MongoDB</title><link>https://foojay.io/today/how-i-built-an-ai-assistant-for-my-career-with-java-spring-ai-and-mongodb/</link><pubDate>Tue, 15 Sep 2026 11:51:17 +0000</pubDate><guid>https://foojay.io/today/how-i-built-an-ai-assistant-for-my-career-with-java-spring-ai-and-mongodb/</guid><description>&lt;p&gt;The best way to learn a technology is by putting it into practice in a real system.&lt;/p&gt;&#10;&lt;p&gt;A few months ago, I decided to build a virtual assistant that could answer questions about my career, help people learn more about my articles, videos, talks, and projects, and even schedule a call on my calendar.&#10;&lt;img src="https://foojay.io/today/how-i-built-an-ai-assistant-for-my-career-with-java-spring-ai-and-mongodb/unnamed-16-1024x937.png" alt="" width="1024" height="937" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;At first, the idea was simple: give the assistant access to my content and let people ask questions about it. But as the project evolved, I realized that not every question should be handled in the same way. Some questions can be answered with a direct query to the database, while others benefit from semantic search. In other cases, the assistant may need to use a tool or execute multiple steps before reaching an answer.&lt;/p&gt;</description></item><item><title>Aggregation Optimization in MongoDB: Sorting With Indexes (Part 5)</title><link>https://foojay.io/today/aggregation-optimization-in-mongodb-sorting-with-indexes-part-5/</link><pubDate>Tue, 01 Sep 2026 14:07:36 +0000</pubDate><guid>https://foojay.io/today/aggregation-optimization-in-mongodb-sorting-with-indexes-part-5/</guid><description>&lt;p&gt;&lt;em&gt;And why MongoDB might be a better relational database than you ever realized.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://www.mongodb.com/events/mongodb-schema-design-reviews/?utm_campaign=devrel&amp;amp;utm_source=third-party-content&amp;amp;utm_medium=cta&amp;amp;utm_content=agg-part5-foojay&amp;amp;utm_term=tony.kim" target="_blank" rel="noopener noreferrer"&gt;&lt;em&gt;Design reviews&lt;/em&gt;&lt;/a&gt;&lt;em&gt;are one-on-one meetings where MongoDB experts deliver advice on data modeling best practices and application design challenges. In this series, we are going to explore common real-life scenarios where design reviews helped developers achieve meaningful success with MongoDB.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://foojay.io/today/aggregation-optimization-in-mongodb-sorting-with-indexes-part-5/fri1-2.png" alt="" width="700" height="307" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;In this series, we&amp;rsquo;ve described our steps to improve the performance of a slow running MongoDB &lt;a href="https://www.mongodb.com/docs/manual/aggregation/?utm_campaign=devrel&amp;amp;utm_source=third-party-content&amp;amp;utm_medium=cta&amp;amp;utm_content=agg-part5-foojay&amp;amp;utm_term=tony.kim#aggregation-operations" target="_blank" rel="noopener noreferrer"&gt;aggregation pipeline&lt;/a&gt;. The pipeline was part of a fictional video streaming service application, mapping user profiles to the devices those users were using to access the service, and was based on a real use case I&amp;rsquo;d encountered during a recent design review.&lt;/p&gt;</description></item><item><title>NetBeans DataWrangler: Query, Convert, and Edit Data Analytics Files</title><link>https://foojay.io/today/netbeans-datawrangler-query-convert-and-edit-data-analytics-files/</link><pubDate>Sun, 30 Aug 2026 10:25:43 +0000</pubDate><guid>https://foojay.io/today/netbeans-datawrangler-query-convert-and-edit-data-analytics-files/</guid><description>&lt;p&gt;&lt;a href="https://github.com/geertjanw/Apache-NetBeans-Data-Wrangler" target="_blank" rel="noopener noreferrer"&gt;Apache NetBeans DataWrangler&lt;/a&gt; brings the file formats of data analytics into Apache NetBeans 31: CSV, &lt;a href="https://parquet.apache.org/" target="_blank" rel="noopener noreferrer"&gt;Apache Parquet&lt;/a&gt;, JSON and Excel, the formats exchanged with pandas, Spark, R, dbt, Power BI and Excel itself.&lt;/p&gt;&#10;&lt;p&gt;You can query, convert, inspect, edit and analyze them without leaving the IDE. They open as documents with their own views and you can query them with SQL, join, aggregate and pivot them, convert them between formats, load them into tables and export the results. The SQL editor is enhanced with code completion, documentation, error checking and quick fixes for analytical SQL.&lt;/p&gt;</description></item><item><title>DuckDB in Spring Batch: Replace In-Memory Java Loops with One SQL Statement</title><link>https://foojay.io/today/duckdb-in-spring-batch-replace-in-memory-java-loops-with-one-sql-statement/</link><pubDate>Tue, 11 Aug 2026 13:34:43 +0000</pubDate><guid>https://foojay.io/today/duckdb-in-spring-batch-replace-in-memory-java-loops-with-one-sql-statement/</guid><description>&lt;p&gt;Spring Batch jobs usually follow the same pattern: an &lt;code&gt;ItemReader&lt;/code&gt; streams rows, an &lt;code&gt;ItemProcessor&lt;/code&gt; transforms each one, and an &lt;code&gt;ItemWriter&lt;/code&gt; writes them out, chunk by chunk. A chunk-oriented step wires those three pieces together:&lt;/p&gt;&#10;&lt;pre class="EnlighterJSRAW" data-enlighter-language="generic"&gt;new StepBuilder(&amp;#34;transform&amp;#34;, jobRepository)&#10; .&amp;lt;Order, Summary&amp;gt;chunk(1_000, transactionManager)&#10; .reader(reader) // stream rows&#10; .processor(processor) // transform each row&#10; .writer(writer) // write the chunk&#10; .build();&lt;/pre&gt;&lt;p&gt;&lt;em&gt;The chunk-oriented processing model (&lt;a href="https://docs.spring.io/spring-batch/reference/step/chunk-oriented-processing.html" target="_blank" rel="noopener noreferrer"&gt;Spring Batch reference&lt;/a&gt;).&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;That pattern works well for moving records between systems.&lt;/p&gt;</description></item><item><title>Embedding DuckDB in a Maven App (and Using It for Things That Aren't Databases)</title><link>https://foojay.io/today/embedding-duckdb-in-a-maven-app-and-using-it-for-things-that-arent-databases/</link><pubDate>Thu, 06 Aug 2026 08:46:28 +0000</pubDate><guid>https://foojay.io/today/embedding-duckdb-in-a-maven-app-and-using-it-for-things-that-arent-databases/</guid><description>&lt;p&gt;&lt;a href="https://duckdb.org/" target="_blank" rel="noopener noreferrer"&gt;DuckDB&lt;/a&gt; is described as &amp;ldquo;SQLite for analytics,&amp;rdquo; which is true: it&amp;rsquo;s an in-process database engine that runs inside your application, with no server to install or manage. What&amp;rsquo;s less obvious from that description is that &lt;strong&gt;you can get value out of it without ever creating a database at all&lt;/strong&gt;. Because it can query CSV, JSON, and Parquet files directly — local or over HTTP — it works perfectly well as an embedded data-crunching library that happens to speak SQL.&lt;/p&gt;</description></item><item><title>Getting Started with Exposed: Kotlin ORM Made Simple</title><link>https://foojay.io/today/exposed-kotlin-orm-complete-guide/</link><pubDate>Mon, 06 Jul 2026 03:39:00 +0000</pubDate><guid>https://foojay.io/today/exposed-kotlin-orm-complete-guide/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;&#10;&lt;p&gt;For quite some time, I have been a huge fan of and fascinated by JetBrains products, tools, and libraries because of their masterful craftsmanship in product creation and their pristine focus on building high-quality developer tools.&lt;/p&gt;&#10;&lt;p&gt;Even more excitingly, JetBrains Java Annotated Monthly newsletters have featured most of the technical articles I wrote for Foojay on topics such as Java, Spring, Spring Boot 4, and OpenRewrite.&lt;/p&gt;&#10;&lt;p&gt;Recently, one Kotlin Domain-Specific Language (DSL) library caught my attention. I immediately tried converting my existing Spring Boot 4 application from Java to Kotlin using Exposed, an ORM framework for Kotlin.&#10;&lt;img src="https://foojay.io/today/exposed-kotlin-orm-complete-guide/Exposed-1024x683.jpg" alt="Exposed" width="1024" height="683" loading="lazy" decoding="async"&gt; Kotlin SQL Libary&lt;/p&gt;</description></item><item><title>Aggregation Optimization in MongoDB: Unnecessary Unwinds (Part 2)</title><link>https://foojay.io/today/aggregation-optimization-in-mongodb-unnecessary-unwinds-part-2/</link><pubDate>Thu, 25 Jun 2026 10:01:00 +0000</pubDate><guid>https://foojay.io/today/aggregation-optimization-in-mongodb-unnecessary-unwinds-part-2/</guid><description>&lt;h2 id="and-why-mongodb-might-be-a-better-relational-database-than-you-ever-realized"&gt;And why MongoDB might be a better relational database than you ever realized.&lt;/h2&gt;&#10;&lt;figure class="size-full is-resized"&gt;&#10; &lt;img src="https://foojay.io/today/aggregation-optimization-in-mongodb-unnecessary-unwinds-part-2/tue11.png" alt="" width="700" height="307" style="aspect-ratio:2.2802192518511397;width:840px;height:auto" loading="lazy" class="is-zoomable"&gt;&lt;/figure&gt;&#10;&#10;&lt;p&gt;&lt;a href="https://www.mongodb.com/events/mongodb-schema-design-reviews/?utm_campaign=devrel&amp;amp;utm_source=third-party-content&amp;amp;utm_medium=cta&amp;amp;utm_content=agg-part2-foojay&amp;amp;utm_term=tony.kim" target="_blank" rel="noopener noreferrer"&gt;&lt;em&gt;Design reviews&lt;/em&gt;&lt;/a&gt;&lt;em&gt;are one-on-one meetings where MongoDB experts deliver advice on data modeling best practices and application design challenges. In this series, we are going to explore common real-life scenarios where design reviews helped developers achieve meaningful success with MongoDB.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article was written by Graeme Robinson. Find him on&lt;/em&gt; &lt;a href="https://www.linkedin.com/in/graemecrobinson" target="_blank" rel="noopener noreferrer"&gt;&lt;em&gt;LinkedIn&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://foojay.io/today/aggregation-optimization-in-mongodb-a-case-study-from-the-field-part-1/"&gt;In Part 1 of this series&lt;/a&gt;, we described a use case based on a recent design review I conducted with a team at a MongoDB customer. The team in question was new to MongoDB, and the approach they had taken to both modeling their data and then subsequently querying it was very &amp;ldquo;RDBMS-like.&amp;rdquo; As a result, query performance was significantly slower than their SLA called for.&lt;/p&gt;</description></item><item><title>BoxLang 1.14.0: Query Transformers - Take Full Control of Your Query Results</title><link>https://foojay.io/today/boxlang-1-14-0-query-transformers-take-full-control-of-your-query-results/</link><pubDate>Wed, 24 Jun 2026 10:46:13 +0000</pubDate><guid>https://foojay.io/today/boxlang-1-14-0-query-transformers-take-full-control-of-your-query-results/</guid><description>&lt;p&gt;&lt;img src="https://foojay.io/today/boxlang-1-14-0-query-transformers-take-full-control-of-your-query-results/BoxLang-release-1.14.0-2-700x394.jpg" alt="" width="700" height="394" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;BoxLang 1.14.0 ships a lot of exciting features &amp;ndash; Dynamic Sets, Ranges, Inner Classes, JSONPath navigation &amp;ndash; but one quietly powerful addition will change the way you think about every database call in your application: &lt;strong&gt;Query Transformers&lt;/strong&gt;, and this is just the start, we have plans for a whole lot more cool query features.&lt;/p&gt;&#10;&lt;p&gt;If you have ever executed a query and then immediately written a loop to reshape the result into what you actually needed, this feature is for you.&lt;/p&gt;</description></item><item><title>Building an AI-Powered Operations Assistant with Spring AI and MongoDB Atlas — Part 2: Conversational Memory</title><link>https://foojay.io/today/building-an-ai-powered-operations-assistant-with-spring-ai-and-mongodb-atlas-part-2-conversational-memory/</link><pubDate>Wed, 10 Jun 2026 19:23:46 +0000</pubDate><guid>https://foojay.io/today/building-an-ai-powered-operations-assistant-with-spring-ai-and-mongodb-atlas-part-2-conversational-memory/</guid><description>&lt;p&gt;This is the second article in a three-part series. Part 1 covered the RAG foundation — loading runbooks into a vector store and wiring them to a language model. Part 3 will introduce stateful workflow checkpointing with pause and resume.&lt;/p&gt;&#10;&lt;h2 id="the-problem-with-stateless-chat"&gt;The Problem with Stateless Chat&lt;/h2&gt;&#10;&lt;p&gt;In the first part of the series, we successfully created a chat interface where an operator can ask questions and receive answers based on the actual content of the runbooks they have uploaded and embedded in the system. For example, they can ask in the chat, &amp;ldquo;&lt;em&gt;What should I check when my server&amp;rsquo;s CPU usage exceeds 80%?&lt;/em&gt;&amp;rdquo; and the assistant retrieves the relevant sections from the various runbooks and assembles a coherent and concrete response.&lt;/p&gt;</description></item><item><title>Exploring MongoT</title><link>https://foojay.io/today/exploring-mongot-atlas-search/</link><pubDate>Thu, 28 May 2026 21:02:49 +0000</pubDate><guid>https://foojay.io/today/exploring-mongot-atlas-search/</guid><description>&lt;p&gt;Let&amp;rsquo;s explore this fascinating and awesome Java project from MongoDB - MongoT!&lt;/p&gt;&#10;&lt;p&gt;You can check out the source code here:&lt;/p&gt;&#10;&lt;pre class="EnlighterJSRAW" data-enlighter-language="generic"&gt;git clone https://github.com/mongodb/mongot&lt;/pre&gt;&lt;p&gt;&lt;img src="https://foojay.io/today/exploring-mongot-atlas-search/Screenshot-2026-05-08-at-3.17.36-PM-1024x548.png" alt="" width="1024" height="548" loading="lazy" decoding="async"&gt;&lt;/p&gt;&#10;&lt;p&gt;MongoT is a wrapper around the amazing Java search engine: &lt;a href="https://lucene.apache.org/" target="_blank" rel="noopener noreferrer"&gt;Lucene&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Lucene is a powerful search toolkit built around an inverted token index structure that enables advanced text search capabilities, including ranked results, autocomplete, synonyms, fuzzy matching, highlighting, and faceting — all with high performance regardless of dataset size. Unlike MongoDB&amp;rsquo;s native query engine, it can efficiently search across multiple indexes simultaneously by intersecting lists of ordinal document IDs in parallel, using optimization techniques like skip-lists, ordinal compression, and document frequency ordering. It also supports indexing of various field types (integers, dates, keywords, etc.) and has expanded into vector search, enabling semantic similarity search by meaning rather than exact text matching.&lt;/p&gt;</description></item><item><title>Implementing Soft Deletes in Java</title><link>https://foojay.io/today/implementing-soft-deletes-in-java/</link><pubDate>Thu, 21 May 2026 10:09:00 +0000</pubDate><guid>https://foojay.io/today/implementing-soft-deletes-in-java/</guid><description>&lt;h2 id="what-are-soft-deletes"&gt;What are soft deletes?&lt;/h2&gt;&#10;&lt;p&gt;Usually, when deleting documents from a database, the entry is permanently gone and can not be recovered or accessed again.&lt;/p&gt;&#10;&lt;p&gt;Sometimes data needs to be made unavailable for regular access without actually being removed from a database. A common example is a user deleting their account on a platform, but retention policies require you to keep all data related to that user for a certain period of time. At the same time, no data regarding that user is accessible on the platform. A soft delete is a treatment for a piece of data that ensures it is ignored by your application while actually still being stored in the database.&lt;/p&gt;</description></item><item><title>Building an AI-Powered Operations Assistant with Spring AI and MongoDB Atlas — Part 1: RAG Foundation</title><link>https://foojay.io/today/building-an-ai-powered-operations-assistant-with-spring-ai-and-mongodb-atlas-part-1-rag-foundation/</link><pubDate>Thu, 07 May 2026 19:22:11 +0000</pubDate><guid>https://foojay.io/today/building-an-ai-powered-operations-assistant-with-spring-ai-and-mongodb-atlas-part-1-rag-foundation/</guid><description>&lt;p&gt;This is the first article in a three-part series. Part 2 covers short-term and long-term memory; Part 3 introduces stateful workflow checkpointing with pause/resume.&lt;/p&gt;&#10;&lt;h2 id="the-problem"&gt;The problem&lt;/h2&gt;&#10;&lt;p&gt;It&amp;rsquo;s 2 a.m. Suddenly, an alert pops up indicating abnormal CPU usage on the payment services. The on-call engineer opens their laptop, logs into the monitoring dashboards, and begins the hunt. One by one, he searches the runbooks on Confluence, checks the Slack chats, and opens the GitHub wikis and documents shared during the design phase. By the time he finds any useful information, ten minutes have already passed.&lt;/p&gt;</description></item><item><title>UCanAccess: The Modern Pure-Java Bridge to Microsoft Access</title><link>https://foojay.io/today/ucanaccess-java-ms-access-jdbc-guide/</link><pubDate>Wed, 06 May 2026 08:44:00 +0000</pubDate><guid>https://foojay.io/today/ucanaccess-java-ms-access-jdbc-guide/</guid><description>&lt;p&gt;Microsoft Access databases are everywhere. Decades of &lt;code&gt;.mdb&lt;/code&gt; and &lt;code&gt;.accdb&lt;/code&gt; files silently power spreadsheets, small business applications, and legacy data stores across organizations of all sizes. Yet for Java developers, connecting to these files has historically meant wrestling with native Windows libraries, ODBC bridges, and platform-specific hacks.&lt;/p&gt;&#10;&lt;figure class="aligncenter size-full is-resized"&gt;&#10; &lt;img src="https://foojay.io/today/ucanaccess-java-ms-access-jdbc-guide/ucanaccess-logo.svg" alt="UCanAccess Logo" style="width:320px" loading="lazy" class="is-zoomable"&gt;&lt;/figure&gt;&#10;&#10;&lt;p&gt;&lt;strong&gt;UCanAccess&lt;/strong&gt; puts an end to that. It is an open-source, pure-Java JDBC driver that lets you read and write Microsoft Access databases (&lt;code&gt;.mdb&lt;/code&gt; and &lt;code&gt;.accdb&lt;/code&gt;) just like any other SQL database — no native drivers, no Windows dependency, no friction.&lt;/p&gt;</description></item><item><title>When Should You Use a Cache With MongoDB?</title><link>https://foojay.io/today/when-should-you-use-a-cache-with-mongodb/</link><pubDate>Tue, 05 May 2026 15:23:30 +0000</pubDate><guid>https://foojay.io/today/when-should-you-use-a-cache-with-mongodb/</guid><description>&lt;p&gt;From time to time, I&amp;rsquo;ll run a &lt;a href="https://www.mongodb.com/events/mongodb-schema-design-reviews/?utm_campaign=devrel&amp;amp;utm_source=third-party-content&amp;amp;utm_medium=cta&amp;amp;utm_content=cache-foojay&amp;amp;utm_term=tony.kim" target="_blank" rel="noopener noreferrer"&gt;design review&lt;/a&gt; for an application being migrated from a relational database onto MongoDB, where the customer shares an architectural diagram showing a caching layer (typically Redis) sitting between the app server and MongoDB.&lt;/p&gt;&#10;&lt;p&gt;I like to keep the architecture as simple as possible—after all, each layer brings its own complexity and management costs—so I&amp;rsquo;ll ask why the caching layer is there. Of course, the answer is always that it&amp;rsquo;s there to speed up data access. This reveals a misunderstanding of both the reason why caching layers were created and what MongoDB provides.&lt;/p&gt;</description></item><item><title>Large-Scale ETL Pipeline Architecture</title><link>https://foojay.io/today/large-scale-etl-pipeline-architecture/</link><pubDate>Fri, 01 May 2026 19:23:04 +0000</pubDate><guid>https://foojay.io/today/large-scale-etl-pipeline-architecture/</guid><description>&lt;p&gt;Modern data-driven systems. ETL pipelines are no longer simply scheduled background processes that run silently overnight, one after another. They are the backbone of real-time analytics, powering operational dashboards and recommendation systems. They enable machine learning workflows.&lt;/p&gt;&#10;&lt;p&gt;This evolution, while creating enormous benefits, has—with the increase in data volume and the decrease in latency tolerance—called into question the traditional sequential ETL approach. A bottleneck for the speed is now required.&lt;/p&gt;</description></item><item><title>Building a Personalized Content Delivery System</title><link>https://foojay.io/today/building-a-personalized-content-delivery-system/</link><pubDate>Thu, 23 Apr 2026 15:10:45 +0000</pubDate><guid>https://foojay.io/today/building-a-personalized-content-delivery-system/</guid><description>&lt;p&gt;Recommendation engines have a reputation for requiring specialized ML infrastructure: matrix factorization pipelines, training jobs, and model serving layers. That is one way to do it, but not the only way. If your data already lives in MongoDB and your application runs on Spring Boot, you can build a practical recommendation system using tools you already have. MongoDB aggregation pipelines handle the scoring math server-side, and Atlas Vector Search adds semantic matching without a separate vector database.&lt;/p&gt;</description></item><item><title>Distributed Cache Invalidation Patterns</title><link>https://foojay.io/today/distributed-cache-invalidation-patterns/</link><pubDate>Tue, 21 Apr 2026 13:52:03 +0000</pubDate><guid>https://foojay.io/today/distributed-cache-invalidation-patterns/</guid><description>&lt;p&gt;Caching is one of the most powerful tools developers have at their disposal for optimizing application performance. Caching systems can significantly reduce latency and reduce the load on databases or external systems by storing frequently accessed data as close as possible to the application layer. The result? Improved responsiveness and overall system usability.&lt;/p&gt;&#10;&lt;p&gt;In small monolithic applications, cache management is usually very simple. A service retrieves data from a database, stores it in memory, and fulfills subsequent requests by retrieving the data directly from the cache. When the data changes, the cache key is invalidated or updated.&lt;/p&gt;</description></item><item><title>CQRS in Java: Separating Reads and Writes Cleanly</title><link>https://foojay.io/today/cqrs-in-java-separating-reads-and-writes-cleanly/</link><pubDate>Thu, 16 Apr 2026 20:25:28 +0000</pubDate><guid>https://foojay.io/today/cqrs-in-java-separating-reads-and-writes-cleanly/</guid><description>&lt;h3 id="what-youll-learn"&gt;What you&amp;rsquo;ll learn&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;How the MongoDB Spring repository can be used to abstract MongoDB operations&lt;/li&gt;&#10;&lt;li&gt;Separating Reads and Writes in your application&lt;/li&gt;&#10;&lt;li&gt;How separating these can make schema design changes easier&lt;/li&gt;&#10;&lt;li&gt;Why you should avoid save() and saveAll() functions in Spring&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The Command Query Responsibility Segregation (CQRS) pattern is a design method that segregates data access into separate services for reading and writing data. This allows a higher level of maintainability in your applications, especially if the schema or requirements change frequently. This pattern was originally developed with separate read and write sources in mind. However, implementing CQRS for a single data source is an effective way to abstract data from the application and make maintenance easier in the future. In this blog, we will use Spring Boot with MongoDB in order to create a CQRS pattern-based application.&lt;/p&gt;</description></item><item><title>Building a Kotlin App with Spring Boot and MongoDB Search</title><link>https://foojay.io/today/building-a-kotlin-app-with-spring-boot-and-mongodb-search/</link><pubDate>Thu, 09 Apr 2026 15:21:05 +0000</pubDate><guid>https://foojay.io/today/building-a-kotlin-app-with-spring-boot-and-mongodb-search/</guid><description>&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;&#10;&#9;&#9;&#9;&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/b0dkQYcvBkQ?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;&#10;&#9;&#9;&lt;/div&gt;&#10;&#10;&lt;p&gt;One of my favorite activities is traveling and exploring the world. You know that feeling of discovering a new place and thinking, &amp;ldquo;How have I not been here before?&amp;rdquo; It&amp;rsquo;s with that sensation that I&amp;rsquo;m always motivated to seek out new places to discover. Often, when searching for a place to stay, we&amp;rsquo;re not entirely sure what we&amp;rsquo;re looking for or what experiences we&amp;rsquo;d like to have. For example, we might want to rent a room in a city with a view of a castle. Finding something like that can seem difficult, right? However, there is a way to search for information accurately using MongoDB Search.&lt;/p&gt;</description></item><item><title>Manage HTTP Sessions with Spring Session MongoDB</title><link>https://foojay.io/today/building-distributed-http-sessions-with-spring-session-mongodb/</link><pubDate>Tue, 07 Apr 2026 15:19:10 +0000</pubDate><guid>https://foojay.io/today/building-distributed-http-sessions-with-spring-session-mongodb/</guid><description>&lt;p&gt;&lt;a href="https://www.mongodb.com/docs/drivers/java/sync/current/integrations/spring-session/?utm_campaign=devrel&amp;amp;utm_source=third-part-content&amp;amp;utm_medium=cta&amp;amp;utm_content=spring&amp;#43;sessions&amp;#43;mongodb&amp;amp;utm_term=tim.kelly" target="_blank" rel="noopener noreferrer"&gt;Spring Session MongoDB&lt;/a&gt; is a library that enables Spring applications to store and manage HTTP session data in MongoDB rather than relying on container-specific session storage. In traditional deployments, session state is often tied to a single application instance, which makes scaling across multiple servers difficult. By integrating &lt;a href="https://spring.io/projects/spring-session" target="_blank" rel="noopener noreferrer"&gt;Spring Session&lt;/a&gt; with MongoDB, session data can be persisted beyond application restarts and shared across instances in a cluster, enabling scalable distributed applications with minimal configuration.&lt;/p&gt;</description></item><item><title>Java Faceted Full-Text Search API Using MongoDB Atlas Search</title><link>https://foojay.io/today/java-faceted-full-text-search-api-using-mongodb-atlas-search/</link><pubDate>Thu, 02 Apr 2026 16:27:30 +0000</pubDate><guid>https://foojay.io/today/java-faceted-full-text-search-api-using-mongodb-atlas-search/</guid><description>&lt;p&gt;This is going to be a fun, practical tutorial demonstrating how to build a Java faceted full-text search API (like the ones powering sites like Amazon)!&lt;/p&gt;&#10;&lt;p&gt;We&amp;rsquo;ll use an interesting dataset which showcases how you can effectively pair machine learning/AI-generated data with more traditional search to produce fast, cheap, repeatable, and intuitive search engines.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: If you (like me!) are less about words and more about code, you can jump straight in. Check it out and run it locally like this:&lt;/p&gt;</description></item><item><title>MongoDB Search Score Breakdown</title><link>https://foojay.io/today/mongodb-search-score-breakdown/</link><pubDate>Tue, 31 Mar 2026 15:05:08 +0000</pubDate><guid>https://foojay.io/today/mongodb-search-score-breakdown/</guid><description>&lt;p&gt;Full-text search powers all of our digital lives — googling for this and that; asking Siri where to find a tasty, nearby dinner; shopping at Amazon; and so on. We receive relevant results, often even in spite of our typos, voice transcription mistakes, or vaguely formed queries. We have grown accustomed to expecting the best results for our searching intentions, right there, at the top.&lt;/p&gt;&#10;&lt;p&gt;But now it&amp;rsquo;s your turn, dear developer, to build the same satisfying user experience into your Atlas-powered application.&lt;/p&gt;</description></item><item><title>Modeling One-to-Many Relationships in Java with MongoDB</title><link>https://foojay.io/today/modeling-one-to-many-relationships-in-java-with-mongodb/</link><pubDate>Thu, 26 Mar 2026 15:50:30 +0000</pubDate><guid>https://foojay.io/today/modeling-one-to-many-relationships-in-java-with-mongodb/</guid><description>&lt;p&gt;In a relational database, modeling a one-to-many relationship is straightforward: you create two tables and connect them with a foreign key. When you need the data together, you write a JOIN. In MongoDB, you have a choice, and that choice has a direct impact on your application&amp;rsquo;s performance, scalability, and maintainability.&lt;/p&gt;&#10;&lt;p&gt;Consider a common scenario: a BlogPost that has many Comment objects. In Java, this is a natural List&amp;lt;Comment&amp;gt; field on the post. But when it comes time to persist that relationship in MongoDB, you need to decide &lt;em&gt;how&lt;/em&gt; to store it. Should the comments live inside the blog post document? Or should they sit in their own collection, connected by references?&lt;/p&gt;</description></item><item><title>Clean Architecture with Spring Boot and MongoDB</title><link>https://foojay.io/today/clean-architecture-with-spring-boot-and-mongodb/</link><pubDate>Tue, 24 Mar 2026 16:43:14 +0000</pubDate><guid>https://foojay.io/today/clean-architecture-with-spring-boot-and-mongodb/</guid><description>&lt;p&gt;Most Spring Boot tutorials tightly wire everything together. Controllers call services, services call repositories, and MongoDB annotations like &lt;code&gt;@Document&lt;/code&gt; and &lt;code&gt;@Field&lt;/code&gt; sit right next to your business logic. It works until you need to swap the database, test logic in isolation, or reuse domain rules in a different context.&lt;/p&gt;&#10;&lt;p&gt;Clean Architecture enforces one rule: source code dependencies always point inward. Your business logic never imports Spring or MongoDB classes. The database becomes a pluggable detail at the outermost layer, something you can replace without rewriting core application code.&lt;/p&gt;</description></item><item><title>Building Reactive Data Streams with Project Reactor</title><link>https://foojay.io/today/building-reactive-data-streams-with-project-reactor/</link><pubDate>Thu, 19 Mar 2026 15:13:31 +0000</pubDate><guid>https://foojay.io/today/building-reactive-data-streams-with-project-reactor/</guid><description>&lt;h2 id="creating-non-blocking-streaming-endpoints-for-high-throughput-applications"&gt;Creating Non-Blocking Streaming Endpoints for High-Throughput Applications&lt;/h2&gt;&#10;&lt;p&gt;There are problems that only occur in production. Or rather, we only notice them in production.&lt;/p&gt;&#10;&lt;p&gt;We have created an application that exposes clean APIs, according to all standards. You have modeled the domain elegantly and efficiently: all load tests show reassuring data. CPU usage is reasonable, to say the least. However, there is a problem: when traffic exceeds a threshold, the system slows down. Response time latency becomes inconsistent; threads stack up on top of each other. Response times increase unpredictably, and application customers begin to complain about this situation.&lt;/p&gt;</description></item><item><title>Language Learning Flashcard System - Part 1</title><link>https://foojay.io/today/language-learning-flashcard-system-part-1/</link><pubDate>Tue, 17 Mar 2026 16:39:58 +0000</pubDate><guid>https://foojay.io/today/language-learning-flashcard-system-part-1/</guid><description>&lt;p&gt;My native language is Spanish. I&amp;rsquo;ve been learning (and butchering) English my whole life. But at some point, I felt confident with English and wanted to learn Japanese. Big mistake. This is a totally different beast: three writing systems (Hiragana ひらがな, Katakana カタカナ and Kanji 漢字), a completely different grammar, no relation whatsoever with European languages… I needed help. And tools to learn. And one of them is Space Repetition System based apps.&lt;/p&gt;</description></item><item><title>Atlas Online Archive: Efficiently Manage the Data Lifecycle</title><link>https://foojay.io/today/atlas-online-archive-efficiently-manage-the-data-lifecycle/</link><pubDate>Thu, 12 Mar 2026 14:55:00 +0000</pubDate><guid>https://foojay.io/today/atlas-online-archive-efficiently-manage-the-data-lifecycle/</guid><description>&lt;h2 id="problem-statement"&gt;Problem statement&lt;/h2&gt;&#10;&lt;p&gt;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 applications, and the data piles up daily in the collection, leading to performance degradation and cost consumption. This results in needing to upgrade the cluster tier size to maintain sufficient resources according to workload, as it would be difficult to continue with the existing tier size.&lt;/p&gt;</description></item><item><title>Role-Based Access Control in Java Applications</title><link>https://foojay.io/today/role-based-access-control-in-java-applications/</link><pubDate>Thu, 05 Mar 2026 20:31:49 +0000</pubDate><guid>https://foojay.io/today/role-based-access-control-in-java-applications/</guid><description>&lt;p&gt;We often work with Java applications where security begins and ends with authentication. The JWT token is validated, Spring Security is integrated, and an identity provider is added, thinking that this type of configuration is sufficiently secure.&lt;/p&gt;&#10;&lt;p&gt;The real problem is that authentication only answers one question: who are you? In real applications, we also have to answer another question, which is often more complex and more dangerous to get wrong: what are you allowed to do?&lt;/p&gt;</description></item><item><title>Data Enrichment in MongoDB</title><link>https://foojay.io/today/data-enrichment-in-mongodb/</link><pubDate>Tue, 03 Mar 2026 16:10:36 +0000</pubDate><guid>https://foojay.io/today/data-enrichment-in-mongodb/</guid><description>&lt;p&gt;In a recent design review, a customer was enriching new data as it came in. As the enrichment process was fairly complex, they ran into some issues with concurrency. To solve this, they decided that data should go into a staging collection rather than the main collection that held the data. This did nothing to help with concurrency issues and actually created more work on the database side of things when enrichment was complete.&lt;/p&gt;</description></item></channel></rss>