Hello everyone !
I have a node app and a PostgreSQL DB in VPS using Docker, with Coolify as a CI/CD, nothing too fancy, you might say.

My question is the following.
I have a lot of read/write on my DB and even the lowest increase in DB latency can have an impact on my users’ experience. As my VPS is in France, what could be the best/easiest (selfhosted?) option to solve this problem in other regions (North America, Asia…) ?

Thks in advance 🎄🎁

  • lemmyvore@feddit.nl
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    11 months ago

    Caching and/or DB hosted in a region closer to your users, or perhaps even in their browsers (if the data is not sensitive).

    Naturally, if you use secondary DBs you will have to deal with data replication.

    Is hitting a real RDBMS absolutely necessary? Consider producing precomputed data sets which can be cached as JSON or with other non-dynamic, storage-only methods. A distributed CDN can be much cheaper than a VPS.

    Also consider if Postgres is really your best option. You could use various other database engines that can optimize certain factors: some could be cheaper, or make replication easier etc.

    For example (just one example out of many, may not even be applicable to you) using CouchDB on server and PouchDB on browser would make data replication and propagation extremely easy, and it’s also a very efficient and scalable query engine.

    • JustinA
      link
      fedilink
      English
      arrow-up
      3
      ·
      11 months ago

      I’ve never used it, but I believe cockroachdb is also an option for multi-region replication.