服务器部署邮件功能_真正连续部署的功能标志

服务器部署邮件功能

Even the best software development teams I work with struggle to solve the problem of completely automated deployments to their production environments. The biggest hurdles to this tend to take the form of:

即使是最好的软件开发团队,我也要竭尽全力解决向其生产环境完全自动化部署的问题。 最大的障碍往往表现为:

  • Production change management that requires manual approval

    需要人工批准的生产变更管理
  • Even microservices architectures that have dependencies on multiple services being bundled and deployed together

    甚至依赖于捆绑和部署在一起的多个服务的微服务架构
  • Unable to separate the idea of a version and deployment

    无法区分版本和部署的想法

There are several strategies we can apply to solve those points individually, but one simple trick to solving all these issues with one pattern is to apply Feature Flags to your code.

我们可以采用几种策略来单独解决这些问题,但是用一种模式解决所有这些问题的一个简单技巧就是将特征标志应用于代码。

终极左移开发实践 (Ultimate Shift-Left Development Practices)

Image for post
Source 资源

It does not matter if you are developing on an older monolithic application or a greenfield microservices architecture application; you can introduce feature flagging into either pattern. In addition, with the industry standard of agile development, it can be near impossible to code an entire net new feature in a single sprint. Using feature flags, we can simply default our new code to “off" and regardless of who asks for what during our sprint, we can package our app and deploy it without worrying about something breaking.

无论是在较旧的单片应用程序还是未开发的微服务体系结构应用程序上进行开发,都无关紧要。 您可以将特征标记引入任一模式。 此外,采用敏捷开发的行业标准,几乎不可能在单个sprint中编写整个网络新功能。 使用功能标志,我们可以简单地将新代码默认设置为“关闭”,并且无论谁在冲刺期间要求什么,我们都可以打包应用程序并进行部署,而不必担心会发生问题。

在生产中进行测试! (Test in Production!)

Image for post

Yes, you’ve read that right. I am advocating you use feature flags to test in prod! Alright, well, hold on — before you start getting crazy thoughts and think I’ve lost my mind, let me clarify.

是的,您没有看错。 我提倡您使用功能标记在产品中进行测试! 好吧,好吧,坚持下去-在您开始发疯的想法并认为我已经失去理智之前,让我澄清一下。

There are a few areas where we can use feature flags and turn things on in production without causing a major impact to our end-users:

在一些区域中,我们可以使用功能标记并在生产中启用某些功能,而又不会对最终用户造成重大影响:

  • Background load testing: Let's say we have a new feature that we know is going to be pretty chatty. Maybe it's the ability to send real-time messages to other users or real-time collaboration on a document. Instead of trying to simulate user load and action in a QA/performance environment before flipping the switch in production and releasing our shiny new feature, we can actually use real users to simulate the traffic load. This is actually a famous tactic Facebook used before rolling out messaging to its user base. For months, bits of JavaScript were sending messages to your other friends, and unless you had a packet sniffer open, you’d never know!

    后台负载测试 :假设我们有一个新功能,我们知道该功能将非常实用。 也许这是向其他用户发送实时消息或对文档进行实时协作的能力。 我们实际上可以使用真实的用户来模拟流量负载,而不必在生产环境中切换开关并释放闪亮的新功能之前在QA /性能环境中模拟用户负载和操作。 实际上,这是Facebook在向用户群发送消息之前使用的一种著名策略。 几个月以来,JavaScript一直在向您的其他朋友发送消息,并且除非您打开数据包嗅探器,否则您将一无所知!

  • Partial user rollout: This is more akin to a canary deployment but instead, we determine some criteria for a subset of users and roll out the new feature for them while others don’t even have the option to see it. This can be great when you have a large user base. This gives you the ability to ensure the feature you’ve built out is something usable that users will take advantage of, otherwise turn it off and focus on something different. Great for hypothesis-driven development.

    部分用户部署 :这更类似于金丝雀部署,但是,我们为部分用户确定了一些条件,并为他们推出了新功能,而其他用户甚至没有选择看到它。 当您拥有庞大的用户群时,这可能会很棒。 这使您能够确保已构建的功能是用户可以利用的有用功能,否则请关闭功能并专注于其他功能。 非常适合假设驱动的开发。

提供终极的商业价值 (Provide the Ultimate Business Value)

Image for post
Source 资源

Taking a step back for a moment; let’s review the problem we are trying to solve. Too often, our GIT branching strategy is extremely difficult to line up with deployable artifacts. This becomes very apparent in environments between dev and prod. There are several instances where we want QA and full end-to-end testing to take place in pre-production, but our business partners need to demo functionality for critical stakeholders. So do we put manual gates in our CI/CD pipeline? Well, that can be a pain if we don’t have any conflicting interests in a particular environment. However, just like production, if we enable automatic deployment, there are potentially external factors that influence our deployment process that is nearly impossible to account for in the design of our CI/CD pipeline.

退后一会儿; 让我们回顾一下我们要解决的问题。 很多时候,我们的GIT分支策略很难与可部署的工件对齐。 这在开发人员和生产人员之间的环境中非常明显。 在某些情况下,我们希望在预生产中进行质量检查和完整的端到端测试,但是我们的业务合作伙伴需要为关键利益相关者演示功能。 那么,我们是否在CI / CD管道中放置手动门? 好吧,如果我们在特定环境中没有任何利益冲突,那将是一个痛苦。 但是,就像生产一样,如果我们启用自动部署,则潜在的外部因素会影响我们的部署过程,这在CI / CD管道的设计中几乎是不可能解决的。

The only solution for this becomes feature flagging. Feature flags externalize version code from releases. So while we may continue to increase the version of our artifacts, features are no longer tied directly to that artifact. This gives more control to the business to decide when to turn things on (or off) and simplify our pipeline.

唯一的解决方案是功能标记 。 功能标志将版本中的版本代码外部化。 因此,尽管我们可能会继续增加工件的版本,但是功能不再直接与该工件相关。 这为企业提供了更多控制权,以决定何时打开(或关闭)设备并简化我们的流程。

警告:防止意大利面代码 (Warning: Prevent Spaghetti Code)

Image for post
Source 资源

Let me provide a warning right now: feature flags are great, but don’t start developing with this pattern without a plan. Too often, nasty spaghetti code gets implemented without proper review and standardization of this programming paradigm.

现在让我提供警告:功能标记很棒,但是如果没有计划就不要以这种模式开始开发 。 通常,在没有适当审查和标准化此编程范例的情况下,实现了令人讨厌的意大利面条式代码。

Like most things, don’t reinvent the wheel. Take advantage of one of these standard open-source libraries to keep your code clean:

像大多数事情一样,不要重新发明轮子。 利用以下标准开放源代码库之一来保持您的代码干净:

示例功能标志代码: (Example feature flag code:)

结论 (Conclusion)

Feature flags solve a multitude of issues that arise when we try to deploy code to production through automation and as soon as it's ready to ship.

功能标记解决了许多问题,这些问题在我们尝试通过自动化并准备好将其交付时将代码部署到生产中时出现。

We, as developers, stop worrying about “releases" and start simply shipping code letting the business turn on functionality as they see fit.

作为开发人员,我们不再担心“发布”,而只是开始发布代码,使业务按他们认为合适的方式开启功能。

Behind the scenes, we can test features to subsets of users or even test with real users without them knowing to allow us to get the truest understanding of how our application scales.

在幕后,我们可以向用户子集测试功能,甚至可以与真实用户一起测试,而无需让他们真正了解我们的应用程序扩展方式。

Ultimately, it takes a development team with the desire to code in this new paradigm, and business partners who wish to deliver features quicker for their users!

最终,需要一个开发团队以这种新范例进行编码,而业务合作伙伴则希望为其用户更快地交付功能!

翻译自: https://medium.com/better-programming/feature-flags-for-true-continuous-deployment-14175f825ac5

服务器部署邮件功能

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值