0

I have a spring boot application with 3 tier architecture client->Application server(Spring boot application)->DB. I want to split the current app server into two, one for handling the client request/response and business logic like controllers and services only. Another one is for only communicating with DB like DAO,and spring data jpa's only.

These two servers will communicate through REST api.

I don't know this approach is good or not. Please suggest.

Lisa_
  • 19
  • 1
  • 11
  • 1
    Any reason why you want to do that? What's the reasoning behind your thought? – akortex Jun 14 '21 at 13:12
  • what would you convert a DB call repos into a rest call first. Sending DB call over to another server will put into another problem like how will you manage rollback and commits between multiple rest call to DB – gladiator Jun 14 '21 at 13:16
  • @akortex91, I just wanted to keep one server which is only dealing with DB. accepting request from multiple app server and provide resonse as json format – Lisa_ Jun 14 '21 at 15:47
  • @Lisa_ as mentioned by the another comment, this solution is quite suboptimal and only adds an unnecessary complexity. As mentioned above, you will have to manage transactions manually which is quite difficult. On top of that implementing all this using REST is not durable. I do not see the point in something like that. Suppose that your various applications need to share the same DB layer it would be best to simply have them connect to the same database directly. – akortex Jun 14 '21 at 18:14
  • @Lisa_ I don't believe you answered akortex91's question, so let me rephrase it: what is the *problem* you're trying to solve? Your question feels like an XY problem – crizzis Jun 20 '21 at 20:11

0 Answers0