this post was submitted on 23 Dec 2023
13 points (93.3% liked)

Selfhosted

40152 readers
510 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
13
Scale to other countries (lemmy.dbzer0.com)
submitted 10 months ago* (last edited 10 months ago) by Mateleo@lemmy.dbzer0.com to c/selfhosted@lemmy.world
 

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 πŸŽ„πŸŽ

you are viewing a single comment's thread
view the rest of the comments
[–] lemmyvore@feddit.nl 11 points 10 months ago* (last edited 10 months ago) (2 children)

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.

[–] jlh@lemmy.jlh.name 3 points 10 months ago

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

[–] Mateleo@lemmy.dbzer0.com 2 points 10 months ago

I'll check it out, I'll learn more about CouchDB. Thks ;)