Mobile app version of vmapp.org
Login or Join
Shelley277

: Is sqlite3 faster than MySQL on shared hosting? Can sqlite3 be faster than MySQL on shared hosting and small to average websites (less than 500 visitors a day). I have an account in a popular

@Shelley277

Posted in: #Mysql

Can sqlite3 be faster than MySQL on shared hosting and small to average websites (less than 500 visitors a day).

I have an account in a popular shared hosting provider and I've noticed that it has become quite slow redering pages. My doubt is that this may happen because the MySQL server is overloaded.

Some CMS'es work fine with SQLlite too, so I was wandering if I should use SQLite for the new sites instead of MySQL.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelley277

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cofer257

It's difficult to assess which one is going to be faster without additional details on how your shared hosting is configured.

An application that uses MySQL will need to make a connection to a MySQL server. This can be done to a remote/local host over TCP or to the local host via a Unix socket. The latter is likely to be slightly faster, since you won't have the overhead of TCP (even on localhost).

In contrast, SQLite uses a file on the same system directly. If it's on the same disk, it's likely to be generally faster than a connection to a separate server. However, some shared hosts used shared file-systems (e.g. NFS) where your actual file storage may be remote anyway.

Other factors are likely to have an impact:


The kind of locks and isolation required by your application.
The queries themselves and how the index are configured. I don't have an example in mind about SQLite v.s. MySQL, but PostgreSQL can create indices using functions (e.g. CREATE INDEX day_idx ON my_table(date_trunc('day', some_timestamp))), which MySQL can't.
Usage of prepared statements, possible caching, ...


All of this will vary depending on the actual application and specific configuration of your shared host. The only way to find out which one will work better is to try and compare.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme