如何构建 Web 应用程序的域架构? - 实用建议
因此,我正在创建一个网络应用程序,它将为每个注册用户提供一个独特的“工作空间”。任何获得其许可的人都应该可以访问此工作空间。
我有我的营销网站的主域,但我正在尝试弄清楚如何管理网络应用程序本身的具体域管理。
我是否应该购买通用域,然后使用它来允许用户为他们的工作区选择其中一个域,并在那里创建一个独特的子域,或者我应该如何处理这个问题?
我的网络应用程序是用 Rails 编写的。
So I am creating a web app, that will give each registered user a unique 'workspace'. This workspace should be accessible by anybody they give permission to.
I have the main domain for my marketing website, but I am trying to figure out how to manage the nitty-gritty domain management of the web app itself.
Should I buy generic domains that I then use to allow the users to chose one of them for their workspace, and create a unique subdomain there, or how should I approach this?
My web app is written in Rails.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
术语“域”有几个含义 - 我假设您的意思是“域”,如主机名中的域名或URL,也称为“三级域名”(例如:www. mysite.com - 其中 mysite.com 是主机名)。
我之前使用过 4 级域名(也称为本地主机名,例如:images.mysite.com、admin.mysite.com),但这些是通过管理 A 的电信公司的帮助台提供的-我们域名的记录,因此这不是一个快速且简单的自动化过程。
我还看到托管公司提供基于网络的工具,允许您自己执行此操作 - 他们在其中管理 A 记录。
在这两种情况下,第四级域的管理都是手动执行的。我不知道有人在开发的应用程序中自动执行此操作 - 这显然是可能的,但绝对不简单。
这取决于。即使您托管应用程序,客户端也没有理由不能设置指向您的服务器而不是他们自己的服务器的第四级域;这意味着您的应用程序只需要查找第四级域,因为不能保证它们将使用您的应用程序“了解”的第三级域。
这取决于您想要实现的目标以及您感到满意的开销:
在这两种情况下,您的应用程序都将是多租户应用程序(除了 studioXXX.mysite 等情况) .com(网站托管在其他地方);数据访问成为一个问题——保持客户端数据分离。为此,您可以采取不同的方法,请参阅这篇有关多租户数据架构<的文章/a>. (顺便说一句 - 我知道这是一篇 MS 文章,而您正在 Rails 中工作! - 但这是一篇优秀的文章,会很有帮助)。
购买通用名称是通用的。如果您想围绕特定事物建立一个客户社区,那么就获得一个对此有意义的域名;如果您使用自己的域名,它实际上是一种广告形式。
我认为两者都可以——问题是你认为你的客户会更喜欢什么?这与您的商业模式如何相结合?域名是任何在线形象的重要组成部分(从营销方面来看),因为它有助于定义网站及其使用者的身份 - 因此请谨慎选择。
你想把这个卖掉吗?如果您愿意,您会希望将其建立在您乐意与之一起出售的域名上。因此,考虑到这一点,我将为您的产品/服务提供一个域名,并为您的业务提供一个单独的域名 - 假设您有一天想要出售该网站,而不是您的业务。或者,如果网站是业务,并且您很乐意将它们作为一个整体出售,那么我会将其全部放在同一个域名下。
最后,您可能有多个域,每个域提供不同级别的服务(每个域都可以挂有 4 级域,而不是 www):
The term Domain has a few meanings - I assume you mean "Domain" as in the hostname in a Domain Name or URL, also known as the "third-level domain name" (e.g: www.mysite.com - where mysite.com is the hostname).
I've usd 4th level domains before (also known as local hostnames, e.g: images.mysite.com, admin.mysite.com), but these were provisied via a helpdesk at the telco who managed the A-Records for our domain name, so it wasn't a quick and easy automated process.
I've also seen hosting firms provide web-based tools that allwo you to do this yourself - where they manage the A-Record.
In both cases management of the 4th level domains is performed manually. I haven't hread of anyone automating this within an app the have developed - it's obviously possible but definately non-trival.
It depends. Even if you host the application there's no reason why the client can't set-up a 4th level domain that points at your server and not their own; this would mean that your app would need to lookout for the 4th level domain only as there's no guaratee they'll be using a 3rd level domain your app "knows about".
It depends on what you want to achieve and what over-heads your comfortable with:
In both cases your app will be a Multi-tenanted one (except in cases such as studioXXX.mysite.com where the site is hosted elsewhere); data access becomes an issue - keeping the clients data separate. There's different approaches you can take for this, see this article on Multi-Tenant Data Architecture. (BTW - I know it's an MS article and you're working in Rails! - but it's an excellent article which will be helpful).
Buying a generic name is, well, generic. If you wanted to foster a community of clients around a particular thing then get a domain name that makes sense for that; if you use your own domain name it would in-effect be a form of advertising.
I think either will work - the question is what do you think you're clients would prefer? How does that stack up with your business model? The domain name is an important part of any online presence (from a marketing side) as it helps define the identity of the site and those who use it - so choose carefully.
Do you ever want to sell this off? If you do you'd want to build it on a domain name that you were happy to sell with it. So with that in mind I'd have a domain name for your product / service and a seperate one for your business - assuming that you'd one day want to sell the site but not your business. Alternatively, if the website is the business and you're happy to sell them as a whole package then I'd put it all under the same domain name.
Finally, you might have more than one domain, each providing a different level of service (and each could have 4th level domains hanging off it instead of www):