4 ms·
I understand your point, but the problem with low-traffic websites is that they often suddenly - without warning - become high-traffic websites for a day or two
by workhere-io 13y ago
I understand your point, but the problem with low-traffic websites is that they often suddenly - without warning - become high-traffic websites for a day or two when some larger website links to them. We've all seen it here on HN: Some article gets linked to, the server goes down, and people are forced to see the article on the Google cache.
So my point is this: Why not instead go for a database that was actually made to handle these kinds of situations? True, using PostgreSQL or MySQL won't in itself ensure that you'll survive a slashdotting/HN'ing, but your chances are better. (And obviously, your chances are even better if you use some sort of caching, but that's a different story).
- LordIllidan 13y agoNever used sqlite for websites, but wouldn't this problem be better handled by caching? I.e. completely bypass the database, especially for users who will never log in. E.g. Varnish.
- workhere-io 13y agoSure, but you're paying a price in terms of complexity: Many simple sites with PostgreSQL/MySQL can handle being slashdotted without having a cache (unless you're using a heavy CMS such as WordPress/Drupal). If you use SQLite, you might be forced to use Varnish - and there goes the initial idea of simplicity that caused you to use SQLite in the first place. Having said that, once your site goes truly high-traffic, you'll obviously need some caching. All I'm saying is that PostgreSQL/MySQL can easily handle moderately high traffic if your website is not a heavy CMS.
- daliusd 13y agoSome facts. I'm not sure how is that helpful in real life or how important but I'm adding them just for information: * SQLite itself has configurable cache and some other caching options: a) http://www.sqlite.org/pragma.html#pragma_cache_size http://www.sqlite.org/pragma.html#pragma_cache_size b) https://www.sqlite.org/sharedcache.html https://www.sqlite.org/sharedcache.html * Node.js has SQLite library with caching option (matter of single line). https://github.com/mapbox/node-sqlite3/wiki/Caching https://github.com/mapbox/node-sqlite3/wiki/Caching . It might be possible that other languages has something similar as well. P.S. Here is one of sites running on SQLite http://skaityta.lt/ http://skaityta.lt/ with some caching.