Kris
Kris

Reputation: 1840

Lightweight database (SQL or NoSQL)

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.

Upvotes: 23

Views: 61457

Answers (2)

andrew cooke
andrew cooke

Reputation: 46882

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.

Upvotes: 21

Dan
Dan

Reputation: 1745

When choosing between a relational database or a document-oriented database, it is best to focus on the data storage needs of the specific application. If an application better suited for a relational database is written on top of a document-oriented database such as MongoDB, it will be less efficient and consume more resources.

Upvotes: 4

Related Questions