Google App Engine (GAE) 应用程序的多域部署

发布于 2024-08-08 11:36:46 字数 275 浏览 2 评论 0原文

我们希望开发和销售定制的商业 GAE 应用程序。我想要有关在任意 Google Apps 域(即不是 appspot)上部署 GAE 应用程序的信息。

假设我们的公司是 abc.com,我们正在向 def.com 和 xyz.com 销售应用程序。在客户的域上部署我们的应用程序的步骤是什么?

当应用程序部署在多个域上时:

  • 代码是否重复或共享?
  • 数据存储定义是否重复或共享(或更准确地说是类型)?
  • 是否向实体添加了任何域属性?

We would like to develop and sell custom commercial GAE applications. I would like information on the deployment of GAE applications on arbitrary Google Apps domains (i.e. not appspot).

Suppose our company is abc.com and we are selling app to def.com and xyz.com. What are the steps to deploy our app on our customer's domain?

When an app is deployed on many domains:

  • Is the code duplicated or shared?
  • Is the datastore definition duplicated or shared (or more precisly the kinds)?
  • Any domain attribute add to the entity?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

幻梦 2024-08-15 11:36:46

对于您所描述的“多租户”应用程序,您目前有三个选择:

  1. 您可以拥有一个由客户添加到其域中的应用程序。您的应用程序将有一个数据存储区,但您可以使用 Host 标头来确定哪个客户正在访问该应用程序,并据此隔离数据存储区条目。
    • 易于部署和升级
    • 客户易于安装
    • 用户必须拥有 Google 帐户(而非 Apps 帐户)才能登录。
  2. 您可以为每个客户部署一个新的应用程序实例。
    • 部署和升级更加困难
    • 安装需要更多客户参与
    • 提供可靠的数据分离
    • 用户可以使用其应用凭据登录
  3. 您可以与 Google 合作创建新的 Apps Marketplace 应用
    • 上述第 1 点和第 2 点的所有优点
    • 需要 Google 参与
    • 尚无确定的发布日期

You have three options at the moment, when it comes to a 'multi-tenant' app such as you describe:

  1. You can have a single app that your customers add to their domains. Your app will have a single datastore, but you can use the Host header to determine which customer is accessing the app, and segregate the datastore entries based on that.
    • Easy to deploy and upgrade
    • Easy for customers to install
    • Users have to have Google accounts, not Apps accounts, to log in.
  2. You can deploy a fresh app instance for each customer.
    • Harder to deploy and upgrade
    • More customer involvement required to install
    • Provides firm separation of data
    • Users can log in with their Apps credentials
  3. You can work with Google to create a new Apps Marketplace app
    • All the benefits of point 1 and 2, above
    • Requires Google involvement
    • No certain release date yet
给妤﹃绝世温柔 2024-08-15 11:36:46

这是可能的,但据我所知,def.com & xyz.com 必须注册 Google Apps

一旦您的潜在客户在 Google Apps 中注册了域,他们不仅可以添加 Gmail 和 Google Apps 等 Google Apps,还可以添加 Google Apps。文档到子域 (mail.def.comdocs.def.com) 以及任何 GAE 应用程序 (fooapp.def.com) 。

  • 代码是否重复或共享?
    共享
  • 数据存储定义是否重复或共享(或更准确地说是类型)?
    虽然架构(定义)是共享的,但不共享的是实际数据存储。即您的应用程序的每个实例都将具有单独的数据。
  • 向实体添加任何域属性吗?
    您可以使用 CGI/HTTP 环境变量之一找出您的应用程序在哪个域下提供服务。我不记得到底是哪个变量,但一旦我查看了我的一些旧代码,我就会更新答案。一旦找到当前域是什么,您就可以选择如何处理该信息,包括将其保存到实体或简单地拒绝访问。

另一个很酷的功能是,假设公司 def.com 使用托管 GMail 并为其员工提供 Google 身份验证。现在,如果您的应用程序使用 GAE 提供的身份验证挂钩,那么您可以自动仅对他们的员工进行身份验证,而无需更改任何代码!至少,这是理论,因为我自己还没有尝试过;-)

This is possible but to the best of my knowledge, def.com & xyz.com will have to sign up for Google Apps.

Once the domain is registered with Google Apps by your prospective customers, they can add not only Google Apps like Gmail & Docs to subdomains (mail.def.com & docs.def.com) but also any GAE apps (fooapp.def.com).

  • Is the code duplicated or shared?
    Shared
  • Is the datastore definition duplicated or shared (or more precisly the kinds)?
    While the schemas (definitions) are shared, what isn't shared is the actual datastore. i.e. each instance of your app will have separate data.
  • Any domain attribute add to the entity?
    You can figure out which domain your app is being served under using one of the CGI/HTTP environment variables. I don't remember which variable exactly but I'll update the answer once I look at some old code of mine. Once you find out what is the current domain, you can choose what to do with that info, including saving it to an Entity or simply denying access.

Another cool feature about this is that let's say company def.com is using hosted GMail and have Google Authentication for their employees. Now if your app is using the GAE provided authentication hooks, then you can automatically authenticate just their employees without any code change on your part! At least, that's the theory since I haven't tried it out myself ;-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文