当前位置:网站首页>【译】十二因子应用(四)
【译】十二因子应用(四)
2022-06-29 19:57:00 【全栈程序员站长】
IV 后端服务
将后端服务视为可拔插的资源
后端服务是一种在应用在网络上正常运行时消费的任意一种服务。包括数据库(如MySQL或CouchDB),消息/队列系统(如RabbitMQ或Beantalkd),发邮件的SMTP服务(如Postfix),缓存系统(如Memcached)。
数据库这种后端服务传统上与应用运行时部署一起呗同样的系统管理员管理。除了这些本地管理的服务,应用也会有一些被第三方管理的服务。如SMTP服务(Postmark),度量数据收集服务(如New Relic或Loggly),二进制存储服务(如Amazon S3),甚至API存取服务(Twitter,GoogleMap,或Last.fm)。
12因子应用的代码对待这些本地和第三方服务来说没有差别。应用端,都是可拔插的资源,通过URL或其他配置好的定位/鉴权服务。一份12因子应用的部署可以不经过任何代码修改将本地MySQL数据库替换成第三方的服务(如Amazon RDS)。同样的,本地SMTP服务可以被替换成第三方SMTP服务(如Postmark)而不需要改动代码。在这两个case,只有处理资源的配置文件需要变动。
每一个后端服务服务都是一个资源。如MySQL是一个资源,两个MySQL数据库(在应用层做sharding)就是两个独立的资源。12因子应用将这些数据库看做可拔插资源,在部署时是松耦合的。
资源可以按意愿在部署时进行拔插。如,如果应用的数据库由于硬件问题出现故障,应用管理员可以快速从一个最近的备份中进行恢复。当前的生产库可以被卸载,新数据库被挂载上 – 不需要代码变动。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/101288.html原文链接:https://javaforall.cn
边栏推荐
- Union find
- KDD 2022 | characterization alignment and uniformity are considered in collaborative filtering
- JVM (3) class loading
- How to set a pod to run on a specified node
- 【U盘检测】为了转移压箱底的资料,买了个2T U盘检测仅仅只有47G~
- [fishing artifact] code tool for lowering the seconds of UI Library -- form part (I) design
- Flume configuration 1 - basic case
- npm ERR! fatal: early EOF npm ERR! fatal: index-pack failed
- Koa 源码剖析
- JVM (2) garbage collection
猜你喜欢
[network orientation training] - Enterprise Park Network Design - [had done]
ETCD数据库源码分析——服务端PUT流程
How to set a pod to run on a specified node
雲服務器的安全設置常識
Flume配置3——拦截器过滤
Where is the win11 installation permission set? Win11 installation permission setting method
童年经典蓝精灵之百变蓝爸爸数字藏品中奖名单公布
Flume configuration 4 - Custom source+sink
一个超赞的开源的图片去水印解决方案
JVM(2) 垃圾回收
随机推荐
【U盘检测】为了转移压箱底的资料,买了个2T U盘检测仅仅只有47G~
How to solve the problem of insufficient memory space in Apple iPhone upgrade system?
How is the combination of convolution and transformer optimal?
The concept and properties of mba-day26 number
Configuration du Flume 4 - source personnalisée + sink
Technical methodology of new AI engine under the data infrastructure upgrade window
童年经典蓝精灵之百变蓝爸爸数字藏品中奖名单公布
Shell bash script note: there must be no other irrelevant characters after the escape character \ at the end of a single line (multi line command)
Notepad++ -- macro (record operation process)
WPS and Excelle
Luoqingqi: has high-end household appliances become a red sea? Casati took the lead in breaking the game
一个mysql里有3306端口下,一个mysql有20多个数据库,怎么一键备份20多个数据库,做系统备份,防止数据误删除?
数据链路层
Deficiencies and optimization schemes in Dao
XSS漏洞
shell bash脚本注意:单行末尾转义符 \ 后千万不能有其他无关字符(多行命令)
ASP. Net core creates razor page and uploads multiple files (buffer mode) (Continued)
剑指 Offer 41. 数据流中的中位数
2022年深圳市福田区支持先进制造业发展若干措施
Creators foundation highlights in June