Deploying the same site N times - asp.net-mvc

With our company, we sell a service to our customers,
this is a website which let customers enter some parameters and informations, and then, they can query a web service to get
the previous informations computed. These web sites are hosted on our servers.
We would have on our servers one database per client (dbo.Client1, dbo.Client2...) with the same schema.
And we would like to provide a different url for each client :
expl :
www.client1.service.com www.client1.ws.com/compute
www.client2.service.com www.client2.ws.com/compute
But i'm wondering how to deploy easily the web services and the web site?
Do i have to deploy one web service and one website per client (with different web config)?
And maybe create multiple deployment scripts ?
Or is it possible to imagine one instance of each (web service and web site), listening on several addresses, and creating different
connection string according to the entry point of the request (is it even possible with MVC or WCF ?)
Any other idea ?
I don't know what is the best practice here.
Thank you.

if anybody read that question one day, i solve my problem using multi-tenant solution, which allow me to deploy only one instance of the site.
The site handle the webrequest, and according to the host, connect to different database.

Related

Signalr connecting to multiple Web applications

We're planning on adding SignalR to several differnet web applications. The applications are targeted different aspects of an order. When something happens to an order, all users working with the order across all web applications should be notitfied.
Changes to an order are availible asa message on a servicebus.
We could implement the following logic in all web applications:
Subscribe to a topic (one subscription per webapp)
OnMessage -> Send orderId to hub
Hub would notify clients working on the orderId
Question is: Could we implement all this common functionality in a separate application, and all web apps would reference the same signalr scripts?
All applications live on the same domain, and it would give us a lot of benefit not having to implement signalr in every app.
Good idea, or am I missing something important here?
Edit: Put in other words: I have WebAppA, WebAppB and WebAppC all without SignalR. I'm asking if its possible to create a WebappD that talks to clients in WebApp A,B,C
Second Solution is very good. it will move signalr load (espcially memory) from your main web apps to WebAppD(signalr web app). And all your main web apps will not be dependent to signalr.
Drawbacks: You don't have any authentication on WebAppD. Because clients are authenticated on the other WebApps. You should let the WebAppD knows about orderId. That's why, you should send message to server (WebAppD) from clients(Javascript).
Because of enable cross domain settings, anyone can send message to server. Even they don't need to be connected WebAppA,WebAppB or WebAppC. Even if you solve this problem (virtual path etc), Someone is connected but not authenticated on WebAppA,WebAppB,WebAppC can sends message. Because WebAppD just get the message and it doesn't know this client is authenticated or not so it will serve this message to all others. In Short: Someone can send fake messages to other clients.
So you should share your authentication like this (or some other logic) between your web app and signalr webapp.
Other than this I couldn't see any drawback.

Domains and Multiple Platforms Uploaded to Same Server

I have both an Ionic and a Rails application. I'm currently wanting to push both apps onto the same EC2 instance. Ionic will act as a login section and several other pages. The rails application is intended to be a shopping cart and is only accessible when a user is logged in. I'm confused on a couple of points.
Am I right to believe both apps should be under different subdomains? Can I instead push both apps to two separate servers while still maintaining two separate subdomains? If two separate servers are used, can I expect sessions and localStorage to work across both applications? Thanks!
I assume that you are mixing up many things.
Domains & Subdomains
Let me explain that point with an example :
sub.example.com : first subdomain
other.example.com : second subdomain
Domains and subdomain are pointer to a server ip. Therefore, both example can point to the same EC2 instance.
The domain and subdomain shall therefore not enter into consideration into your analysis.
Webserver & Session Management
I'm not an expert and that point at all, but the magic is performed generaly here to share information & Sessions.
Common Webservers are Apache / Tomcat or even Jetty.
Some person use for session management REDIS too
LocalStorage
Correct me if I'm wrong, but localStorage can't be shared from one site to another.
Your problem resides more into this question :
What webserver am I using ?
Or : How Tomcat7 manage sessions ?
Or : Can I share session from different Webservers ?

ASP.NET MVC - Creating SAAS framework

I currently have a ASP.NET MVC 2 web application and would like to enhance the architecture to support a SAAS model. I plan on eventually building a number of web applications so would like to design the system accordingly.
The goal would be that when a client would hit the following url clientxyz.domain.com they would see an image of all their subscribed applications. This would essentially be a web page with a bunch of application icons. Once a client would click on a icon it would navigate to that actual web app at the following example url clientxyz.domain.com/application_name.
We currently use GoDaddy to host our domain and plan on using a Cloud based iLand server to host our application. We only plan on a few new clients a year due to the nature of our software.
I have a number of questions:
Is it possible to programmatically create subdomains on the fly using a .Net api. I'm pretty sure GoDaddy does not let you do it. So is there another provider that would let me create subdomains via C#. This may be the wrong approach and may not even need to physically create client subdomains. Instead I may be able to accomplish this using url rewriting in IIS/MVC?? If I use rewriting, it would have to satisfy the url requirements mentioned above. Any suggestions/links/examples?
Should I create a separate IIS website for each tenant/client? Or should I use URL rewriting and simply have a single website / application pool? Looks like you can programmatically spin up IIS websites (example: http://www.eggheadcafe.com/tutorials/csharp/d4bba585-b517-4834-8476-ff05b085d86e/iis--create-app-pools-virtual-directories-and-web-sites-c-net.aspx)
Since we are using a Virtual Server on iLand do I simply have to point GoDaddy to the nameserver at iLand.
I would like to automate the entire new client process if possible. To accomplish this, I would have to created the database (probably going to have single db per tenant), populate the global client/tenant table, create admin user account and subscription details in newly created database and create subdomain depending on approach. Am I missing anything?
thanks in advance.

Windows Azure + Asp.Net MVC + E-Commerce

I will developp and host an e-commerce website based on Asp.Net MVC4 (with several SQL Server Jobs).
I think use Azure in order to stay in Microsoft's world and avoid dedicated server management.
The package Web Site Shared with 1 site / 5Go SQL Server Database / 200Go Bandwidth is very interesting with the price based on 12 months.
But i don't know if this configuration is enough specially on the bandwidth.
What do you think of ? Did you use Azure with this type of application ?
Regards,
Guillaume.
If you want to develop E-Commerce application you will have to secure customers' sensitive data i.e. credit cards, address details etc. via secure connections (HTTPS; in many countries this is legal requirement). For that reason you will have to have SSL support.
Azure Website do not support SSL for custom domains. However, they support SSL for *.azurewebsites.net DNS name. So if your E-Commerce application DNS will be, say, my-ecom-app.azurewebsites.net then it's fine. Otherwise, I would not recommend Azure Website solution yet (I am sure SSL support for custom domains on Azure Website will be implemented).
Azure Cloud Services, on the other had, have full support of SSL for custom domains.
One of the really good websites to check Azure features and development roadmap is ScottGu's Blog
Azure Web Sites do not support SSL and I really don't know of any successful e-commerce site that does not run SSL for at least part of the website. If you really want to host your e-commerce on Azure today your only real choice is to run Virtual Machines for your web front end servers and use them for your DB or use SQL Azure.
We developed platform called Virto Commerce that does just that, MVC4 website hosted on Azure. There was also a need for SQL Jobs (indexing, payment processing, cart cleanups and so on) for which we used WorkerRole (instead of WebRole). WorkerRole and WebRole can actually be combined as part of a single deployment, however it is better to use a different instance for worker roles. In our case WorkerRole acted as a scheduler for multiple jobs defined in the database.
The challenge with WorkerRoles however is to make sure they scale well when new instances are added. So the workload needs to be distributed between multiple instances. This is done through the use of queues and blob locks, where each job is now split into two, one that schedules and partitions the work and the second that actually picks up the next partition and completes it.
Hope this helps!
PS: Virto Commerce is now available as an open source project on codeplex, go to http://virtocommerce.codeplex.com

Asp.net mvc app on a shared host move to Windows Azure during peak load possible?

I have an ASP.NET MVC web application that is hosted on a shared hosting account. The site has no issues during regular usage. However the nature of the business is such that for one week out of the month we have very very high traffic. During these high traffic peak load times, my application has several "Service Unavailable".
One of the possible solutions I am looking at is to spin up a Windows Azure web role during peak traffic week and spin it down again after the week is up. (I know exactly when the load is going to be high) Right now, we don't have enough revenue to justify moving the site permanently to the cloud.
My questions is how to I handle DNS. I would like the move to Azure and back to hosted service to be seamless to the user. The user should be able to type my normal URL and go to my hosted site during off peak weeks and to the cloud app during peak week. My guess is to add some kind of CNAME record to the DNS server but I have no idea how to go about doing this. Anybody know of any resources on how to update the DNS so this scenario would work?
Yup, a CNAME record sounds to me like the way to go. See http://blog.smarx.com/posts/custom-domain-names-in-windows-azure. (Sorry, one of the images looks broken... I'll try to patch that up.)
The scheme would be: have www.foo.com point to your current app instance, and then change it to point to something.cloudapp.net when that week comes up... then switch it back after the rush is over.
Is it possible to just have the MVC site hosted on another web hosting account permanently? It doesn't necessarily have to be an Azure account, does it? Is the site written in MVC1 or MVC2?
If your shared hosting server cannot handle the peak then 1 instance of the web worker role in Azure probably won't work either.
I would try something else: keep your asp.net code on that server but move all the static content somewhere else (for example the Azure CDN) using a subdomain. If you use Jquery and serve the file from your website then you can change the link to either Google's CDN or Microsoft's CDN already for free.

Resources