Site architecture

This is more or so a general question. I have spent the last week, looking into site architecture. It seems many companies use lots of subdomains while some use subdirectories. Some companies use remote databases while others use local servers.

My personal opinion is simple is more likeable. For example, why have api.example.com when you can just have example.com/api? It doesn’t make a lot of sense to me because the API is more than likely pinging the same server the website files are on.

Do we have to do what everyone else does or can we just make it more simple for the everyday person? Any thoughts?

Well sometimes you see the different domains because different domains can be used to download multiple items concurrently.

Besides that, some people find it easier to use api.example.com than example.com/api. I for one find the subdomain version easier and simpler. It is a preference as to which one you use. I also thought I remember seeing that search engines actually like the subdomain version better and rank it higher in authority, but I am not sure.

Many of the differences you see can also be for scalability and for a whole slew of other reasons.

Either way, you should always be striving to make things easier for the user so do whatever you think accomplishes that. :slight_smile:

1 Like

It doesn’t necessarily matter, except that it really annoys me the way so many sites use a subdomain for, say, documentation, and then don’t provide a link back to the main site. It’s so stupid. And the subdomain makes it more fiddly to get back to the main site, as you have to mess with the URL or even do a new search.

2 Likes

Couldn’t agree more.

1 Like

In my case it is the “maintainability” is why I use sub domains. Like one big monolith vs many small micro services. Small apps with isolated tasks that communicates with each other. Like a big company needs more overhead than 10 small subsidiaries that work together.

By using micro services you can make it safer and sometimes simpler. Communicate with the API only by internal IP on a separate isolated server you can make it harder for hackers.

But at the end of the day this is about opinions and personal preferences. But I admit that micro services is harder to grasp, but it sure is simpler to maintain in the long run. And micro services is easier to manage using sub domains. IMHO.

One difference I seem to recall - unfortunately I don’t know where now - but Google used to say it considered subdomains as separate websites, whereas subdirectories are part and parcel of the same site.

1 Like

DNS can be configured to use a different IP address depending on the subdomain. That can provide a significant amount of separation. I do not know if DNS can be configured differently using the other syntax.

Instead of designing an application to fit a solution it is better to design a solution to fit an application. In other words, design the application then choose which syntax to use.

1 Like

Seems like it may be different for everyone and each environment may call for different configurations.