Projects

Why Use Singleton for Globalization? Understanding the Key Benefits

Simplify and Standardize Software Globalization

VMware has an ongoing commitment to help our partners and customers transform their businesses. Through expanding and enhancing our product lines, we offer full suites of products to deliver dynamic, scalable, integrated and efficient solutions. As VMware grows, one of our goals is to streamline the globalization (g11n) process for VMware products. Our efforts in the past year as part of our application ecosystem have led to more and more product teams adopting Singleton, an open-source framework and solution for streamlining the interconnection between software internationalization (or i18n) and localization (or L10n).

The Singleton solution decouples software i18n and localized resources from the application software. It delivers a web service that serves localized resources over a REST API. The application software consumes these localized resources by integrating a Singleton client library that sends HTTP requests to the API endpoints. In this blog, we are going to take a look at the key benefits of using Singleton.

Microservices Architecture

A microservices application architecture involves breaking a monolithic application into its component functions or services. The Singleton web service sits well within this architecture, acting as a component microservice that can run on a container on a cloud-based server. 

Using Singleton provides a microservice that serves localized resources to all other microservices over an API.

Centralized Locale Data

Often, applications use many services written in different programming languages. Traditionally, each service is localized by using the locale data source that is incorporated in the programming language’s Software Development Kit (or SDK). However, this potentially introduces L10n inconsistencies. For example, two different SDKs, or worse, two different versions of the same SDK, may localize a calendar date differently, even if using the same locale. This is because each SDK may be using a different locale data source. See examples below.Using Singleton provides a single instance of the above mentioned date pattern (or any other locale data), hosted in the Singleton web service, which can be utilized by any other service in the application.

Consistent Localization

The Singleton web service provides the implementation of L10n-specific features such as locale matching, locale fallback mechanism and L10n resource caching.

Using Singleton means that there will be no need to implement L10n-specific features in individual microservices of an application. Moreover, the same Singleton web service can also be used by multiple applications in an environment. For example, multiple services in VMware Cloud Services use a single instance of the Singleton web service, streamlining the utilization of its L10n features.

Independent Deployment

Redeploying a large application for patches or updates presents some challenges including the risk of service outages.

Using Singleton decouples internationalization-related code from the core application’s codebase resulting in a smaller, faster and independent deployment. This also allows for exploration of localization-specific continuous deployment (CD) as localized resources and i18n can be implemented, tested and deployed separately, e.g. by a different team, with less risk of coding conflicts and core service outages. An example of this is the independent deployment of Singleton with a string change for a specific language or languages as part of a localization bug fix.

Faster Time to Market

The process of preparing localized resources may take some time, depending on the steps a Language Service Provider (LSP) might take. This means that your core application may be ready before localized resources are available.

Singleton supports the development philosophy of CI/CD/CD (Continuous Integration, Continuous Delivery, Continuous Deployment). As a result, you can quickly deploy the core application (or core microservices of an application) – as a minimum viable product (MVP) – and continuously update localized resources and L10n-specific features in Singleton over time.

Scalability

Given the known risks, redeploying an application in order to support a new language may not be worth the challenges of an additional release.

Using Singleton makes scaling to other languages easy with no business interruption since localized resources are in a separate service.

What’s next?

In the past 6 months, we at VMware have been surveying our product teams to gather ideas on future enhancements and improvements. Based on the feedback from the VMware teams, the resounding theme was “offline mode” support in our Singleton client libraries. Watch out for upcoming blogs to learn more about this feature.

Contributions are Welcome! 

Singleton’s source code is accessible on GitHub. A new user can refer to the README portion to build from the source code and start using Singleton. We welcome discussions about, and contributions to, the project.

Stay tuned to the Open Source Blog and follow us on Twitter (@vmwopensource) for all the latest content around software globalization and open source projects from VMware.