Architecture microservices url : host vs path ? What is your preferred method?

Hello,

To create address plan microservices, there are basically two approaches:

  1. A path-based approach:
    myapps.contoso.com/a → microservice a
    myapps.contoso.com/b → microservice b

Advantages:

  • Requires only one TLS certificate

Disadvantages:

  • Redirection can be a problem
  1. A host-based approach
    a.app.contoso.com’ → microservice a
    b.app.contoso.com" → microservice b

Advantages:

  • transparent

Disadvantages:

  • Often requires a widlcard certificate on * .app.contoso.com

What is your preferred method?

Regards
Bruno