We are trying to move (slowly) into Microservices architecture from our current monolithic based architecture. I've done my research on microservices architecture and would like to get some feedback on the architecture I've described below from the community.
Information about the application
It's a web application used internally with around 10-20 users. The application shows reports in charts and tabular format and export functionality to pdf/xsl/csv. In time the application might grow and and more functionalities will be added.
What I had in mind is to have two Microservices (MS) serving different purpose a Report (MS) and Engine (MS).
Engine consists of the following:
Major Libraries: Spring Boot, Spring Rest, Maven, JDBC Template
Architecture: DAO, Service and Rest Controller
Application Server: Tomcat (embedded)
Short Summary:
DAO layer uses JDBC template because of complex SQL queries which will be passed on to Service for any business rules or other logic. Rest Controller which takes data from service layer and serves as the interface between Engine and Report
Report (MS) consist of the following:
Major libraries: Spring Boot, Spring Rest, Maven, JSP, JavaScript/Jquery/ Architecture: Service, Controller, Front End technologies Application Server: Tomcat (embedded)
Alternative Technologies for Report (MS):
AngularJS 2, NodeJS, JavaScript/Jquery/HTML/CSS
Short Summary:
Service layer requests information from Engine(MS) via REST API, data will be passed on to Controller and served to appropriate view (combination of JSP, JavaScript/jquery/css/html etc).
Also considered using AngularJS 2 or NodeJS and JavaScript to replace Java Technology and Tomcat Application Server as soon as I get some feedback.
Database Facts
- external / separate server
- currently evaluating MySQL, MSSQL
- contains lots of data average 10K per day per table
- properly designed (normalization/indexing etc as claimed by DB Admin)
- queries are extremely long 8 A4 with proper indentation, better off as stored procedure or use jpa data?
So far I have identified high level pros and cons with this design, appreciate if anyone can add more.
Pros
- Report MS using Java/JavaScript/JSP can be easily replaced easily by any Front End technology without affecting Engine MS.
- Report MS is loosely coupled with Engine MS and can use other REST API source.
- Spring Boot reduces a lot of configuration and wiring of beans plus it comes with embedded tomcat and DBs.
- Using Maven for build and library management.
Cons
- Network latency between Report and Engine MS since it has to traverse the network to transfer data.
- Extra code complexity writing in Java for Backend Services(Engine MS) and JSP/JavaScript or Angular JS for frontend.
- DAO Layer hard coding queries as strings of SQL query difficult to debug.