Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Architecture: load balancing, availability, instances, etc

Hello,

I wonder if you could draft how load balancing for both apps and DBs is designed. In particular I'd like to learn
FOR APP:
- if we have just one instance of an app and you have to restart the server where the app runs (OS update or similar) what happens to the app? Downtime? Transferred to a different server before shutting dow the first? - same case with two istances of the app. Are these always deployed on different machines?

FOR DB (MsSQL):
- is this a simple istance on a single MsSQL server or do you have replicas in place, master-slave and similar?

Can you give us a more general picture of the underlaying architecture?

Thanks!

  1. Hi Pietro,

    If we shut down an application server we'll always make sure to transfer your application before shutting it down, so you won't experience downtime. We do this routinely to make sure our servers are always fully updated, so if you've had an app running on AppHarbor for the last couple of months it has most likely been moved around a couple of times.

    If the application server crashes (i.e. we didn't shut it down) we're committed to make sure that it'll be moved to a healthy web server quickly. In that case you would experience downtime if your application is only running on a single instance. In case your application runs on multiple servers the load balancer will fail over to the healthy instance. We'll then make sure to redeploy the crashed application to another web server. That way you get redundancy when you've got two instances running.

    If your app is running on more than a single instance it will always runs on minimum two machines.

    The current shared MSSQL offering does not have replicas/redundancy. We may at some point offer this feature as well, but for now you've got two options if you'd like redundancy on the database level: You can either take advantage of our MySQL offering that is fully redundant and highly available. You can also get dedicated MSSQL support if you'd prefer.

    All shared databases are backed up regularly out-of-the-box though.

    If there's anything else we can help with please let us know!

    Best,
    Rune

  2. rune closed this discussion on 06 Jul, 2011 03:55 PM.

  3. pmonte re-opened this discussion on 06 Jul, 2011 04:13 PM

  4. Ciao Rune and thansk for your prompt and detailed reply.

    When you say "If the application server crashes we're committed to make sure
    that it'll be moved to a healthy web server quickly" do you mean that this
    is not an automatic process but it's a manual (i.e. human) task?

    If we run two instances can we be sure that they run:
    1. in two different physical server/machine.
    2. in two different vm maybe on the same machine.
    3. they could run on the same vm.

    So right now, we cannot say that shared MSSQL's scalability and availability
    is "similar" to SQL Azure, right?
    I'm asking this as I'm evaluating to transfer or webs from an IaaS to a PaaS
    as the idea to scale and have a good availability (redudancy, replica etc
    etc) for a MSSQL is quite a nightmare. That's why I'd like to move to a
    CloudDB and so far, the only real Cloud MSSQL DB I was aware of is SQL
    Azure. SO the options are:
    A. find another "Cloud DB MSSQL" and I hope(d) it's yours.
    B. switch to NoSQL (so we can use SimpleDB, CouchDB, MongoDB etc all of them
    in AWS so no latency probs with you)
    C. Go to Azure

    Thanks a lot for your help,
    Pietro

  5. We're instantly alerted if a server goes down and just have to click a button to evacuate all applications to other servers. We haven't found that process to be problematic yet as we're able to do trigger the evacuation within seconds, but we will implement automated procedures for this. Regardless of that I'd still recommend to have the application running on at least two instances if you want your site to be available while the application is being moved.

    If you run two application instances you can be sure that they run on two different virtualized servers. Our virtualized servers are currently being provided by Amazon EC2. It isn't exactly a physical machine due to the way Amazon EC2 works (Azure works the same way though).

    An application instance has limited resources, so except for redundancy you would still get increased performance even if the application was deployed twice to the same server. As we want to offer redundancy, though, we make sure to deploy the application to different servers, and minimum two if you're running on more than one.

    As for your database options I will agree that our shared MSSQL isn't similar to SQL Azure, which also has it's inherent limitations (for instance a SQL Azure database can't be larger than 50GB). If you have more details about your database usage I may be able to advice better.

    If you don't want to have a dedicated MSSQL server (which is a bit expensive) we may begin offering shared MSSQL with redundancy. Would be great if you could add it as a feature request here: http://feedback.appharbor.com

    If you're willing to go for a NoSQL option you're in luck as you say - we're even located in the same datacenter (US-EAST) as most other service providers. You can even add MongoDB, Memcached, Redis and CouchDB to your application on AppHarbor https://appharbor.com/addon, where we've partnered with some of the best service providers.

  6. rune closed this discussion on 06 Jul, 2011 05:09 PM.

  7. pmonte re-opened this discussion on 06 Jul, 2011 05:46 PM

  8. I'm in the designing stage for a new app that could receive heavy traffic so
    I need to design it so that it can scale easily. AppHarbor and Azure are the
    ideal solution for the app/compute.

    What I'm able to say now about DB usage is that the ideal solution would be
    to use a LINQ compatible DB, so the obvious first choice is MSSQL. I cannot
    imagine that we would need more than 10/20GB so the 50GN limit of SQL Azure
    shouldn't be a prob. The DB should be able to handle heavy traffic (both
    read/write) and setting up such a config in a IaaS is not an option for us.
    High availability is a must (as I do not find myself where we design the app
    to run on a PaaS to get high availability and the DB is down).

  9. Ciao Pietro,

    Mi dispiace intrometere ma ecco la mia visione.

    Linq DB is a matter of using ADO Entity Framework and you will be able to use the power of linq in any database supported, this includes mySQL (you just need to use MySql Connector).

    You say "The DB should be able to handle heavy traffic" I would strongly suggest to add some caching and very good caching, there is no need to hit the DB to retrieve the same thing, EF does something for you but not all, and you should be aware of that.

    Shared MSSQL accounts are never good to high end web applications, but in my experience from one huge app I released you should be fine with caching but please separate static content from the server, use a CDN to give all static files and let the server manage the views.

    I had a really HUGE first day with 60Gb bandwidth hitting a shared hosted server!!! but soon I set caching correctly and move all CSS, Javascripts and Images to Amazon S3 account, the rest of the month I didn't even had 10Gb of bandwidth!

    It's all about, what are you doing your your database, what calculations and use are you putting into it, simple reads, inner joins? a good database design is prime here! I ended up using a shared hosting account with a shared SQL Server Professional (not SQL Express as I think AppHarbor is using) - [DiscountASP.NET] (http://discountasp.net) - and taking the 1st day problems, all went fine with no major problem, this year (this app only runs in December) I will use a cloud approach, and as yourself I'm thinking about AppHarbor, but I'm not quite convinced (yet).

  10. Beh, grazie di esserti intromesso, commenti interessanti.

    LINQ: I had read that discussion on stackoverflow and some comments defining mysql support for LINQ as crap made me quite "cold" about it but I should give it a try, looking at the doc it sounds good (maybe it's juts an old comment).

    I will look into caching better, thanks.

    I have already planned to separate content and app (even because ina cloud env with no persistance you have to). I do like Appharbor, I do like Git, I do like the idea to use S3 as storage (and it would work great with AppHarbor) the only point left was the DB. I'm not totally conviced about AppHarbor MSSQL, I would prefer not to switch to NoSQL.
    So using MySQL could be the ideal solution for me.

    AppHarbor offers MySQL and here above Rune says " our MySQL offering that is fully redundant and highly available". Rune can you tell us more about the architecture of this?
    An alternative could be http://xeround.com, a "real" mysql db on the cloud hosted on AWS (so again great with AppHarbor) and a very elastic price. It's a pity it is not among the add ons offered by AppHarbor.

  11. Grazie.

    I wonder if wasnt better to get Amazon Relational Database Service as it's MySQL comparing to Xeround, so you removed the middle-men.

    But I must say, having Xeround as a add on to AppHarbor would be really good as they have it in Heroku and that's the main goal of AppHarbor, to be a Heroku-alike, for .NET.

  12. Pietro, the shared MySQL offering on AppHarbor uses Amazon RDS that balexandre also refers to. We've set it up with Multi A-Z deployment to ensure high availability.

    Don't get me wrong - we can definitely provide you with some really heavy MSSQL machinery, but it does come at a cost due to MSFT licensing.

    I can strongly recommend using MySQL though as it's more cost-effective and particularly if you want redundancy. You can of course choose to get it yourself from Amazon if you prefer, though you'd have to pay for both servers. If you choose to do so it should be located in US-EAST region to ensure optimal performance.

    We're using RDS ourselves to run appharbor.com and as balexandre mentions you can easily use MySQL with Entity Framework. We use FluentNHibernate with LINQ to NHibernate. If you're in the design phase of your application development I'd also recommend you to look into those options. It's even more powerful than Entity Framework, has no generated code, no xml mapping etc. and you get some neat features such as NHibernate SchemaExport that you can use to create/recreate/update your database from your entities.

    Best,
    Rune

  13. rune closed this discussion on 07 Jul, 2011 10:49 AM.

  14. rune re-opened this discussion on 07 Jul, 2011 10:49 AM

  15. Thanks a lot to you both, I have much clearer ideas now. It looks like MySQL is the best option in my case.
    Going directly to RDS is a no-sense for me, if I choose RDS AppHarbor's offer will be my choice (also from a cost point of view it is great).

    Balexandre, I see Xeround as a "real" cloud db (very elastic and completely managed by them) while RDS is not so flexible, you have to stay with their instances size and even if Amazon takes care of most it is still up to you to organize and scale instances and storage space.
    I do like Xeround approach even if reading their forum you can easily find people moaning...

    Rune, I'll lokk into FluentNHibernate, thanks a lot for the suggestion.

  16. friism closed this discussion on 07 Jul, 2011 11:05 PM.

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac