EJB3 Remote vs Webservices, performances?

I plan to use webapp, where everyone who uses it will have a client that will run calculations on their computer (because these calculations cannot be performed on the server, the load is too big ...), and then send the results to the server.

I assume that there will be many people in my application, and why I wonder if my architecture is good and if I can handle thousands of people.

I plan to provide a remote EJB through JNDI with the Glassfish server, so 1000 people can use these EJBs at the same time (I think maybe 5-50 requests / second) to retrieve the data needed for local computing, and then send the results ...

Is exposing EJBs expensive for many customers? Would it be better to use webservices, rmi, another solution?

Would you recommend me a different architecture for what I'm going to do?

+4
source share
3 answers

First, from a purely architectural point of view, EJBs are used to create distributed applications, web services are an integration technology, and they do not compete with each other. In your case, EJB would be a natural choice (we are talking about EJB3, right?) And session beans scale is very good.

Secondly, if the server code is used only to extract data from the database and to save the results after calculation on the client side, then the application server will most likely not be the bottleneck, the database will be. In other words, nothing to worry about.

So, since your clients are all 100% Java clients, I just expose a stateless beans 1 session and avoid the overhead of SOAP / XML marshaling / swinging and writing WSDL (if one day you need to expose your services to web services , it's still possible and easy).

1 Using JPA or something else to access data is up to you.

+7
source

My 2p is that offering a Webservice or XML / http client is simpler and more standard from a clientโ€™s point of view. One advantage is that they donโ€™t need to be Java clients if it is a SOAP web service.

+1
source

I read on the forum that it would be nice to get objects on the client, because the proxy server is stored and generates traffic

One guy tested a 4021 serialized list of 300 objects generated by 3.6mo network traffic in wirehark, but if you use EntityManager.clear () to disconnect entities or use pojos dto to return to remote functions, then this is normal :)

0
source

Source: https://habr.com/ru/post/1304453/


All Articles