Micro service architecture for Angular2

Viewed 1049

If we take an enterprise angular 2 web app it has several modules(screens) such as Customer management, Reservations, Booking management, Reporting and etc....

What we normally do is we create common components in a component library and use them on main angular application. The main angular app contains all the modules(screens) with REST API integrations(assuming backed is REST). When app is getting bigger & bigger compile time and rendering consuming more time & resources. Also if one particular area is having a issue we cannot have a release since all are bundle to one app.

As you all know Micro service architecture is a method of developing software systems that has grown in popularity. So, my question is can we apply same architecture for these type of enterprise angular 2 apps?.

It is like this. We have a customer management as a separate angular app. Again Booking management is another angular app. Reporting is another app. These apps are going to be separate war files when deploying to the web server.

Once we have developed such loosely coupled apps this will reduce the over head of project size, compile time & resources. Also this will make unit testing more easier. Particular set of developers are only considering the only one unit of the module.

Kindly share your expert thoughts about this

Thanks.

1 Answers

Yes, you could develop each module into its own application and release independently, you just need to make sure that you have a way (from menu for example) to go from one application to another application, if you host your all your applications on the same port, you will have a single token that can be shared by all applications, and you can seem less move user from one application to another as in portal experience.

You need to manage your state properly, if you are state baked into Session Storage (Master Data), you can get the experience you are looking for.

If you host your applications, with different URLs, you will not be able to share the token, instead you would have to use an approach how Google authentications works at Gmail, youtube etc

Related