多领域站点设计决策

发布于 2024-07-27 14:50:59 字数 293 浏览 5 评论 0原文

我正在开发一个项目,其领域对我的母语来说是有意义的。 所以我购买了第二个英文域名供全球使用。

我的问题是,我应该如何构建我的网站?

  • 两个不同的项目还是一个具有本地化支持的项目?
  • 两个不同的数据库还是共享数据库?

我的目标是什么?

  • 不想在本地站点中显示英文内容,反之亦然
  • 我想轻松更新站点

如果您建议我使用共享数据库,您能向我描述一下数据库的设计原理吗?

谢谢。

i am developing a project that its domain is meaningful in my native language. So i bought a second English domain for global usage.

My question is, how should i construct my site?

  • Two different projects or one project with localization support?
  • Two different databases or shared database?

What is my goal?

  • Dont want to show English content in native site, vice versa
  • I want to easily update site

If you suggest me to use shared database, could you please describe me design principle of database?

Thank You.

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

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

发布评论

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

评论(2

眉目亦如画i 2024-08-03 14:50:59

通常,对于应用程序代码,您最好不要出于任何原因(包括语言)分叉。 您需要注意一些快速的事情;

  • 确保字符串不是硬编码的
  • 以 UTC 格式存储所有日期时间
  • 确保所有用户配置文件都有关联的时区(您可以从用户的浏览器中获取该时区)
  • 尝试确保您的演示文稿与页面内容分开(即使用 CSS、母版页、模板)或您的平台支持的任何数据库),

这更多地取决于您持有的数据,例如,

  • 您希望用户在两个站点之间共享登录信息
  • ,但不一定本地化(维基条目)
  • 。共享资源(即单个仓库)

但是,

如果您发现以下情况属实,则

  • 您不希望/不需要站点之间的用户交叉(例如 amazon.com 和 amazon.co)。 uk)
  • 知识是完全独立的,一种语言的条目与另一种语言无关。
  • 站点管理完全独立的资源(即两个独立的仓库)

您可能倾向于两个独立的数据库,这将为您带来扩展方面的优势(尽管它不是一个)。银弹),只要数据库之间的模式相同,您可能会发现它并不太繁重。

另一种选择是识别共享资源并将其拆分到另一个存储库中(例如用户登录等......)。 这可以让您两全其美,但当然这是一个更复杂的设计。

请记住,所有这些都可以在事情变得更困难之后添加。 有时,进入市场比尝试预先解决所有问题更重要。

祝你好运!

Typically for application code you ideally want to not fork for any reason including language. There are some quick things you need to watch out for;

  • Ensure that strings are not hardcoded
  • Store all datetimes in UTC
  • Ensure that all user profiles have an associated timezone (you can grab this from the user's browser
  • Try to ensure that your presentation is separate from your page content (i.e. use CSS, Master Pages, Templates or whatever your platform supports).

As for the database this depends more on the data your holding, for example if;

  • You want users to share logins across both sites
  • Knowledge to be shared but not necessarily localized (Wiki Entries)
  • The sites are managing a shared resource (i.e. a single warehouse)

You might want to have one database.

However if you find the following are true;

  • You don't want/need users between the sites to have cross over (think amazon.com and amazon.co.uk)
  • Knowledge is wholly separate with entries in one language being irrelevant to the other
  • The sites are managing wholly separate resources (i.e. two separate warehouses)

You might lean towards two separate databases. This will give you an advantage in scaling (though its not a silver bullet) and as long as the schemas are identical across the databases you will likely find that it's not too onerous.

One other option is to identify shared resources and split them into another repository (think user logins etc...). This can get you the best of both worlds but of course is a more complex design.

Remember all of this can be added after the fact it just becomes harder. Sometimes it's more important to get to market than it is to try and solve all your problems up front.

Good Luck!

牵你的手,一向走下去 2024-08-03 14:50:59

我不太确定什么对你有用,但我认为本地化支持会很好,如果你有一个共享数据库,你就不需要支持不同的数据库,也不需要添加额外的数据库任何时候你需要添加一种新语言,并且考虑应用程序,如果你想要另一种语言只是将其添加到你的配置中,而不是创建另一个项目只是为了添加它,那么会更容易。

I'm not quite sure what could work for you, but I think that localization support would it be nice, and if you have a shared database you won't need to support to different databases and you won't need to add an extra database anytime you need to add a new language, and thinking about the application it would be easier just to if you want another language just to add it to your configuration and not create another project just to add that.

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