楚阿旗

博客园 首页 新随笔 联系 订阅 管理
  54 随笔 :: 1 文章 :: 0 评论 :: 5224 阅读

Modern software development

  • Delivery as a service 
  • Centrally hosted and accessed through the internet
  • Web apps, software-as-a-service
  • Twelve-factor app methodology is suited for web apps

Code -> Deploy -> Operate

 

Factor 1: Codebase: Code factor

Track in a version control system(VCS)

  • Maintain one-to-one relationship between codebase and app
  • Deploy multiple instances of the app
  • Develop differnetversions of the codebase in each deploy

Factor 2: Dependencies:Code factor.

  • Assume an app is only as reliable as its least reliable dependency
  • Explicitly declare any dependencies

Factor 3: Config: Deploy factors

  • Keep everythng that varies between deploys such as credentials and backend service locations in config
  • Keep separate from the code
  • Store config in environment variables

Factor 4: Backend services: Deploy factor.

  • Do not distinguish between local and third-part services
  • Access all services by a URL and credentials so that they can be swapped without changing the code

Factor 5: Build, release , run: Code factor

  • Build: Transform a code base into an executable unit called a build
  • Release: Combine build with configuration so that it;s ready for execution
  • Run: Run the application

Factor 6: Processes: Deploy factor.

  • Should be stateless and share nothing
  • Do not share memory and filesystmes so persistent data stored in backend service
  • Store data centally

Factor 7: Port binding:Deploy factor.

  • Export services by port binding.
  • Export HTTP and other services.
  • Declare a web server library dependency
  • Become backend services for other apps

Factor 8: Concurrency: Operate factors.

  • Scale an application
  • Stateless processes can be spun up without createing dependencies on other processes

Factor 9: Disposability: Operate factors.

  • Require minimal process start time and graceful termination
  • Quickly deply code or config changes
  • Easily scale apps

Factor 10: Dev/prod parity: Code factor.

  • Minimize differences between development and production environments
  • Use same backend services across environments

Factor 11: Logs: Operate factors.

  • App should not concern itself with storing logs
  • Threat logs as an event stream
  • Execution environment captures, aggregates, and routes logs to their destination

Factor 12: Admin processes

  • Enable one-off app management processes
  • Run against a release, using same codebase and config
  • Part of application code
posted on   楚阿旗  阅读(8)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
点击右上角即可分享
微信分享提示