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

matthias.frick
matthias.frick CTO & Spryker Engineer @ Antiloop GmbH Spryker Solution Partner Posts: 3 🧑🏻‍🚀 - 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: 62 🪐 - Explorer
    edited April 25

    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 ;)

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

    Hi @victor.vanherpt,

    thanks for your input. Problem in our case is, that we have multiple databases across multiple AWS regions (own instances) and also multiple backoffices. Some stores are sharing the database and are deployed on the same instance - other are in other instances and maybe share the same database - or only are "alone" in one database (if the region for example only has one store).

    Did you do something in this direction as well already?