Smitha Kutty
Smitha Kutty

Reputation: 77

Architecture Choices

I have got an architecture to be chosen based on my requirement assignment. So, the requirement is to build a web application for the common man , similar to book my show application.

Also, the application should be available via intranet for admin users to manage requests. Also, it is necessary that i use open source technologies to reduce cost, unless absolutely necessary.

Keeping all these points in mind, i would say i would need the following

a) I would go for a n tier architecture.

b) For presentation tier:- can go with JSP/servlets+JSTL or should i go with JSF

c) For business tier:- Spring MVC or EJB3.0?

d) DAO:- Hibernate/JDBC as DAO layer.

e) Database:- SQL server or Oracle 10g.

Could you please pore in your points so that it can guide me further to go with the right technology and architecture?

Thanks for your expert help in advance.

Upvotes: 1

Views: 302

Answers (2)

Deepak Arora
Deepak Arora

Reputation: 61

My first post here so request your indulgence. Let me try and answer your questions point by point:

  1. n-tiers architecture - definitely - a UI / REST services / Data store
  2. Presentation tier - I would recommend using an open source Javascript library like Prime NG. Gives you the ability to create great UIs coupled with the fact that they can cleanly call the REST services
  3. Business tier - either Spring boot REST services or JEE 7 REST services. I would stay away from EJBs. Using REST will give you the ability to move to micro services tomorrow
  4. DAO - Hands down JDBC or a very thin wrapper over JDBC for me. Hibernate in my opinion will only complicate things and ability to scale. A well designed JDBC implementation will outperform Hibernate plus will also provide you with an ability to separate optimization concerns
  5. Database - if cost is not a concern Oracle 10G. No comparison to Oracle when it comes to RDBMSs. Note that these are not open source. If you want to go open source Postgresql / MySQL could also be considered. Here I would also recommend you to look at noSQL options like MongoDB / Couchbase

The things I would stay away from are too much of annotation based configuration (do what is really required but not just for the heck of it) or a straight jump into micro services carried to the extreme which may lead to a very difficult production environment to run and manage. Do do make sure that your code reads like a story and tells the business logic rather than only looking like a technology specification. All the best.

Upvotes: 0

luboskrnac
luboskrnac

Reputation: 24561

I am not going to tell you what to choose, but give you some advices how.

First of all, Just want to slightly change your considerations:

  • b) You should include Spring MVC into this point, because it is abstraction layer on top of servlets and can be easily combined with JSP. BTW Spring guys nowadays prefer Thymeleaf templating engine, so maybe something to consider also. You also definitely want to go for security framework like Spring Security (not sure how it cooperates with a Java EE stack)
  • c) You probably want to consider Spring IoC (Spring Core) vs EJB3.0. There is also Google Guice framework.

I would suggest you to build your decisions on these factors

  1. What is your and your team expertise with certain technologies
  2. What is your OPs team experience with (Full Java EE app servers or lightweight servlet containers like Tomcat or Jetty)
  3. Is your project going to be bigger monolith (look at advantages of full Java EE app servers) or set of micro-services (look at Spring Boot and it's advantages, also look at Microservices architecture pattern advantages and also PITFALLS -> because it is very popular architectural pattern nowadays, but can lead to various problems like performance problems or production environment complexity)
  4. Are you planning to use Spring related projects (e.g. Spring Data family for connection to different Social networks)
  5. Do you think you'll need to use cashing on app server (consider Hibernate with second level cache)
  6. JDBC vs Hibernate is huge architectural decision, so better read about pros and cons deeply. If you choose JDBC, you probably want to go for Spring JDBC and most importantly some querying framework like JOOQ or QueryDSL.
  7. If you'll go for Hibernate / JOOQ / QueryDsl, you should be safe to choose any SQL DB. Because these frameworks abstracts differences if you avoid using custom features of certain vendor. Said that it is also crucial to take a look at your OPs and admins expertise when choosing DB. If you want to save money on licenses you probably want to take a look at PostgreSQL (enterprise grade open-source DB)
  8. Do you have some enterprise level architects around to consult these decisions with. Clarify early if your app needs to be integrated with some wider enterprise environment. In this case you probably want to take a look at Spring Integration or Apache Camel.
  9. Are you going to have some background regular processing that is not triggered by user requests? Take a look at Spring Batch / Java EE 7 Batch spec.
  10. MOST IMPORTANTLY DO SPEAK WITH YOUR TEAM ABOUT THESE DECISIONS TO INVOLVE SENIOR AND PASSIONATE TEAMMATES. You don't want to hear complaints later.
  11. Don't be afraid to make final decisions. Lack of decision is MUCH WORSE than bad decision.

(I am Spring guy, so I apologize if this sound like your direction should be Spring stack. The Java EE stack definitely has alternatives for most Spring modules, so do your own deep research).

Upvotes: 1

Related Questions