<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tim Kelly on foojay.io - Friends of OpenJDK</title><link>https://foojayio.github.io/website/today/author/tim-kelly/</link><description>Articles written by Tim Kelly on foojay.io - Friends of OpenJDK</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 07 Apr 2026 15:19:10 +0000</lastBuildDate><atom:link href="https://foojayio.github.io/website/today/author/tim-kelly/index.xml" rel="self" type="application/rss+xml"/><item><title>Manage HTTP Sessions with Spring Session MongoDB</title><link>https://foojayio.github.io/website/today/building-distributed-http-sessions-with-spring-session-mongodb/</link><pubDate>Tue, 07 Apr 2026 15:19:10 +0000</pubDate><guid>https://foojayio.github.io/website/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>Abstracting Data Access in Java With the DAO Pattern</title><link>https://foojayio.github.io/website/today/abstracting-data-access-in-java-with-the-dao-pattern/</link><pubDate>Thu, 29 Jan 2026 16:37:06 +0000</pubDate><guid>https://foojayio.github.io/website/today/abstracting-data-access-in-java-with-the-dao-pattern/</guid><description>&lt;p&gt;The Data Access Object (DAO) pattern is a structural pattern that isolates your application&amp;rsquo;s business logic from persistence operations. By using an abstract API, the DAO pattern hides all the complexity of performing CRUD operations against your database&amp;mdash;whether that&amp;rsquo;s MongoDB, a relational database, or any other storage mechanism.&lt;/p&gt;
&lt;p&gt;This separation is crucial: Your business logic shouldn&amp;rsquo;t care whether you&amp;rsquo;re using MongoDB&amp;rsquo;s flexible document model or a rigid SQL schema. The DAO pattern ensures both layers can evolve independently.&lt;/p&gt;</description></item><item><title>Service Layer Pattern in Java With Spring Boot</title><link>https://foojayio.github.io/website/today/service-layer-pattern-in-java-with-spring-boot/</link><pubDate>Tue, 18 Nov 2025 14:40:26 +0000</pubDate><guid>https://foojayio.github.io/website/today/service-layer-pattern-in-java-with-spring-boot/</guid><description>&lt;p&gt;In modern software design, it is important to develop code that is clean and maintainable. One way developers do this is using the &lt;strong&gt;Service Layer pattern&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id="h2-0-what-you-ll-learn"&gt;What you&amp;rsquo;ll learn&lt;/h2&gt;
&lt;p&gt;In this article, you&amp;rsquo;ll learn:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What the Service Layer pattern is and why it matters.&lt;/li&gt;
&lt;li&gt;How it fits with the MVC architecture.&lt;/li&gt;
&lt;li&gt;How to implement it in a real Spring Boot application.&lt;/li&gt;
&lt;li&gt;How to add MongoDB with minimal code.&lt;/li&gt;
&lt;li&gt;Best practices and common mistakes to avoid.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="h2-1-what-is-the-service-layer-pattern"&gt;What is the Service Layer pattern?&lt;/h2&gt;
&lt;p&gt;The Service Layer pattern is an architectural pattern that defines an application&amp;rsquo;s boundary with a layer of services that establishes a set of available operations and coordinates the application&amp;rsquo;s response in each operation.&lt;/p&gt;</description></item><item><title>Best Practices for Deploying MongoDB in Kubernetes</title><link>https://foojayio.github.io/website/today/best-practices-for-deploying-mongodb-in-kubernetes/</link><pubDate>Tue, 16 Sep 2025 19:01:34 +0000</pubDate><guid>https://foojayio.github.io/website/today/best-practices-for-deploying-mongodb-in-kubernetes/</guid><description>&lt;p&gt;&lt;a href="https://kubernetes.io/" target="_blank" rel="noopener noreferrer"&gt;Kubernetes&lt;/a&gt;
, also known as K8s, is an open-source system that simplifies the deployment, scaling, and management of containerized applications. You define your application&amp;rsquo;s desired state, such as the number of instances (&lt;a href="https://kubernetes.io/docs/concepts/workloads/pods/" target="_blank" rel="noopener noreferrer"&gt;pods&lt;/a&gt;
) or how they communicate, and Kubernetes works continuously to ensure that state is met. It excels at running stateless workloads, where pods can be replaced at any time without impacting application state or user data. Think of web servers or REST APIs: If a pod crashes, Kubernetes simply spins up a replacement and everything continues as expected.&lt;/p&gt;</description></item><item><title>Building REST APIs in Java with Spring Boot</title><link>https://foojayio.github.io/website/today/building-rest-apis-in-java-with-spring-boot/</link><pubDate>Tue, 09 Sep 2025 14:51:10 +0000</pubDate><guid>https://foojayio.github.io/website/today/building-rest-apis-in-java-with-spring-boot/</guid><description>&lt;p&gt;REST has become the default choice for building web services, and for good reason. It&amp;rsquo;s straightforward to implement, easy for clients to consume, and built directly on top of the same principles of the web itself.&lt;/p&gt;
&lt;p&gt;HTTP already gives us well-defined methods (GET, POST, PUT, DELETE), built-in caching, redirect support, secure transport via TLS, and widespread tooling support across platforms. REST doesn&amp;rsquo;t reinvent the web&amp;mdash;it uses it.&lt;/p&gt;
&lt;p&gt;REST is not a protocol or a rigid standard. It&amp;rsquo;s a lightweight architectural approach that encourages scalable, evolvable, and interoperable services. Its creator, Roy Fielding, helped define many of the specs that underpin the web today.&lt;/p&gt;</description></item><item><title>MongoDB ACID Transactions With Java</title><link>https://foojayio.github.io/website/today/mongodb-acid-transactions-with-java/</link><pubDate>Wed, 23 Jul 2025 14:39:45 +0000</pubDate><guid>https://foojayio.github.io/website/today/mongodb-acid-transactions-with-java/</guid><description>&lt;p&gt;A database is constantly under pressure. Real-time applications, exponential growth of data, and multiple operations may hit the system at once. Without coordination, this can lead to race conditions, conflicts, and ultimately, the dreaded inconsistent data! To address this, MongoDB supports &lt;a href="https://learn.mongodb.com/courses/mongodb-transactions?utm_campaign=devrel&amp;amp;utm_source=third-party-content&amp;amp;utm_medium=cta&amp;amp;utm_content=java&amp;#43;acid&amp;amp;utm_term=tim.kelly" target="_blank" rel="noopener noreferrer"&gt;transactions&lt;/a&gt;
.&lt;/p&gt;
&lt;p&gt;Transactions let us group multiple operations together so they either all succeed or none take effect, a concept known as &lt;a href="https://www.mongodb.com/docs/manual/reference/glossary/#std-term-atomic-operation?utm_campaign=devrel&amp;amp;utm_source=third-party-content&amp;amp;utm_medium=cta&amp;amp;utm_content=java&amp;#43;acid&amp;amp;utm_term=tim.kelly" target="_blank" rel="noopener noreferrer"&gt;atomicity&lt;/a&gt;
. MongoDB&amp;rsquo;s document model already provides atomicity at the single-document level, which covers a lot of use cases. But when you need atomicity across multiple documents or collections, transactions are the answer.&lt;/p&gt;</description></item><item><title>How to Make a RAG Application With LangChain4j</title><link>https://foojayio.github.io/website/today/how-to-make-a-rag-application-with-langchain4j/</link><pubDate>Thu, 17 Jul 2025 20:42:12 +0000</pubDate><guid>https://foojayio.github.io/website/today/how-to-make-a-rag-application-with-langchain4j/</guid><description>&lt;p&gt;Retrieval-augmented generation, or RAG, introduces some serious capabilities to your large language models (LLMs). These applications can answer questions about your specific corpus of knowledge, while leveraging all the nuance and sophistication of a traditional LLM.&lt;/p&gt;
&lt;p&gt;This tutorial will take you through the ins and outs of creating a Q&amp;amp;A chatbot using RAG. The application will:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Retrieve data from a MongoDB Atlas database.&lt;/li&gt;
&lt;li&gt;Embed and store documents as vector embeddings.&lt;/li&gt;
&lt;li&gt;Use LangChain4J to query the database and augment LLM prompts with the retrieved data.&lt;/li&gt;
&lt;li&gt;Enable secure, scalable, and efficient AI-powered applications.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you want to see the completed application, it is available in the &lt;a href="https://github.com/mongodb-developer/langchainrag" target="_blank" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;
.&lt;/p&gt;</description></item><item><title>Your Complete Guide to Diagnose Slow Queries in MongoDB</title><link>https://foojayio.github.io/website/today/your-complete-guide-to-diagnose-slow-queries-in-mongodb/</link><pubDate>Tue, 17 Jun 2025 04:06:04 +0000</pubDate><guid>https://foojayio.github.io/website/today/your-complete-guide-to-diagnose-slow-queries-in-mongodb/</guid><description>&lt;p&gt;MongoDB is built to be fast. The real win comes from knowing how to keep it that way, even as your app grows and your data gets more complex.&lt;/p&gt;
&lt;p&gt;This tutorial is for those developers and engineers who want to understand how MongoDB behaves when queries or writes slow down. We&amp;rsquo;re not here to hand you indexing tips or premature advice about schema design. We&amp;rsquo;re here to walk through the actual tools MongoDB gives you to observe, measure, and reason about query performance, before you start optimizing anything.&lt;/p&gt;</description></item><item><title>Understanding BSON: A Beginner’s Guide to MongoDB’s Data Format</title><link>https://foojayio.github.io/website/today/understanding-bson-a-beginners-guide-to-mongodbs-data-format/</link><pubDate>Thu, 22 May 2025 08:05:06 +0000</pubDate><guid>https://foojayio.github.io/website/today/understanding-bson-a-beginners-guide-to-mongodbs-data-format/</guid><description>&lt;p&gt;&lt;strong&gt;When working with MongoDB, it&amp;rsquo;s easy to think you&amp;rsquo;re dealing with JSON. After all, the queries, documents, and API responses all look like JSON. But MongoDB is not storing JSON. It&amp;rsquo;s storing BSON&amp;mdash;a binary format designed for efficient storage and fast traversal.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;BSON (Binary JSON) is more than just a binary version of JSON. It introduces additional data types like ObjectId, Decimal128, and Timestamp, allowing MongoDB to handle more complex data structures and ensure data integrity. While we might rarely interact with raw BSON directly, understanding how MongoDB stores and processes BSON documents can help us write more efficient queries, handle data conversions properly, and debug unexpected behavior.&lt;/p&gt;</description></item><item><title>Building a Real-Time AI Fraud Detection System with Spring Kafka and MongoDB</title><link>https://foojayio.github.io/website/today/building-a-real-time-ai-fraud-detection-system-with-spring-kafka-and-mongodb/</link><pubDate>Wed, 14 May 2025 14:30:08 +0000</pubDate><guid>https://foojayio.github.io/website/today/building-a-real-time-ai-fraud-detection-system-with-spring-kafka-and-mongodb/</guid><description>&lt;p&gt;In this tutorial, we&amp;rsquo;ll build a real-time fraud detection system using MongoDB Atlas Vector Search, Apache Kafka, and AI-generated embeddings. We&amp;rsquo;ll demonstrate how MongoDB Atlas Vector Search can be used to detect anomalies in a stream of financial transactions by analyzing a user&amp;rsquo;s transaction history and identifying suspicious behavior based on LLM-generated embeddings.&lt;/p&gt;
&lt;p&gt;Our solution will monitor MongoDB Change Streams using the Java synchronous driver, triggering vector searches on each new transaction to detect potential fraud. While this approach works well for our demo, and for many use cases, we&amp;rsquo;ll also discuss its limitations. Throughout the tutorial, I&amp;rsquo;ll cover alternative strategies to optimize performance, whether you need higher transaction throughput, faster fraud detection, or a more scalable architecture.&lt;/p&gt;</description></item></channel></rss>