爲了構建分佈式微服務程序,可以部署到全部雲服務,Heroku工程師總結全部雲原生應用程序的12要素:html

- 1.基準代碼 Single codebase: The application must have one codebase, tracked in revision control for every application (read: microservice) that can be deployed multiple times (development, test, staging, and production environments). Two microservices do not share the same codebase. This model allows the flexibility to change and deploy services without impacting other parts of the application.
- 2.依賴 Dependencies: The application must explicitly declare its code dependencies and add them to the application or microservice. The dependencies are packaged as part of the microservice JAR/WAR file. This helps isolate dependencies across microservices and reduce any side effects through multiple versions of the same JAR.
- 3.配置 Config: The application configuration data is moved out of the application or microservice and externalized through a configuration management tool. The application or microservice will pick up the configuration based on the environment in which it is running, allowing the same deployment unit to be propagated across the environments.
- 4.後端服務 Backing services: All external resources, access should be an addressable URL. For example, SMTP URL, database URL, service HTTP URL, queue URL, and TCP URL. This allows URLs to be externalized to the config and managed for every environment.
- 5.構建,發佈,運行 Build, release, and run: The entire process of building, releasing, and running is treated as three separate steps. This means that, as part of the build, the application is built as an immutable entity. This immutable entity will pick the relevant configuration to run the process based on the environment (development, testing, staging, or production).
- 6.進程 Processes: The microservice is built on and follows the shared-nothing model. This means the services are stateless and the state is externalized to either a cache or a data store. This allows seamless scalability and allows load balance or proxy to send requests to any of the instances of the service.
- 7.端口綁定 Port binding: The microservice is built within a container. The service will export and bind all its interfaces through ports (including HTTP).
- 8.併發 Concurrency: The microservice process is scaled out, meaning that, to handle increased traffic, more microservice processes are added to the environment. Within the microservice process, one can make use of the reactive model to optimize the resource utilization.
- 9.易處理Disposability: The idea is to build a microservice as immutable with a single responsibility to, in turn, maximize robustness with faster boot-up times. Immutability also lends to the service disposability.
- 10.環境等價Dev/prod parity: The environments across the application life cycle—DEV, TEST, STAGING, and PROD—are kept as similar as possible to avoid any surprises later.
- 11.日誌Logs: Within the immutable microservice instance, the logs generated as part of the service processing are candidates for state. These logs should be treated as event streams and pushed out to a log aggregator infrastructure.
- 12.管理進程 Admin processes: The microservice instances are long-running processes that continue unless they are killed or replaced with newer versions. All other admin and management tasks are treated as one-off processes: Applications that follow the 12 factors make no assumptions about the external environment, allowing them to be deployed on any cloud provider platform. This allows the same set of tools/processes/scripts to be run across environments and deploy distributed microservices applications in a consistent manner.

12-Factor 爲構建以下的 SaaS 應用提供了方法論:前端
使用標準化流程自動配置,從而使新的開發者花費最少的學習成本加入這個項目。
和操做系統之間儘量的劃清界限,在各個系統中提供最大的可移植性。
適合部署在現代的雲計算平臺,從而在服務器和系統管理方面節省資源。
將開發環境和生產環境的差別降至最低,並使用持續交付實施敏捷開發。
能夠在工具、架構和開發流程不發生明顯變化的前提下實現擴展。react
適用於任意語言和後端服務(數據庫、消息隊列、緩存等)開發的應用程序。
數據庫
------------------------------------------------------------------
後端
今天先到這兒,但願對您技術領導力, 企業管理,系統架構設計與評估,團隊管理, 項目管理, 產品管理,團隊建設 有參考做用 , 您可能感興趣的文章:
前端性能覈對表Checklist-2018
大型電商互聯網性能優化案例
國際化環境下系統架構演化
微服務架構設計
視頻直播平臺的系統架構演化
微服務與Docker介紹
Docker與CI持續集成/CD
互聯網電商購物車架構演變案例
互聯網業務場景下消息隊列架構
互聯網高效研發團隊管理演進之一
消息系統架構設計演進
互聯網電商搜索架構演化之一
企業信息化與軟件工程的迷思
企業項目化管理介紹
軟件項目成功之要素
人際溝通風格介紹一
精益IT組織與分享式領導
學習型組織與企業
企業創新文化與等級觀念
組織目標與我的目標
初創公司人才招聘與管理
人才公司環境與企業文化
企業文化、團隊文化與知識共享
高效能的團隊建設
項目管理溝通計劃
構建高效的研發與自動化運維
某大型電商雲平臺實踐
互聯網數據庫架構設計思路
IT基礎架構規劃方案一(網絡系統規劃)
餐飲行業解決方案之客戶分析流程
餐飲行業解決方案之採購戰略制定與實施流程
餐飲行業解決方案之業務設計流程
供應鏈需求調研CheckList
企業應用之性能實時度量系統演變 緩存
若有想了解更多軟件設計與架構, 系統IT,企業信息化, 團隊管理 資訊,請關注個人微信訂閱號:性能優化
![MegadotnetMicroMsg_thumb1_thumb1_thu[2] MegadotnetMicroMsg_thumb1_thumb1_thu[2]](http://static.javashuo.com/static/loading.gif)
做者:Petter Liu
出處:http://www.cnblogs.com/wintersun/
本文版權歸做者和博客園共有,歡迎轉載,但未經做者贊成必須保留此段聲明,且在文章頁面明顯位置給出原文鏈接,不然保留追究法律責任的權利。 該文章也同時發佈在個人獨立博客中-Petter Liu Blog。 服務器