Search code examples
javaspring-bootdockermicroservicesnetflix

Microservices with Spring Boot, Netflix, Docker, Maven. How to organize development?


I'm new to Microservices and I chose the following stack as an exercise.

  1. I want to build some apis with Spring boot, Netflix apis and Maven
  2. Dockerize the microservices so that I can deploy in Cloud Foundry but also on Kubernetes or AWS
  3. Build a PWA with a javascript framework and call those APIs

A bit ambitious..

I get that microservices will be deployed separately. I get that web app will connect to the gateway first, etc..

But as a new developer who starts to work in a team who's developing a search-product api for example, will I open my STS, clone the only repository will the microservices projects (including gateway, registry, config server) OR will I clone the repository which contain the spring boot project I need to work on? In the first case it seems it make sense to have a parent pom project with modules and maybe share some jars.. dunno..

I think I might have found part of the answer I was looking for Microservices: How to store source code of many microservices?


Solution

  • These questions are amazingly broad. I think first you should do a bit of reading...

    1. Domain driven design by eric evans
    2. Building microservices by sam newman

    Next you should understand a bit of architectural design patterns. Check out event sourceing, CQRS, APi gateways, Service registration, and general cloud patterns. This list could go siginificantly longer but it's a good start.

    Then basically your api gateway should be where all the frontend calls come to and go through security, monitoring, and routeing.

    The api gateway will contact the service registry which is eureka and get the location information of the service your routeing to.

    All your service applications will register with eureka and pull there configurations from the config server.

    If you are building this as a production application you will most likely have all these applications in different repositories. To facilitate all the pieces of an architectural stack most larger companies will have regulatory and business guidance which means separate teams of people will handle each piece in some cases or they will handle vertical slices in other organizations. If you were in a startup environment you might be asked to handle the full architecture.

    Imagine for a second that you are a single employee at a company that has potentially hundreds of internal API's would you build all the services and manage the monitoring, routing, and security at the API gateway probably not.

    I think that if you are simply just learning the patterns and the implementations, that putting it in a single project is much simpler for you as a single developer.

    These are my thoughts on that. You can easily find tutorials to explain how to build these patterns and applications but they normally just show you how to get started. I would suggest if you are doing this to learn that you pick some fun(fake) business idea and start building/learning!

    Hopefully this is helpful good luck!

    PS: check out sleuth and zipkin for distributed tracing