Hey, I'm working on a personal project involving several microservices, and I'm trying to figure out the best way to manage image persistence for product and user profile images using AWS. I'm considering two options: creating a new microservice specifically for this functionality or utilizing a shared library. What do you all think? Are there any other strategies you recommend?
4 Answers
I always tread carefully with shared libraries. They can lock you into a specific tech stack, which might limit your flexibility later on. Consider who will maintain the library too—ownership can get tricky. Sometimes, it might even be better not to have a shared library unless it significantly boosts efficiency or enforces vital patterns. Experimenting with individual teams using templates could be an option as well!
Why go for a microservice approach for a personal project? Usually, you start with monolith and scale out gradually. But hey, if you're looking to learn about transactions between microservices and patterns, diving into this now could be really insightful! Just keep in mind it adds complexity.
Using a shared library could be a great move, especially if all your services are written in the same language. Since you're already leveraging AWS services like S3 for storage, why not utilize that directly instead of spinning up an entire microservice? Otherwise, if you have an established microservice that could serve this purpose, you could choose it to be your 'single source of truth' for images.
For a personal project, I’d recommend sticking with a shared library! It keeps your setup simple and minimizes any network delays that come with additional services. If your project scales later, you can always turn that shared library into a dedicated microservice. Don't overcomplicate things at this stage!

Exactly! It’s all about balancing learning with practicality. Starting small and expanding as you learn will help you build a better foundational understanding.