轻量级数据库(SQL或NoSQL) [英] Lightweight database (SQL or NoSQL)

查看:300
本文介绍了轻量级数据库(SQL或NoSQL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在一个网站,必须存在于一个虚拟机具有非常低的内存可用性(目前我被告知要512mb)。不幸的是,至少在不久的将来,数据库和Web应用程序必须是同一个服务器。



现在我已经阅读了一些问题,并试图做我自己研究,但有只有这么多的选择可供选择。基本上,什么将是一个足够轻松的数据库服务器,我可以安装? SQL或NoSQL并不重要;它不会是数据库密集型的,但我不想约束与我现在选择的任何。这意味着,如果可能,一个路径多服务器缩放将是伟大的,但显然不是在这个阶段的要求。



我目前的想法是MongoDB或MySQL,不确定这些是否是最好的选择。



我的web应用程序正在使用PHP运行在nginx上,我认为这是目前最好的选择,所以我主要关注的是数据库如果您需要最轻的 - 重量数据库,我会说

http://sqlite.org/rel =noreferrer> sqlite 3 。它的目的是为这个任务,是小而快的,在我的经验是可靠和易于使用。



我不使用php自己,但似乎有支持这里



sqlite支持几乎标准的sql,除了它不强制类型 - 你可以定义一个列为文本,但存储和检索整数值,如果你觉得。在实践中,这不是一个大问题,只要你不使用这个功能,你可以切换到一个更大的数据库在未来有点麻烦。



但实际上,我会从mysql开始,因为它可能已经安装和可用。如果它给你内存使用的问题,切换到sqlite。但对于一个简单的,没有褶边的数据库,你可以从mysql开始。


I'm currently working on a website that must exist on a VM with very low memory availability (at the moment I am told to expect 512mb). Unfortunately, at least in the immediate future, the database and web application must be the same server.

Now I've read through some questions here and tried to do my own research but there are just so many options to choose from. Essentially, what will be a light enough database server that I can install? SQL or NoSQL doesn't really matter; it won't be database intensive but I would like to not be constraint with whatever I choose now. Meaning, if possible, a path towards multi-server scaling would be great but obviously not a requirement at this stage.

My current thoughts are either MongoDB or MySQL but I'm not sure if those are the best choices.

My web application is running on nginx with PHP which I think is the best choice for now so my main concern is the database side.

解决方案

if you need the lightest-weight database i would say sqlite 3. it's purpose designed for this task, is small and fast, and in my experience is reliable and easy to use.

i don't use php myself, but there appears to be support here.

sqlite supports pretty much "standard" sql, except that it doesn't enforce types - you can define a column to be text, but store and retrieve an integer value, if you feel like it. in practice, it's not a big deal and as long as you don't use this "feature" you can switch to a larger database in the future with little trouble.

but, in practice, i would start with mysql since it is likely already installed and available. if it gives you issues with memory use, switch to sqlite. but for a simple, no frills database, you might as well start with mysql.

这篇关于轻量级数据库(SQL或NoSQL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆