Skip to content
Spring Data Best Practices

Spring Data and Custom Queries: Best Practices

Spring Data provides a powerful way to interact with your database with minimum effort. Occasionally though, you need to write custom queries to fetch or manipulate data in a more granular way. Below are some best practices you should consider when writing custom queries in a Spring Data repository.

RAG with SpringAI

Retrieval Augmented Generation with Spring AI

In our last post, we looked at enriching the OpenAI model with custom data through function calls. While this technique is useful, it has its limitations and performance trade-offs. Today, we explore a more efficient way of incorporating relevant data into prompts to receive accurate and relevant model responses. Retrieval Augmented Generation, or RAG, relies on preprocessed data that is readily available upon request. In this post, we will build an Extract, Transform, Load (ETL) pipeline that stores a large corpus of weather forecasts and learn how to efficiently retrieve relevant information from a vector store.

Function calling to fill in the gaps in data

Spring AI and Challenges with Function Calling

Spring AI boosts developer’s productivity by providing seamless integration with a variety of AI models. This post explores enriching the generic model with additional data coming from custom functions. This technique known as function calling allows to elegantly tap into a variety of external data sources. However, it comes with its own challenges and considerations.

Stripe Series Summary

Your Cheat Sheet to Mastering Payment Automation with Stripe

More than two months ago, I embarked on a journey to create a hands-on series about payment automation using Stripe. Writing the series has been an enjoyable and rewarding experience, and now the time has come to wrap it up. I hope you’ll find this final post useful. It summarizes all the essential points and provides links to the original articles, which are filled with detailed explanations and code examples. Consider it a cheat sheet that you can use as a point of reference at your convenience. Thank you for following along, and for all your insightful comments.

Smart retries with Stripe

Implementing Smart Retries with Stripe

Network and connection issues can occur for various reasons, such as timeouts or intermittent server availability. Automatic recovery from network issues plays an important role when integrating with any API. When dealing with financial transactions, it’s vital to handle network issues and other errors gracefully. Stripe recommends implementing smart retry logic, especially for payment declines. In this blog post we’ll build reliable retries with exponential backoff and look at how to prevent charging a customer more than once.

Stripe exception handling

Recovering from Failures when Handling Payments with Stripe

In our previous post we explored webhooks as a reliable means to promptly respond to customer activities, such as checkouts, successful payments or failed transactions. Yet, in practice, we often deal with a variety of unforeseen errors that can present a threat to daily operations of an e-commerce platform. To mitigate service disruptions, it’s crucial to understand how Stripe communicates issues. In this post, we explore common Stripe exceptions and learn about managing network and connection issues.