Use Servicestack webservice for server to server message exchange scenario

I have an external Servicestack installation with web services that collect data from different mobile apps and uploaded files and need to synchronise it with an internal intranet server.

The intranet server is deeply protected by firewall and organisation policies.
I think this is a pretty common scenario where messages and brokers could be used, something like Rabbitmq or Nservicebus.

As the data is only to be sent from one external server to the intranet one in unidirectional and asynchronous way I was thinking not to add another layer of indirection to the architecture and just use the web services exposed by Servicestack also for server to server communication.

The approach would be like:

  • An intranet windows serivce would poll regularly and at different intervals the external web service to know if there is new data to get (maybe from a certain point in time)
  • The web service respond with the list of the new data and files
  • The windows service would iterate with calls to gett all the data to be inserted in the intranet and download the uploaded files.

What are the risks of this approach? Would be better that the external webservice would respond only a huge response with all the data and file in it

I know this is not properly related to Servicestack but more on architecture so if it is better to post it on StackOverflow please let me know and I will delete the post.

It’s definitely ok to post here, but I’ll let other people weigh in on non-ServiceStack support questions (too busy working on the next release).

1 Like

I would just use one call for the internal service to the external service: GetDataFile.
If there is a file available, return it and move it to the ‘done’ folder.

The interntal service would just call again if it got a file and as soon as it did not get a file, wait for the next cycle. This way there is little to no extra logic in the interal service and it keeps the number of calls to a minimum.

On a sidenote: I wonder why the internal server would be allowed access to the external server directly. You may want to completely abstract this with an intermediate system with two network ports and use synchronisation internally on that machine. This way, the internal systems cannot directly connect to the outside and vice versa.

1 Like