I have a whiteboard question. Technically Id like to ask you about one thing Im not sure in my design, but if you have time for a quick review the rest of the design - thatd be great. Every tip matters to me. SoIm working on a simple game, turned-based (not an action game). Something like chess. For the client, I want to use Xamarin.Forms to deploy it on every mobile platform. It will be clients-server game, so I have to create a server to manage pairing players requesting to find an opponent online. The communication between clients, will be though the server using WCF with netTcp protocol (SOAP). I want to use callbacks, to keep connection with the client. SOAP protocol has it by default in WCF.All in all:Client(s) - in C# and Xamarin.Forms, using PCL lib. iOS, Android andWin MobileServer - ?????, hosting WCF service. Communication - WCFThe questions are:What type of application should be a server? Where should I host my WCF services? Windows Service running on Windows Server?Should I host them in IIS?Where would you recommend me to deploy my server? Like a regular Windows host? Cloud? I have totally no experience with such a project. As client seems pretty straight forward (deploy it to the store), the server app is more complicated. The app itself is pretty easy - I already wrote it as a windows service, but I was just curious how its done in production Thanks for any advice
WCF Server for a mobile apps (Xamarin.Forms)
c#;.net;wcf;hosting;xamarin
I'll try and answer most of your question, but it has many sub-questions, which makes it hard to answer it as a whole.Running and deploymentWe (people here in the company I am working for) typically host WCF services in IIS. It has full support for WCF and provides a ready made eco-system for web-sites and -services. You won't have to implement things like security, binding, etc by yourself, but can concentrate on the core of your services. Anyway, there are some drawbacks. You do not have control over the system to the same extent you have with self-hosted services (i.e. running from a program you've written). If you have some special needs, self-hosting may be the way to go. Self hosted servicesIf you want to self-host your services, you can either go with a program from scratch or a Windows service. In this case I'd recommend a Windows service, since it brings quite some infrastructure with it, e.g. to restart the service or start it along with Windows. There is some overhead, but it's manageable. With a program from scratch you'll have to take care of everything by yourself. This makes sense only in some very special cases (e.g. if the service has to interact with the UI on the server - a Windows service cannot do this). EnvironmentWhen it comes to performance, cloud servers may be worse than a dedicated server. Anyway, it will most likely take some time until you come to that point. Cloud servers are way better to handle, cheaper (most of the time) and you can migrate and scale better. You may experience performance issues with cloud servers when your user base grows, but this does not matter at all if you've burned all your money for a dedicated server that you do not need most of the time. If your app is not very high on data throughput you might go well with a cloud server most of the time (if not always).An additional adviceDon't use SOAP if at any rate possible. You might want to implement a browser based version, too and common frameworks play very well with JSON. You'll be able to ship a web version pretty quickly when all services are readily available with JSON support.