Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
mt3o19136yOh my. 1k requests per second and you want to go with php? Seriously? Java is perfectly fine with such loads. Not to mention, you want to do total rewrite grin the grounds up and change the whole technology stack. If you really need to drop jdk, choose nodejs, but you REALLY should stay where you are if it's a critical application.
You can do a graceful shift from JSP to API+SPA with your current architecture.
Depending on the complexity of the app, if you have deeply interconnected everything, use angular. If you can slowly extract more and more components, use react. Keep in mind that react itself is just "view" in "mvc" and needs other libs to work.
It's easier to shift to react gracefully, without rewriting your app from scratch. On the other hand it's easier to maintain architecture with angular. -
Java will stay where it is and JSP will be replaced with React or Angular. But to connect the API I will need a backend language to send and receive CURL requests. So I'll need to select from PHP or NodeJS.
One more thing is there any alternative to CURL to make the transfer faster. @mt3o -
mt3o19136yBrowser (react or angular) <-> cloudflare <-> your loadbalancer <-> tomcat (spring or something else)
In the controller you have:
A RequestMapping("/myEndpoint")
A ResponseBody
HashMap<String, Object> endpoint(Locale locale){
...
}
Note: A are used instead of @ for annotations to avoid calling users on devrant.
Note: I'm typing this on my mobile phone.
Spring, with help of Jackson, takes care of converting your hashmap into JSON which is fetched by your javascript. The hashmap contains whatever was pushed into the old Model for the JSP.
CURL is a tool and library that makes http requests.
What do you want to do with it? And where do want to put PHP or Node? Between loadbalancer and tomcat? It's pointless. -
Well the frontend is going to be written in a different Server. So to connect the APIs, I need cURL or similar.
-
mt3o19136yOk, i reviewed your cv and have an idea of what you might want to do. Your want to use it for testing purposes? If so, use Insomnia or Postman or SoapUI to fetch requests.
You can establish e2e tests on javascript along your frontend code to automate it.
Not to mention using unit and integration tests in Java.. Junit and Spring are awesome tools.
For development, i'd suggest sticking to CLI. Learn bash (you have no experience with it, right?) and use httpie (or wget) together with jq or other json-friendly grep-analog. -
mt3o19136y@reflexgravity there is no valid point in pushing this to separate servers. Your js code can be cached by cloudflare or akamai, its static, after all. Adding another server to be used as a proxy adds useless workload with no real benefits. Perhaps you can set another tomcat or even nginx to serve static files (and be able to deploy them apart) but that's all.
-
@mt3o This is for production. Well I do have experience with bash, I'll take your suggestions. Thanks a ton. I have a better clarity now.
-
mt3o19136yFor production - just don't :) tomcat hidden behind cloudflare or akamai handles things better than anything else. And for non-static stuff, you have to pass the request to the tomcat one way or another.
You can establish a simple benchmark and present it to your management to explain them that what they want to do is just adding overhead. -
@mt3o ok. But due to the complex and dynamic UI, handling it with jQuery is messy. So that want to use a frontend framework.
-
mt3o19136y@reflexgravity you say frontend framework, in the means of react/ng.
I feel you. Totally. I have complicated workflow on my end too. And we had to tons of refactoring to achieve what we have right now. -
@mt3o Yeah. We are now rendering the UI from server-side which is slower and it's making the clients annoying. So to improve this we have decided to take this step. Anyways I have decided to use AJAX (over the proxy server approach) to connect the APIs and use nginx to serve the frontend.
-
mt3o19136y@reflexgravity can you make some load tests before and after rewriting everything and share the results? I'm curious of your performance gain.
Related Rants
Well, My firm has a CRM which is built on JSP and Java. They want to upgrade the frontend by using a modern technology. Which one is a great choice React or Angular?
For the backend, APIs need to be integrated and I need to select from PHP and NodeJS. The traffic right now is 100 hits/second and is expected to increase upto 1k/sec in 6months.
What is the best choice for the frontend, backend and I need to select a HTTP request client too.
question
technology confused
nodejs
reactjs
choice making