0

I have fornt end Web application written in JSF with Richfaces. Its a kind of dashboard application. We are trying to move this in Angular 2 with Spring Boot rest api. I want to write microservices where each functionality would be independent. There are total 10 functionality so i will write 10 different rest services and each one would have its own build process. But i am confused with fornt end part. Should i create separate artifacts or separate build for each UI as well ? Or should i bundle in each respective rest api? how should i take care of front end part in microservices?

Dead Programmer
  • 123
  • 1
  • 5
  • 14

2 Answers2

3

The decision depends on organizational aspects (See another answer about the essence of microservices). So you have to ask: Will you need multiple separate teams for the frontend parts? Will they be separate from the backend service development teams? In some organizations the service development teams would also provide front end components and then a separate dedicated UI-team would use these components and glue them together to create the seamless user experience. In other organizations it makes more sense to have separate teams for backend and anything UI related. So there could be a UI team for each UI component and then one for the integration/final UI. In general the larger the project size the more component-ization you will need to do to keep the teams a 2-pizza-size. And be ready to split teams/components as needed when your project grows.

Oswin Noetzelmann
  • 9,166
  • 1
  • 33
  • 46
  • Thanks for quick reply. In my case we dont make frequent changes in UI side but at the same time we build new functionality within each 3 months. – Dead Programmer Feb 09 '18 at 07:10
  • 3 months is still a relatively fast release cycle compared to many larger monolith developments. With smaller teams you can achieve even faster releases if that is desirable in your domain. – Oswin Noetzelmann Feb 09 '18 at 07:41
  • Good luck with your project, btw. – Oswin Noetzelmann Feb 09 '18 at 07:59
  • So should i maintain different build for UI nd Service and should i bundle together? – Dead Programmer Feb 09 '18 at 08:00
  • Different build / deployment for sure, but you may still want it to be the same team, if team size is small. You probably want to automate build/test with CICD anyway. – Oswin Noetzelmann Feb 09 '18 at 08:02
  • Sure...CI CD is future plan..Thanks – Dead Programmer Feb 09 '18 at 08:09
  • Ok. Now i have created plan to develop microservices with service and UI all together different. The problem is how feasible it would be to create multiple war files like i have 10 functionality so there would be 20 war files with one for ui and one for service respectively. What about deployment? Should i deploy all in single server or use multiple servers. – Dead Programmer Feb 14 '18 at 08:54
  • Have you looked into containerized deployments yet? For example with kubernetes. In conjunction with a CICD server you can automate deployments, upgrades, etc. with zero downtime. And the split into different services allows you to build/test/deploy each independently. And when you have Angular 2 UI you should be able to just serve static files for the UI. – Oswin Noetzelmann Feb 14 '18 at 09:14
  • We are planning to deploy in WebLogic server not sure how to do with container – Dead Programmer Feb 14 '18 at 10:35
  • Check this out https://blogs.oracle.com/weblogicserver/oracle-weblogic-server-1221-running-on-docker-containers – Oswin Noetzelmann Feb 14 '18 at 10:43
2

The UI shouldn't be bundled with the REST services in a true Microservices based architecture. Because if the UI is bundled with APIs, for every defect fix in the UI, all the APIs need to be rebuilt and deployed. The UI needs to be hosted separately. If the team feels comfortable with Spring Boot, the Angular UI can be bundled in a separate Spring Boot application that doesn't have any API.

Update on 21-Mar-2018 I understand that bundling the Angular GUI with Angular Universal in a pm2 server is a better approach.

Saptarshi Basu
  • 8,640
  • 4
  • 39
  • 58
  • Yes, i also agreed with you. Separate UI service will be easy to manage and scalable. but i have one query regarding this. – chaitanya dalvi Sep 20 '18 at 10:24
  • Yes, i also agreed with you. Separate UI service will be easy to manage and scalable. but i have one query regarding this. Suppose i have one microservice for student information and another service for student result and i created 3rd service for UI and i have to display Student details and their result. In UI service, entity/pojo classes of student info service and student results will be duplicated. because feight call giving me result as Entity/POJO object. Again to receive result of feight call in UI service i need all those Entity/POJO classed. Is there any solution for this? – chaitanya dalvi Sep 20 '18 at 10:31
  • @chaitanya dalvi - Absolutely, you need to keep the common classes in a separate repository and add it as maven (or other build tool) dependency in all other micro-services that need it. – Saptarshi Basu Sep 20 '18 at 16:51