HIIT / mydata-sdk

Moved to https://github.com/mydata-sdk/mydata-sdk-1.x, HIIT repo is archived. Contains the different projects and libraries of MyData Service Development Kit. NOTE: Related Service Registry's code repository can be found at http://github.com/digitalhealthrevolution/serviceregistry
MIT License
8 stars 5 forks source link

ui.registry.sandbox.mydata.fi - Eh? #4

Closed HarriHonko closed 7 years ago

HarriHonko commented 7 years ago

Not very good design to have this deep subdomains... registry.sandbox.mydata.fi is also fairly long already. Let's discuss the approach for navigating and accessing different parts of the Sandbox?

Allu2 commented 7 years ago

Deep subdomains are partly caused by the way sandbox itself is deployed To explain it properly one must first know how the routing in sandbox works.

When browser makes request to *.sandbox.mydata.fi or sandbox.mydata.fi each request is passed onto Kong instance that has routing information set up to be "by domain"

Each service we use currently in sandbox, such as the Service Registry, Service Registry UI or the Landing page itself is separate docker container that Kong routes the request based on domain.

For example when browser requests http://sandbox.mydata.fi/ Kong routes the request to local address http://lighttpd:80/ which then serves the landing page.

On the other hand registry.sandbox.mydata.fi points to the Java based Service Registry and I setup ui.registry.sandbox.mydata.fi for the UI since it felt logical making it clear it was ui for the Service Registry. Its possible to change this to registry-ui.sandbox.mydata.fi or even ui.sandbox.mydata.fi if it feels better.

Kong also supports routing by path, so it is possible to make something like sandbox.mydata.fi/registry/ point at the Service Registry, and sandbox.mydata.fi/registry-ui/ to point at the UI.

However its important to note that this support is exclusive, ether we route by subdomain or by path, there is no support for both at the moment.

The main problem this approach introduced was that serving html content, such as the landing page at the root path becomes near impossible.

Since if root of http://sandbox.mydata.fi/ points to lighttpd container, sub paths such as /css and /js also will point to said container which is fine and makes the website work. However any other path would also end up being routed to the lighttpd instance. Alternatively we could make the landing page be at http://sandbox.mydata.fi/landing/ but from the feedback I got earlier from my team it was deemed crucial that the landing page was at the root of the domain, thus I opted to use the domain based routing.

Long subdomains are party also caused because only domain that I know of we have been given to use is the sandbox.mydata.fi and every subdomain I can assign will be under it.

PS: Perhaps there is another place more appropriate for these issues since they deal with the MyData Sandbox/Service Registry UI which are not currently included in this repository?