Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 515
Kris Avatar asked Apr 14 '12 04:04

Kris


People also ask

What is the lightest database?

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.

Which database is faster SQL or NoSQL?

As for speed, NoSQL is generally faster than SQL, especially for key-value storage in our experiment; On the other hand, NoSQL database may not fully support ACID transactions, which may result data inconsistency.

Which is better SQL or NoSQL?

SQL databases provide great benefits for transactional data whose structure doesn't change frequently (or at all) and where data integrity is paramount. It's also best for fast analytical queries. NoSQL databases provide much more flexibility and scalability, which lends itself to rapid development and iteration.

Is NoSQL better for read heavy?

So performing read or write operations on a single data entity is faster for NoSQL databases as compared to SQL databases.


1 Answers

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.

like image 163
andrew cooke Avatar answered Oct 06 '22 01:10

andrew cooke