Cloud Foundry 服务与应用程序

Cloud Foundry service vs app

Cloud Foundry中service/user provided serviceapps的概念有什么区别?毕竟两者都公开了 URL

那么建议什么时候创建服务,什么时候创建应用?

app 位于堆栈的顶部,通常有一个用户界面。它使用服务(建立在服务之上)。 Cloud Foundry 应用程序通常在浏览器中运行,可通过 URL 访问。有apps that have no route(不可访问URL)。

A service 提供消耗性功能。它还有一个 URL,以便应用程序或其他服务可以访问它。典型的服务是数据库或机器人/对话/对话服务、地图或某些登录/密码服务。

为了让它更有趣,有些服务可以包装应用程序并使应用程序的功能可通过 URL 访问。我建议阅读演示如何在服务上构建应用程序的 Cloud Foundry overview or Bluemix overview. You may also want to check out some samples here or here

回答有关何时构建服务或应用程序的部分:
- 是针对最终用户的功能吗?它有用户界面吗? =>应用
- 它会被其他应用程序或服务使用吗? => 服务

考虑这一点的一种方法是从依赖关系的角度来看:

Applications typically depend on services such as databases or third-party SaaS providers. When a developer provisions and binds a service to an application, the service broker for that service is responsible for providing the service instance.

Source: https://docs.cloudfoundry.org/concepts/architecture/#services

另一方面,服务往往不依赖于应用程序。