2

小白问两个数据库的问题

 1 year ago
source link: https://www.v2ex.com/t/906546
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

小白问两个数据库的问题

  unt · 9 小时 28 分钟前 · 1134 次点击
1. 字段类型有必要严格按照真实类型和长度来设吗,很多时候直接 varchar(255)不行吗,我知道存储的字节数不一样,速度不一样,但是一般的小表都是 50 个字段内,数据量也不大,现在软件硬件性能也够,varchar 的扩展性非常强,对于有些项目,设置 int,datetime 等反而是给自己挖坑。所以说:在建表时如何确定设定的数据类型。

2. 现在很多关系型数据是不是也是直接用 mongo 了,而不用 mysql 了

第 1 条附言  ·  8 小时 31 分钟前

注意注意⚠️:设成 varchar(255)不是为了图方便,而是对于后期扩展的恐惧,所以,不要跑偏,而是解答下如何克服这种恐惧以及如何应对后期扩展,如何做出权衡。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK