0

Here I have an interesting case I recently knew about. Let's say a small software shop creates mobile and web apps that make requests to a web service. The software is sold to single users and also to third party companies. Initially all users made requests to this single endpoint, but then some client companies demanded to host their own server and database instances in their own servers.

At the beginning these companies were the exception, so a custom copy of the app was compiled with their custom URL, while the regular version of the app used the original URL. But this soon turned out to be unmaintenable as the number of such companies grew and releases of the client app became more frequent.

So there is now a first ws (hosted by the developers) with a user database that contains the actual service URL each user would need to connect to, and there's a single version of the client app that everyone uses and is compiled with the first WS's fixed URL. When a user logs in, the app makes an http request to retrieve the final WS URL for the user. This second URL will be different depending on whether the user needs to use the in-house hosted WS or it belongs to a self-hosting client organisation. From that point on the app uses that URL for subsequent requests. This is nice for managing companies, as you can for instance quickly cut the service to a company that does not pay, but on the other hand it generates too much traffic to the first server.

How would you solve this in 2016? I'm not a sysadmin or network expert, but it looks to me this is a handcrafted solution to a routing problem, and the first server can be replaced with something else. All it is needed to determine the WS URL is the user's organization name. The final server side software is the same and the databases are similar. Maybe this could be solved with a load balancer? I know Amazon EC2 and Azure support load balancing, but here we are talking about redirecting to dedicated servers each one different and hosted by third party companies. Maybe something could be done with DNSs?


UPDATE

Looks like a reverse proxy can do the job (nginx?). How would you route to each backend based on the organizations name?

Mister Smith
  • 161
  • 7
  • Why would that be too much traffic? What is the performance problem you are having? Remember that we are here to solve _real_ problems, not hypothetical ones. – Michael Hampton Jan 13 '16 at 14:36
  • @MichaelHampton It generates more traffic to the (admitedly crappy) first server as users with a corporate license need to hit the first server to get to their backend. Compiling taylored binaries with each organization's URL avoided this problem. And these companies do have a considerable number of users. – Mister Smith Jan 13 '16 at 14:52
  • You are doing all the right things? Caching etc? – Michael Hampton Jan 13 '16 at 14:53
  • I don't think they are. Right now it is a single web service accessing to a single users database. I think this server could be replaced with a networking mechanism of some sort (maybe a reverse proxy?) – Mister Smith Jan 13 '16 at 14:57

0 Answers0