我习惯于以“传统”方式构建Web应用程序,但试图使用Docker来解决问题.如果我在python Web应用程序中与容器一起运行postgres,这与启动数字海洋服务器并从头开始安装postgres一样吗?如何使用docker中的postgres数据库处理备份,容错等?
作为替代,我通常在Heroku或AWS上使用托管的postgres.那不能解决我自己在docker中托管postgres时遇到的很多问题吗?开发人员是否真的在docker中运行postgres,或者他们通常更喜欢使用外部托管服务?
最近的这篇来自mesosphere的文章更加详细地说明了为什么还没有这种情况.
一个问题是业务流程技术还不能满足有状态服务的高要求.报价:
The first challenge is resource isolation. Many container orchestration solutions in the market provide a best effort approach to resource allocation,including memory,cpu and Storage. While this may be ok for stateless apps,it may be catastrophic for stateful services,where loss of performance may result in loss of customer transactions or data.
另一个是有状态数据库是根据与容器使用的假设不同的假设构建的,并且已针对它们进行了优化.再次引用:
Most of today’s stateful database technologies were originally designed for a non-containerized world. The operational instructions are very specific to the technology and can sometimes be version specific. Trying to map generic primitives of a container orchestration platform to stateful services is usually a time consuming and error prone operation.