持有 1 核 1G 内存 50GB 数据盘 MySQL 数据库一台,准备用来存网站日志,每日日志~500M,大家看看这样设计表合理吗?
引擎计划用 innodb,列名前面有星号的计划建立索引。
请求记录(按路径、状态、时间 统计受访 PV )
request_id | request_method | host | *request_uri | http_status | body_bytes_sent | *time_local | logpath_id
请求来源(按域名 统计来源 PV )
request_id | *referer_host | referer_url
请求用户(按系统、浏览器、用户 IP 统计访问次数)
request_id | *user_ip | system | browser | user_agent | *x_forwarded_for
个别请求需要的自定义记录
request_id | *meta_key | meta_value
日志来源(日志追溯)
logpath_id | log_path
有必要这样分表吗?这样搞下来会不会两个月日志都存不下?
引擎计划用 innodb,列名前面有星号的计划建立索引。
请求记录(按路径、状态、时间 统计受访 PV )
request_id | request_method | host | *request_uri | http_status | body_bytes_sent | *time_local | logpath_id
请求来源(按域名 统计来源 PV )
request_id | *referer_host | referer_url
请求用户(按系统、浏览器、用户 IP 统计访问次数)
request_id | *user_ip | system | browser | user_agent | *x_forwarded_for
个别请求需要的自定义记录
request_id | *meta_key | meta_value
日志来源(日志追溯)
logpath_id | log_path
有必要这样分表吗?这样搞下来会不会两个月日志都存不下?