TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

BlueGreenDeployment (2010)

75 pointsby colundalmost 10 years ago

16 comments

GFischeralmost 10 years ago
The most interesting thing for me was the link to <a href="http:&#x2F;&#x2F;continuousdelivery.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;continuousdelivery.com&#x2F;</a> and the diagrams summarizing some of the concepts in the book (they&#x27;re CC licensed):<p><a href="http:&#x2F;&#x2F;continuousdelivery.com&#x2F;wp-content&#x2F;uploads&#x2F;2014&#x2F;02&#x2F;01_CD_the_idea_low-res.jpg" rel="nofollow">http:&#x2F;&#x2F;continuousdelivery.com&#x2F;wp-content&#x2F;uploads&#x2F;2014&#x2F;02&#x2F;01_...</a><p><a href="http:&#x2F;&#x2F;continuousdelivery.com&#x2F;wp-content&#x2F;uploads&#x2F;2014&#x2F;02&#x2F;02_CD_test_strategy_low-res.jpg" rel="nofollow">http:&#x2F;&#x2F;continuousdelivery.com&#x2F;wp-content&#x2F;uploads&#x2F;2014&#x2F;02&#x2F;02_...</a><p><a href="http:&#x2F;&#x2F;continuousdelivery.com&#x2F;wp-content&#x2F;uploads&#x2F;2014&#x2F;02&#x2F;03_CD_automated_acceptance_test_low-res.jpg" rel="nofollow">http:&#x2F;&#x2F;continuousdelivery.com&#x2F;wp-content&#x2F;uploads&#x2F;2014&#x2F;02&#x2F;03_...</a><p><a href="http:&#x2F;&#x2F;continuousdelivery.com&#x2F;wp-content&#x2F;uploads&#x2F;2014&#x2F;02&#x2F;04_CD_managing_data_low-res.jpg" rel="nofollow">http:&#x2F;&#x2F;continuousdelivery.com&#x2F;wp-content&#x2F;uploads&#x2F;2014&#x2F;02&#x2F;04_...</a>
boobsbralmost 10 years ago
I work at a big 3-letter multinational corporation, and we still compile and deploy manually. No continuous integration or, at least, automated testing. No build tool whatsoever, or a repo to store artifacts. Everything is compiled on the dev&#x27;s workstation and sent by email.<p>We do have a disaster recovery server, but it sits outdated for weeks after a deployment in production. When something goes wrong, the switch is not automatic and transparent to the user, we have to email EVERYONE in the user&#x27;s list to please use the DR server&#x27;s address. There is no router or load balancer.<p>Crazy.
评论 #9665436 未加载
beatalmost 10 years ago
I had the pleasure of working on a three node blue-green system at a Fortune 100 company (yes, enterprise can do some things right). Each cluster could be in either of two production modes or a staging mode, all switched with a simple command line request. The request created touchfiles that managed the load balancer behavior. Instantaneous switching, yeah!<p>On the other hand, the database was more or less a cache. It was very much availability over consistency, in CAP terms. If we had to keep transactional data, it would have been harder.<p>edit: When I started there and they described the architecture to me, I said &quot;Cool, you&#x27;re doing blue green deployment!&quot;, and the response was &quot;What&#x27;s blue green deployment?&quot;
madeofpalkalmost 10 years ago
BlueGreen deployments are easy to achieve using something like AWS ElasticBeanstalk (and they also force you to have your entire env setup in code so its quickly duplicatable for each deploy) with how easy it is to create a new stack and its &#x27;Swap CNAME&#x27; feature.<p>However, now that Elastic Beanstalk supports incremental rollouts I don&#x27;t see as much value in the approach.<p>We use Blue&#x2F;Green deployments (with AWS EB) at Mi9 to deploy all our high traffic websites
评论 #9665296 未加载
patsplatalmost 10 years ago
Database is the sticky part of this strategy.<p>If Blue is in production and Green is on deck, how are updates to the Blue database pushed to Green?
评论 #9665149 未加载
评论 #9665124 未加载
评论 #9665365 未加载
评论 #9665520 未加载
评论 #9665306 未加载
baliexalmost 10 years ago
The idea reminds me of double-buffering. I wonder if there are other parallels that can be drawn (pun not intended) from the similarities
评论 #9665066 未加载
geerlingguyalmost 10 years ago
Betterment just posted an interesting set of slides from their #AnsibleFest presentation yesterday on &#x27;Cyan&#x27; deployments powered by Ansible; kind of an evolution of the traditional &#x27;Blue&#x2F;Green&#x27; style described in Fowler&#x27;s post: <a href="http:&#x2F;&#x2F;www.slideshare.net&#x2F;AlanNorton1&#x2F;cyansible" rel="nofollow">http:&#x2F;&#x2F;www.slideshare.net&#x2F;AlanNorton1&#x2F;cyansible</a>
joshribakoffalmost 10 years ago
The way I do it is to rsync my code to a path such as &quot;app-v1.0.0&quot;<p>I then create symlinks such as &quot;live&quot; &amp; &quot;beta&quot;:<p>&quot;live&quot; -&gt; &quot;app-v1.0.0&quot;<p>I rsync the code from a CI server or local host, after running bower&#x2F;composer &amp; testing, this way I deploy a &quot;snapshot&quot; of the entire codebase.<p>I find a lot of people just casually deploy their code with git, and subsequently run &quot;bower install&quot;, tolerating downtime in between, with no solid rollback mechanism in place. I hear Capistrano works in a similar way but is git based instead of rsync. To me its really important that the updates happen atomically &amp; roll back atomically, and as a result of running a single command.<p>Simple example of a &quot;deploy.sh&quot; I would use in a new project:<p>gulp production &amp;&amp; rsync --update-after --delay-updates --exclude-from=&quot;rsync_exclude.txt&quot; -avr .&#x2F; server-www:&#x2F;var&#x2F;www&#x2F;html&#x2F;
评论 #9666393 未加载
lmzalmost 10 years ago
Netflix does it with two auto scaling groups: <a href="http:&#x2F;&#x2F;techblog.netflix.com&#x2F;2013&#x2F;08&#x2F;deploying-netflix-api.html" rel="nofollow">http:&#x2F;&#x2F;techblog.netflix.com&#x2F;2013&#x2F;08&#x2F;deploying-netflix-api.ht...</a>
ing33kalmost 10 years ago
This can be implemented easy using Ansible <a href="http:&#x2F;&#x2F;docs.ansible.com&#x2F;guide_rolling_upgrade.html" rel="nofollow">http:&#x2F;&#x2F;docs.ansible.com&#x2F;guide_rolling_upgrade.html</a><p>btw article is 4 years old
评论 #9664978 未加载
评论 #9665017 未加载
评论 #9665219 未加载
dorfsmayalmost 10 years ago
Some companies will also activate the new path only a small percentage of traffic and monitor the logs to be able to detect errors that were missed in testing.
评论 #9665384 未加载
kaylarosealmost 10 years ago
We use this at the (very large) corp that I work at, with very large, complex, high-traffic&#x2F;revenue sites. Each component in the architecture has it&#x27;s own &quot;light&#x2F;dark&quot; deployment (in each environment), so any piece can be staged&#x2F;tested&#x2F;deployed&#x2F;rolled-back with zero downtime. It has worked fairly well, with the majority of hiccups occuring during the ramp-up on the process.
hharnischalmost 10 years ago
We&#x27;ve used this technique at Respondly for the past year and a half with a Meteor stack. It&#x27;s saved a lot of headaches and has greatly minimized downtime. It does have some gotcha&#x27;s though when pushing certain types of changes. Mostly things around message formatting changes in shared queueing systems.
allan_salmost 10 years ago
(looking for comments)<p>after reading that articles (some months ago) I&#x27;ve decided to implement that in our company , we&#x27;re mostly using symfony2 and postgresql, and I came up with that <a href="https:&#x2F;&#x2F;github.com&#x2F;allan-simon&#x2F;ansible-docker-symfony2-vagrant&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;allan-simon&#x2F;ansible-docker-symfony2-vagra...</a><p>basically I have<p><pre><code> ______nginx__phpfpm+code (blue) &#x2F; \ front nginx database \______nginx__phpfpm+code&#x2F; (green) </code></pre> The front nginx play the role of &quot;switch&quot; between blue and green , and the database is shared<p>so basically for the database problem I solve by telling our dev to be aware of it, which translate into a two step process for database upgrade. (we use Dotrine&#x27;s ORM with doctrine migrations for migrations, so when i talk about getter &#x2F;setters I talk about the entities&#x27; )<p><pre><code> * if we add a column which must be &quot;not null&quot; , we add it with a default value first , so the few second the old code is still online , but the database is already updated , if an insert happen it will not fail . Then second time we drop that default value and put in the migration the SQL statement that handle previous data. * if we drop a column, we first commit a version of our application which remove the code using this column , or make them return default value. and then the second deployement drop the column, so that the version N-1 is already made to not care about it. </code></pre> etc. the base logic is &quot;the database version N+1 should still work with version N of the code&quot; , I like to image that with a &quot;crossing a small river by always keeping a feet on earth rather than jumping the two feet at once &quot;<p>after I have to admit that fortunately 99% of our deployment are not about database changes so this &quot;need to do it carefully&quot; only happen once in a while and it does not affect our productivity (especially with the gain of being able to do CI)<p>last thing, is that I&#x27;ve used this technique only on small to medium websites, nothing with HUGE traffic, so I don&#x27;t know if it&#x27;s 100% no downtime, my test (running several `while true; curl WEBSITE ; done ` ) shown no traffic lost.<p>I just wanted to say that to get opinion from more experienced people, while telling to &quot;normal company&quot; fellows that it&#x27;s possible to achieve that without &quot;the cloud&quot; and old-school server hosted in a DC or at customer&#x27;s office.<p>Edit: of course we still have a dev and staging environment on which we validate code before deploying in production.
评论 #9666042 未加载
danesparzaalmost 10 years ago
That&#x27;s from 5 years ago.<p>Also: Your database changes should be entirely backwards compatible and should happen in one location (not on its own slice).
kaghaffaalmost 10 years ago
What&#x27;s a good tool to automate the router configuration to point to the new deployment?