3

I am migrating enterprise web application using spring MVC and spring boot which currently working in core .Net technology. In Java I am using microservices and postgresql in backend and using angular in front end. This application actually consist of 18 spring MVC project with almost 70-75 end points. And we have upto 15 tenants using this.

Now we are using Kubernetes and Jenkins in our own On-premise server to deploy the development version. So We are facing issue that if multiple login making at same time, we facing lot of dely. Previously we thought that it is because of delay from our server. But later we understood that because of greater number of api calls from angular making delayed operation.

Confusion in Future Implementation Using Multithreading

Now we are thinking to implement the all backend spring boot microservices using multi-threading. So to implement scalable application Here my confusion is that,

  1. Is multithreading will resolve my delaying operation issue ?

If it is not a good move , which alternative idea available for me? . I am new to designing scalable application. So totally confused here. Can anyone suggest any solution to my problem or suggest any good tutorial to resolve this please?

Update - Information of Current architecture

  1. Running Pods - For testing purpose only we used Kubernetes for deployment. And 18 pods for each microservice project plus additionally 1 pod for running angular app.

  2. APIs - from angular application, which will hit the backend microservices. At one time upto 18 tenant customers may access application. Ie, almost 200 surveying customers may parallelly access.

  3. Microservice dependency- When Angular calls each microservices , it will call another api internally for authentication/authorization purpose (security api). I don't know this is will make any problem to my system.

  4. Deployment On Kubernetes Cluster(AWS EKS/On_premise) - is yet to get permission from org. Since AWS EKS will make a additional cost. So I have to look for deployment without K8 Cluster is also one concern to me.

  5. Surveying page makes one complex page in application which have 4 to 5 tabs and each tab saving functionality need to do independently. Each save operation has its own working time. Since multiple tables are joining and save op takes a while to finish in each tab.

3
  • 1
    Do you have currently a single deployment on Kubernetes? You can first try to introduce multiple pods. For example up to 15 which is your number of tenants. This should help to mitigate the current bottleneck. And it would be with no code change. Commented Jul 24, 2023 at 9:02
  • "Previously we thought that it is because of delay from our server. But later we understood that because of greater number of api calls from angular making delayed operation." It's still your server, even though we are not necessarily speaking about a large slowness, but lots of smaller slownesses that accumulate. Please edit your question and provide at least conceptual information about what requests are being sent, because the reorganizing of those will be necessary and we need to have some information in order to figure out improvements for you. Commented Jul 24, 2023 at 9:36
  • Thank you for your response. I tried to give little bit more idea about the structure off app in my update. I hope this will help to understand the concern. Please go through my update when you gets some time. Commented Jul 24, 2023 at 10:47

1 Answer 1

0

Issues like this normally takes weeks och even months to solve, even for a team that has lots of experience.

If your problem is the number of API-calls from the client, start with investigating if the client can do those calls in parallel and not in sequence.

If that is not possible, investigate if you can make a new API endpoint that in its turn calls the other endpoints (or rather the micro services directly) just like the client would. Then let the client call this one API endpoint. That would at least remove the network (Internet) roundtrip for each call to the API, and replace them all with a single betwork roundtrip from the client.

You can handtail this if the flow is more or less static, or you can use some technology like GraphQL if you see that a hand made solution gets too complex.

Note that this may change caching behaviour, there may come an unpredicted penalty down the road that you need to deal with later. All those API-calls that may have been cached in web or client caches does no longer happen, and are not cached next time they are called... (But for a login flow, this is less likely to happen I would say. )

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for your response. I just updated more information. For reimplementing with graph SQL will not be option for us. I think they just going behind to implement app as a multi threaded asynch app rather than spending cost for deployment. But still need to confirm.
That is indeed option 1, "start with investigating if the client can do those calls in parallel". But if the response from one request is needed to create the next, that is not an option. And if you go for optoon 2, start with something hand crafted, GraphQL is quite an investment. You build that on top of what you have, backward compatible, leaving all the existing endpoints as is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.