Question

I have the following questions

[1]. There is a management system that requires CRUD operations most frequent. For example int GetUserLimit(), List GetUserList(), int AddNewUser(User user), bool DeleteUser(), IsAuthenticated(string username, string passwrd)

For the functions listed above, the web application may want to wait for some return.

In that case, whether it is better to provide web services directly for web application, or we do not expose those web service, but rather web application communicates with EBS via request/reply pattern?

solution 1:

http://i.stack.imgur.com/cIRUR.png

solution 2:

If web application "sends" a command to one component A, then component A replies a message to a certain queue called "webmsgqueue" or push a message to a nosql server. And web application uses ajax polling method to check the mssage in "webmsgqueue" or the nosql server.

http://i.stack.imgur.com/F7qTs.png

[2] If data we are querying or uploading is large, is it better to choose web service ?

Was it helpful?

Solution

If I understand your question correctly, you're asking whether it's good to implement a CRUD API with a service bus, with the possibility that fairly large amounts of data must be transferred, and including the ability to determine whether some user's credentials can be authenticated.

I don't think I would ever do that - it sounds to me like you're better off using a synchronous API that is good at transferring data ("synchronous" in the sense that all operations have a 1:1 request/response correlation, even though your client library may still have an asynchronous way of making synchronous calls - it might even provide the ability to do efficient async/await).

Another question is whether you're actually better off ditching remoting alltogether, providing the ability for your web application to perform the CRUD operations directly against your database. You can still make your application decoupled by hiding your implementation behind an interface.

If you're worried about temporal decoupling, I'd say you lost the temporal decoupling already when you decided to expose an API with a return type different from void ;)

Does that make sense?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top