Singleflight in Go: Optimize Concurrent Requests

Optimizing Concurrent Data Fetching in Go with singleflight When multiple requests for the same resource arrive simultaneously, you have a choice: make redundant calls or coalesce them. I’ve hit this pattern enough times that Go’s singleflight package has become a default tool in my kit. Let’s dive into how singleflight can optimize concurrent data fetching, using the example of fetching currency exchange rates in a financial application. All code examples from this essay can be found at this repository . ...

November 13, 2024 · 10 min · Aleksandar Nesovic

Modular Monoliths - Boilerplate

From Theory to Practice It is recommended that readers familiarize themselves with the principles outlined in the article Modular Monoliths - Simplified before delving into the practical example provided in this follow-up piece. This article will explore a specific implementation of a modular monolith architecture, utilizing a clear separation of handlers, services, and repository layers. The accompanying GitHub Repository serves as a reference and starting point, providing a boilerplate structure that can be easily adapted to suit the specific needs of your project. ...

January 25, 2023 · 4 min · Aleksandar Nesovic

Modular Monoliths - Simplified

How to Achieve More with Less Complexity What is a Modular Monolith Architecture? Modular Monoliths present a unique approach to software architecture, balancing the robustness of monolithic systems with the scalability of microservices. As a result, it allows for increased scalability and maintainability while avoiding the complexity and overhead commonly associated with microservices. In this essay, we will explore the advantages of utilizing a modular monolith architecture in Go and provide guidance on implementing it in your projects. ...

January 23, 2023 · 5 min · Aleksandar Nesovic