Calling Developers!
We are reenergizing our code contribution process! Learn More

main domain over multiple AWS instances (regions) and Geo DNS

Options
matthias.frick
matthias.frick CTO & Spryker Engineer @ Antiloop GmbH Spryker Solution Partner Posts: 2 🧑🏻‍🚀 - Cadet

Hi!

Does anybody has experience with following requirements:

  • shop.customer.com/country1/language1 → points to store in AWS region in Australia for example
  • shop.customer.com/country2/language1 → points to store in AWS region US-east
  • shop.customer.com/country3/language1 → points to store in AWS region US-east as well
  • shop.customer.com/country4/language1 → points to store in AWS region somewhere else

If I take a look at the documentation and suggestions from Spryker it is always about using a single domain for a store (independently of using multi-db or single-db setup and also one or more AWS instances). I also saw some custom workaround already using the above pattern within one AWS instance (which worked quite good and only needed some customization in the bootstrapping Yves).

My question now → is above mentioned requirements even possible to achieve - and also to work with Geo DNS for example? Important is the part using the same main domain for all stores over multiple AWS regions and some of them in a single-db and others in multi-dbs split up. Each store should also have different ZEDs and Backoffice applications.

Thanks and regards,

Matthias

Answers

  • victor.vanherpt
    victor.vanherpt Spryker Solution Partner Posts: 41 🪐 - Explorer
    edited April 25
    Options

    Hi there @matthias.frick! We are currently in the process of implementing this in our project through the 'Dynamic Multistore' ( https://docs.spryker.com/docs/pbc/all/dynamic-multistore/202307.0/base-shop/dynamic-multistore-feature-overview.html ) feature, although we are sharing 1 backoffice across different stores and share the same db.

    We are currently ironing out some bugs/missing features related to the non-controller managed routes (storageUrls).

    I believe you could get around this with url enhancers and some custom logic (we "almost" got there last year, but as Spryker was releasing Multistore with the single-domain concept, we decided to wait).
    Check

    \Pyz\Yves\Router\RouterDependencyProvider::getPostAddRouteManipulator
    \Pyz\Yves\Router\Plugin\RouterEnhancer\LanguagePrefixRouterEnhancerPlugin
    \Pyz\Yves\Router\Plugin\RouterEnhancer\StorePrefixRouterEnhancerPlugin

    and

    \Pyz\Yves\Router\RouterDependencyProvider::getRouterEnhancerPlugins
    \Spryker\Yves\Router\Plugin\RouteManipulator\StoreDefaultPostAddRouteManipulatorPlugin
    \Spryker\Yves\Router\Plugin\RouteManipulator\LanguageDefaultPostAddRouteManipulatorPlugin


    If you follow the https://docs.spryker.com/docs/pbc/all/dynamic-multistore/202311.0/base-shop/install-and-upgrade/install-features/install-dynamic-multistore.html#install-feature-core guide you should get most of the idea.

    Once I've checked the storage router issues (I received some guide from spryker dev), I can share the result here if you're interested.

    Another way we thought about going was have a 'front' load balancer (ngninx) that would route requests to each of the stores, but it was decided in our project that staying 'spryker standard' was a priority.

    I believe you can even run your containers through the deploy file, so it is a 'doable' quest, but you'd probably want do do some aws ingress setup.
    Good luck ;)