Search code examples
javawebdeployment

How global website is deployed for diff countries?


I’m trying to understand how deployment happens when we have website like Amazon, which runs in various countries.

Let’s say, if I’ve a website like Amazon, for example myweb.de (Germany).

So what’s an ideal approach of deployment ? My doubt is, Do I need to deploy my Germany specific website in Germany only ?

Second doubt is, If we have a websites for multiple countries, So for every country different websites needs to be developed..?

Please help me to understand this and share some resources if possible.

Thanks


Solution

  • The difference between languages may mean many things. For the purpose of this answer I will assume that there is a graphic template to be shown in all versions of the website, but the texts to be displayed are differing somewhat. Of course, in reality you may have different animations, different pictures, etc., but for the sake of brevity, we shall concentrate on textual changes.

    Now, if the graphics are the very same for all versions, then, ideally you will have it at a single place for any computer that would operate as a server and each and any request would be reaching out to this place. So, let's suppose that you have a location like

    /your/path/to/the/root/folder
    

    and you may use one or more servers where the location is to be reached this way. Now, you may have a few files, like en.json, de.json, etc. with content such as

    {
        welcome: "welcome",
        hello: "hellow"
    }
    

    for en.json and you would have a German version for de.json. Of course, you can represent your language mapping in a different manner, like storing it in a database, or whatever.

    Now, your different domains representing different languages would have to be aware which language file it has to load and your graphic template should be aware of the message, an example chunk may look like this:

    <h1>{{ language.welcome }}, {{ username }}!</h1>
    

    and somehow your renderer should be able to infer from the above that language.welcome is referring to the text represented by your welcome key in your language, whereas username is dynamic, variable information to be displayed.

    Of course, this can be done in many different ways, but the main idea is:

    • you want a single graphic UI if possible on your server, even if more languages are being supported
    • you want to map abstract messages into their language representation for each language
    • your renderer should be able to detect where language mapping is needed
    • your website should be aware of which language it needs to load the mapping values from