0

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:

https://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.

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

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

1 Answers1

0

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?

mookid8000
  • 18,258
  • 2
  • 39
  • 63
  • sorry,as i try to make this clear to you, so i update my question. from your reply, it is better to expose web service for the those CRUD operations, as most of use cases may want the web application to wait for some return. – markchenwd Jan 22 '14 at 13:47
  • I hear one term today -'CQRS', can you talk about it with rebus? – markchenwd Jan 22 '14 at 13:57
  • well, CQRS is kind of a big subject - I suggest you Google it and read what e.g. Udi Dahan, Greg Young, and Rinad Abdullin say about it - there's different ways of accomplishing CQRS, e.g. you may/may not do it in an asynchronous (a.k.a. "eventually consistent") fashion, you may/may not use event sourcing, etc. – mookid8000 Jan 23 '14 at 06:54