为什么人们使用Heroku的时候AWS为present?什么是可区别的Heroku [英] Why do people use Heroku when AWS is present? What's distinguishing about Heroku

查看:445
本文介绍了为什么人们使用Heroku的时候AWS为present?什么是可区别的Heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个初学者回报率程序员的规划使用Heroku的部署我的应用程序。字从我的其他顾问的朋友说,Heroku的是真的很容易,很好用。唯一的问题是,我仍然不知道什么样的Heroku做。

I'm a beginner RoR programmer that's planning to deploy my app using Heroku. Word from my other advisor friends says that Heroku is really easy, good to use. The only problem is that I still have no idea what Heroku does..

我看着他们网站和概括地说,Heroku的确实是缩放,但帮助...为什么即使有关系吗?如何用干Heroku的帮助:

I've looked at their website and in a nutshell, what Heroku does is help with scaling but... why does that even matter? How does Heroku help with:

  1. 速度 - 我的研究暗示,在美国东海岸部署AWS将是最快的,如果我是针对美国/亚洲为主的观众

  1. Speed - My research implied that deploying AWS on the US East Coast would be the fastest if i am targeting a US/Asia based audience

安全 - 如何安全它们

Security - How secure are they?

缩放 - ?它是如何实际工作

Scaling - How does it actually work?

成本效益 - 有些东西就像一个赛道,可以很容易地扩展

Cost efficiency - There's something like a dyno that makes it easy to scale.

他们如何公平对他们的竞争对手?例如, Engine Yard的 BLUEBOX

How do they fair against their competitors? For example, Engine Yard and bluebox?

请用外行人的英语术语来解释......我是一个初学编程的。谢谢你。

Please use laymen english terms to explain... i'm a beginner programmer. Thank you.

推荐答案

首先第一件事情,AWS和Heroku的是不同的东西。 AWS提供基础设施即服务(IaaS),而Heroku上提供了一个平台即服务(PaaS)。

First things first, AWS and Heroku are different things. AWS offer Infrastructure as a Service (IaaS) whereas Heroku offer a Platform as a Service (PaaS).

有什么区别?非常近似,IaaS的为您提供所需,以建立在它之上的东西分量; PaaS的给你,你只推code和一些基本的配置,并得到一个正在运行的应用程序的环境。 IaaS的可以给你更多的权力和灵活性,在其建立和维护自己更多的成本。

What's the difference? Very approximately, IaaS gives you components you need in order to build things on top of it; PaaS gives you an environment where you just push code and some basic configuration and get a running application. IaaS can give you more power and flexibility, at the cost of having to build and maintain more yourself.

为了让您的code在AWS上运行,看起来有点像Heroku的部署,你需要一些EC2实例 - 你要安装在他们的负载平衡器/缓存层(例如的Varnish ),你会希望实例运行像客运 nginx的以满足您的code,你要部署和配置的类似的PostgreSQL 。您将要部署的系统的东西,如 Capistrano的和一些做日志聚合。

To get your code running on AWS and looking a bit like a Heroku deployment, you'll want some EC2 instances - you'll want a load balancer / caching layer installed on them (e.g. Varnish), you'll want instances running something like Passenger and nginx to serve your code, you'll want to deploy and configure a clustered database instance of something like PostgreSQL. You'll want a deployment system with something like Capistrano, and something doing log aggregation.

这不是工作的相当金额的设置和维护。随着Heroku的,去那种阶段所需付出的努力是有可能的应用code和A 混帐推几行。

That's not an insignificant amount of work to set up and maintain. With Heroku, the effort required to get to that sort of stage is maybe a few lines of application code and a git push.

所以,你这么远,你想扩大规模。大。您正在使用木偶进行EC2部署,对不对?所以,现在您配置Capistrano的文件旋转起来需要/下的实例;你再治具的木偶配置使上光油意识到网络工作者的实例,并在它们之间自动池。或者你 Heroku的规模网络:+5

So you're this far, and you want to scale up. Great. You're using Puppet for your EC2 deployment, right? So now you configure your Capistrano files to spin up/down instances as needed; you re-jig your Puppet config so Varnish is aware of web-worker instances and will automatically pool between them. Or you heroku scale web:+5.

希望,让你两者之间的比较的想法。现在,以满足您的特定点:

Hopefully that gives you an idea of the comparison between the two. Now to address your specific points:

目前的Heroku只在运行在AWS实例美国东部欧盟 - 西。对你来说,这听起来像你想要呢。对于其他人,这可能更多的是考虑因素。

Currently Heroku only runs on AWS instances in us-east and eu-west. For you, this sounds like what you want anyway. For others, it's potentially more of a consideration.

我已经看到了很多的内部维护的生产服务器是远远落后于安全更新,或者只是一般把不良在一起。随着Heroku上,你有别人管理之类的事情,这是无论是福还是祸取决于你如何看待它!

I've seen a lot of internally-maintained production servers that are way behind on security updates, or just generally poorly put together. With Heroku, you have someone else managing that sort of thing, which is either a blessing or a curse depending on how you look at it!

在部署,你有效地交给你的code直行过来的Heroku。这可能对你是一个问题。他们对迪诺隔离文章,详细介绍了如何隔离技术(它好像多dynos是个人的EC2实例上运行)。几个同事与这些技术和他们的孤立的实力前pressed问题;我唉没有足够的知识/经验的位置,真正发表评论,但我现在的Heroku的部署,认​​为足够好的。这可能是你的问题,我不知道。

When you deploy, you're effectively handing your code straight over to Heroku. This may be an issue for you. Their article on Dyno Isolation details their isolation technologies (it seems as though multiple dynos are run on individual EC2 instances). Several colleagues have expressed issues with these technologies and the strength of their isolation; I am alas not in a position of enough knowledge / experience to really comment, but my current Heroku deployments consider that "good enough". It may be an issue for you, I don't know.

我谈到怎么一会在我的IaaS VS以上的PaaS相比实现这一点。大约,你的应用程序有一个 Procfile ,它的形式行 dyno_type:command_to_run ,因此,例如(从cribbed <一href="http://devcenter.heroku.com/articles/process-model">http://devcenter.heroku.com/articles/process-model):

I touched on how one might implement this in my IaaS vs PaaS comparison above. Approximately, your application has a Procfile, which has lines of the form dyno_type: command_to_run, so for example (cribbed from http://devcenter.heroku.com/articles/process-model):

web:    bundle exec rails server
worker: bundle exec rake jobs:work

这,有:

heroku scale web:2 worker:10

将导致你有2 网​​站 dynos和10 在运行的工作 dynos。美观大方,操作简单,方便。需要注意的是网​​站是一个特殊的赛道类型,它可以访问到外面的世界,是背后的好的网站流量多路复用器(可能是某种光油/ nginx的组合),将路由流量相应。你的员工可能与类似路由的消息队列,从中他们将通过在环境中的URL获得位置进行交互。

will result in you having 2 web dynos and 10 worker dynos running. Nice, simple, easy. Note that web is a special dyno type, which has access to the outside world, and is behind their nice web traffic multiplexer (probably some sort of Varnish / nginx combination) that will route traffic accordingly. Your workers probably interact with a message queue for similar routing, from which they'll get the location via a URL in the environment.

很多人有很多关于这个不同的意见。目前,它的0.05 $ /小时一个小时的赛道相比,或$ 0.025 /小时的AWS微实例$ 0.09 /小时的AWS小实例。

Lots of people have lots of different opinions about this. Currently it's $0.05/hr for a dyno hour, compared to $0.025/hr for an AWS micro instance or $0.09/hr for an AWS small instance.

Heroku的赛道文档说你对512MB的RAM,所以它可能不是的的不合理的考虑作为赛道有点像EC2微实例。它是身价倍增,价格是多少?你有多珍惜自己的时间?将建立在一个IaaS产品之上所需的时间和精力量得到它这个标准是绝对不便宜。我真的不能回答这个问题要问你,但是不要低估了隐性成本的设置和维护。

Heroku's dyno documentation says you have about 512MB of RAM, so it's probably not too unreasonable to consider a dyno as a bit like an EC2 micro instance. Is it worth double the price? How much do you value your time? The amount of time and effort required to build on top of an IaaS offering to get it to this standard is definitely not cheap. I can't really answer this question for you, but don't underestimate the 'hidden costs' of setup and maintenance.

(的有点之外,但如果我连接到测功机从这里(的Heroku运行的bash ),匆匆一瞥显示的/ proc / cpuinfo的和RAM 36GB - 这使我相信,我在一个的高内存双超大型实例。Heroku的赛道文档说,每个赛道获得512MB的RAM ,所以我可能有多达71等dynos共享。(我没有关于Heroku的AWS实例的足够的同源数据,让您的milage可能会发生变化))

(A bit of an aside, but if I connect to a dyno from here (heroku run bash), a cursory look shows 4 cores in /proc/cpuinfo and 36GB of RAM - this leads me to believe that I'm on a "High-Memory Double Extra Large Instance". The Heroku dyno documentation says each dyno receives 512MB of RAM, so I'm potentially sharing with up to 71 other dynos. (I don't have enough data about the homogeny of Heroku's AWS instances, so your milage may vary))

这,我怕我真的不能帮你。我曾经真的看着唯一的竞争对手是谷歌应用程序引擎 - 当时我一直在寻找部署Java应用程序和是令人难以置信的倒胃口上使用的框架和技术的限制量。这是不是只是一个Java的东西更多 - 一般限制和需要注意的事项的金额(的常见问题解答暗示了几个)似乎小于方便。与此相反,部署到Heroku上一直有一个梦想。

This, I'm afraid I can't really help you with. The only competitor I've ever really looked at was Google App Engine - at the time I was looking to deploy Java applications, and the amount of restrictions on usable frameworks and technologies was incredibly off-putting. This is more than "just a Java thing" - the amount of general restrictions and necessary considerations (the FAQ hints at several) seemed less than convenient. In contrast, deploying to Heroku has been a dream.

我希望这回答了你的问题(请评论,如果有你想填补的空白/其他地区)。我觉得我应该提供我个人的立场。我爱的Heroku的快速部署。当我开始一个应用程序,我想一些廉价的主机(Heroku的自由层是真棒 - 基本上,如果你只需要一个网络赛道和PostgreSQL的5MB,它是免费托管的应用程序),Heroku的是我去到的位置。对于严重的生产部署与几个付费用户,以服务级别协议,专门的时间花费在老年退休金计划,等等,我不能完全让自己卸载那么多控制的Heroku,然后或者AWS或我们自己的服务器已经选择的托管平台。

I hope this answers your questions (please comment if there are gaps / other areas you'd like addressed). I feel I should offer my personal position. I love Heroku for "quick deployments". When I'm starting an application, and I want some cheap hosting (the Heroku free tier is awesome - essentially if you only need one web dyno and 5MB of PostgreSQL, it's free to host an application), Heroku is my go-to position. For "Serious Production Deployment" with several paying customers, with a service-level-agreement, with dedicated time to spend on ops, et cetera, I can't quite bring myself to offload that much control to Heroku, and then either AWS or our own servers have been the hosting platform of choice.

最后,它是关于什么工作最适合你。你说你是一个初学编程的 - 这可能仅仅是因为使用的Heroku将让您专注于编写Ruby,而不必花时间让所有的其他基础设施周围建立了你的code。我肯定会试试看。

Ultimately, it's about what works best for you. You say you're "a beginner programmer" - it might just be that using Heroku will let you focus on writing Ruby, and not have to spend time getting all the other infrastructure around your code built up. I'd definitely give it a try.

请注意,AWS确实实际上有一个PaaS产品,弹性魔豆,即支持Ruby,Node.js的,PHP,Python的,.NET和Java。我想,一般大多数人来说,当他们看到AWS,跳转到像EC2和S3和EBS,这是肯定的IaaS产品

Note, AWS does actually have a PaaS offering, Elastic Beanstalk, that supports Ruby, Node.js, PHP, Python, .NET and Java. I think generally most people, when they see "AWS", jump to things like EC2 and S3 and EBS, which are definitely IaaS offerings

这篇关于为什么人们使用Heroku的时候AWS为present?什么是可区别的Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆