Want more timely Centmin Mod News Updates?
Become a Member

horizontal scale payment problems

Discussion in 'Ecommerce / Shopping cart usage' started by adamus007p, May 3, 2020.

  1. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    4:05 PM
    Hello,

    I have I have two servers EU and USA.

    Geo DNS from AWS Cloudfront. Not Cloudflare. Cloudfront is not a Cloudflare.


    I have noticed that very rare but sometimes geoDNS is tricky.

    It redirect customer after the order to wrong shop and there is no order in BO.

    Payment is done, but there is no registration order.


    Have you faced with similar problems?


    I think that is because on payments like paypal there is no redirect to correct server by IP or something for better return/validation of the server side.

    It use domain but it is wrong redirected.

    The same problems with stripe.


    No errors in logs, nothing. I think that is only related to geoDNS.



    Have you ever heard about such problems?
    Any idea about the workaround?



    PS. I was testing on London ip (VPS) and when I refresh I was connecting to US but London IP should be connect EU VPS. After refresh and testing this IP on AWS side it jump to EU.


    I see problem with Cloudfront,it is very very rare but exist.

    @eva2000 Have you ever any problems with geoDNS in Cloudflare or in Cloudfront?
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,068
    12,176
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,734
    Local Time:
    1:05 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    You need to use a load balancer which supports sticky user sessions, so the same user is redirected back to the same origin backend. It shouldn't be a problem if you have your database backends in sync via clustering/replication so that the data is on all your servers. Otherwise you will always have problems like these.

    Also IP geo location data isn't always accurate so IP geo location can be out of date.
     
  3. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    4:05 PM
    Hello @eva2000 which load balancer support it?

    Unfortunately I have implemented other solution then replicate/clustering everything.
    Now I realize about such problems which could happen.

    Which solutions do you recommend for clustering/replication?
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,068
    12,176
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,734
    Local Time:
    1:05 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    see ecommerce, other application how to Scale Horizontally

    for load balancers most already do support sticky sessions just consult the documentation
     
  5. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    4:05 PM
    I use Cloudfront from Amazon AWS.

    I need to check a way how I handle different shops, replicate/clustering everything.
    Thank you for your answer.
     
  6. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    4:05 PM
    I will write a case:

    Customer from EU is connecting to EU shop. Go to paypal to exteral website, pay and it is redirected to domain.com (the shop address).

    The for example Paypal server is located in USA or redirect is going to USA VPS not to EU.
    Paypal do not know about 2 VPS, use just a domain.com and the geoDNS make a mess and redirect to wrong VPS.

    @eva2000 Could it happen theoretically?
     
  7. eva2000

    eva2000 Administrator Staff Member

    54,068
    12,176
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,734
    Local Time:
    1:05 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah that would be problematic and sticky sessions may help as you could sticky on a hash of visitor's IP, so when load balancer seems the same visitor's IP hashed it would redirect visitor back to correct backend origin. Or use an identifying session cookie at loadbalancer level where you do the geo redirection so load balancer can identify the visitor on paypal redirect. You wouldn't be able to use just geographic location to direct visitors.

    Unfortunately, this is beyond Centmin Mod free forum support as Centmin Mod is provided as is. This would be something you need to hire someone to sort out for your specific issues and web applications usage.
     
  8. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    4:05 PM
    identifying session cookie at loadbalancer level

    is it any option to setup on Cloudflare? In Pro version?
    @eva2000 may you advise?


    I have also other idea.
    Use subdomnain only for redirection of payments. Then to redirect in nginx to main domain.
     
  9. eva2000

    eva2000 Administrator Staff Member

    54,068
    12,176
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,734
    Local Time:
    1:05 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Not sure if it's what you need but Cloudflare loadbalancer can redirect based on cookie headers General best practices for load balancing at your origin with Cloudflare using what it calls Session Affinity = sticky sessions