存储用户之间的离线消息的最佳方法?
我的网站托管商允许我使用无限数量的 MS SQL 数据库 - 但每个数据库最多只能为 3GB。
我的用户数据库与我的主数据库是分开的。主数据库包含几个由字符串和数字(无 blob)组成的表,例如:“Messages”、“BugReports”、“UserOptions”
我允许用户之间的离线消息 - 当消息无法传递时,它存储在“消息”表。这很有效,但我担心:从长远来看,当网站获得大量流量并且数据库接近 3GB 时会发生什么?
我应该将“Messages”和“BugReports”表设置为单独的数据库吗?
my website-hoster is allowing me unlimited amount of MS SQL databases - but each database may only be a max of 3GB.
My Users database is separate from my Main database. The Main db contains several tables consisting of strings and numbers (no blobs), for example: "Messages", "BugReports", "UserOptions"
I am allowing offline messages between users - when a message can't be delivered it is stored in the "Messages" table. This works great, but I worry: in the long term, what happens when the website gets a lot of traffic and the database nears 3GB ?
Should I make the "Messages" and "BugReports" tables separate databases instead ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您将它们存储在单独的数据库中,它们仍然会填满该数据库,不是吗?因此,您需要将
Messages
表分片到多个数据库中。如果您的站点非常成功地获得了足够的流量,以至于遇到了 3Gb 的限制,那么请考虑将提供商更改为允许更大数据库、专用主机或并置的提供商。是的,您可以争辩说,如果您让您的应用程序在 3 GB 分片上运行,您以后可以更轻松地扩展,但您将花费大量精力来使其工作超越这样的人为限制。相反,您可以将精力花在对最终用户有用的功能上。有了良好的设计,3Gb 应该可以发挥很大作用。
If you store them in a separate database, they will still fill that one up, wouldn't they? So you'll need to shard the
Messages
table across a number of databases.If you 're site is so successful to get enough traffic that you run into the 3Gb limit, then look at changing the provider to someone that allows bigger databases, or a dedicated host, or collocation. Yes, you can argue that if you make your app work on 3 GB shards you can scale easier later, but you'll spend a lot of effort to get this working to surpass such an artificial limit. Spend you effort on features useful to your end users instead. With a good design, 3Gb should go a long mile.
在您的服务器上托管 MyPhpAdmin。我不确定您的托管服务是谁,但其中很多都提供无限的磁盘空间。这样您将拥有无限容量的无限数据库。
Host MyPhpAdmin on ur server. I'm not sure who your hosting with but a lot of them offer unlimites disk space. That way you will have unlimited databases with unlimited capacity.