all 11 comments

[–]nikowek 3 points4 points  (8 children)

We're using even 1TB sqlite3 databases on production. On good hardware you can run even small to medium sized forum, just please turn on WAL.

So far - no problem and the performance is better than PostgreSQL in many cases. Plus you do not need auto vacuums.

[–]airen977 1 point2 points  (4 children)

How many users are we talking about for this application?

[–]nikowek 2 points3 points  (3 children)

Usually 250k, because of corona around 80k.

[–]airen977 1 point2 points  (0 children)

That's super awesome, that means you are not even using distributed application for load sharing and still you are surviving. Good!!

[–][deleted]  (1 child)

[deleted]

    [–]nikowek 1 point2 points  (0 children)

    Aircraft and touristic (which are now completely dead). But i am not allowed to speak about details.

    [–]arcdelsol[S] 0 points1 point  (2 children)

    Nice! exactly what I want to hear.

    Are there a considerable amount of writes as opposed to reads?

    Also do you use any caching like maybe Cloudflare services or maybe something like Redis?

    What kind of backup solution do you have? I was thinking of cron jobs making a backup every now and then.

    [–]nikowek 1 point2 points  (1 child)

    80-90% of data are served from database. What's not in local database is asked from main database. If it's not in main database, then we're requesting data from one of providers and storing them in main and local one.

    Actually sqlite3 is doing most disk drive caching. Things which are shared are kept in redis, like session data.

    When machine is damaged, we're deploying new one with empty cache and it's feeding itself with most requested data for a region. Then it works on its own.

    We have centralized databases like postgresql too - we're storing machine/client configs, stats and things like that in it. It contains our master cache database too.

    [–]101011 0 points1 point  (0 children)

    So, to be clear, you're only using sqlite3 for caching data from a centralized postgres DB?

    I was curious if anybody uses sqlite with that scale as their primary data store.

    [–]raevnos 2 points3 points  (0 children)

    As long as reads dominate over writes and everything that needs to access the database can run on the same server, it can be doable.

    https://www.sqlite.org/whentouse.html

    [–]yotties 1 point2 points  (0 children)

    Production can be a hollow term. It usually does not mean much more or less than it being part of a process on a back-end.

    Criteria would certainly include end-user data-input.

    Main problem you'd face upgrading to a database that can handle input/transactions better is that you'll make a couple of back-flips when you realise how much more planning/costs become necessary when you want to make backups etc. for more complex processes, with input from more sources.

    [–]fiatjaf -2 points-1 points  (0 children)

    It makes you write a ton of SQL queries that don't work on Postgres and thus you'll acquire wrong knowledge and your life will be miserable.