Hello, there is this online shop we are working on, however when big discounts come, the server cannot handle all of the requests. I was thinking of using multi-server website, to use reverse proxy or dns settings to load-balance the traffic, but to have them all connect to a single external database, so all the requests and the quantity of the products get refreshed in real time.

Is this the correct way to do such thing?

  • ElevenNotesB
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    No. You can scale horizontal or vertical. Beefier servers or more servers. Get a DB that supports multi read/write to all instances in a cluster like CockroachDB. Use a caching layer like Redis and use lots of web workers for the incoming connections. Spread the load. Use Traefik or nginx as additional caching. Do not use static content on your cluster but use a CDN for that.