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.