A study of JVM virtualization characteristics in cloud computing environment

Source: Internet
Author: User
Keywords nbsp. multi-tenant

At present, what is cloud computing, what kind of platform belongs to the cloud computing platform, and so on cloud computing related issues, different hardware and software manufacturers have their own different understanding, have their own different definitions. The cloud computing platform they offer is also vastly different. When it comes to cloud computing, people always think of these things: high scalability (scalability), cost savings (saving), on-demand (use on Demand), and so on. Regardless of the myriad concepts brought about by cloud computing, cloud computing itself is not a novelty in terms of technology, it can be understood as a new type of IT service delivery, with traditional technologies such as virtualization, clustering, Grids and so on can be used as a support technology for cloud computing platforms. For a more detailed introduction to the concept of cloud computing, please refer to the Wikipedia description.

Cloud Computing Platform Architecture

Generally speaking, the cloud computing platform is interpreted as the following architecture, as shown in Figure 1.

Figure 1. Cloud Computing Platform Architecture

The bottom layer is IaaS, a cloud service that provides basic hardware such as CPU, network, storage, and so on. On the IaaS level, the famous cloud computing product has Amazon's S3 (simple Storage Service), which provides users with cloud storage services.

The next level is PAAs, providing services and management similar to the operating system level, such as Google Gae, where you can leave your Java application (or Python) running in Google's Gae, which is like a "cloud" operating system, Don't worry about your program running on that machine.

The last layer is SaaS, the familiar software that serves. In fact, the concept of SaaS comes before cloud computing, but the advent of cloud computing has made it easier for the original SaaS to find its place. In essence, the idea of SaaS is that there are different traditional licensing methods (such as buying Windows Office), and SaaS emphasizes paying on demand. SaaS well-known products are many, such as IBM's LotusLive, Salesforce.com and so on.

Multi-Tenant (multi-tenant)

The concept of multi-tenant is accompanied by cloud computing, and it is necessary to introduce a lot of this concept in the discussion that follows.

Multi-Tenant is a software architecture concept that refers to a software instance (creator Instance) that can be used by multiple organizations (from or tenant). This can be understood as the virtualization of the application, which means that multiple tenants share the same software instance, but each tenant has its own virtual partition in terms of dataset, configuration, and so on. In fact, to some extent, applications based on B/s architecture, such as the Java EE application itself, are multi-tenant because everyone uses a browser to access the same software instance deployed on the creator server. This is said to be "a certain degree" because we are talking about the dataset by tenant Virtual Division, the reality of the Java application is not supported. This article will be discussed in detail later.

The next chapters will take S3 and Gae as examples, focusing on the topics discussed in this article: Multi-Tenant and Resource management, a brief introduction to how multi-tenant is deployed on these typical cloud computing platforms, and how resources are managed on these platforms.

Multi-tenant and resource management support in S3

Amazon S3 provides users with online (internet-based) cloud storage services. Users can store any data on the S3, either privately or publicly accessible. Amazon S3 supports Web browsers or BitTorrent to access this data. Generally speaking, users use S3:

As Backup server: Store your private data to S3, so you don't have to buy your own backup disk, you just pay to rent disk space from Amazon. As data host: Stores the S3, and others have access to the data. Here, the object you pay is not the traditional ISP, but Amazon. S3 storage involves two core concepts: S3 bucket and S3 object. S3 object is an abstraction of the content that exists on the Amazon S3, which includes two things: data and metadata, and data refers to the real content you store, such as a PDF document, an HTML file, and so on. The metadata is a description of the data, such as the content-type that can be used to specify what is currently stored HTML. Each S3 object has a unique key to flag. S3 Bucket is a container that holds S3 object. If you use an analogy, S3 bucket is equivalent to a file system on disk, and S3 Object is a file in this filesystem.

Let's use a simple example to see how many tenants are doing it on S3.

If you want to use S3 storage example.com Web site, you first need to create a bucket named "example.com", and then create things like: "" (empty string), "bucket", "catalog" in this catalog/929339. objects, the corresponding URLs for these objects are: "http://example.com/", "http://example.com/catalog/", "http://example.com/catalog/ 929339 "While the value of object is the corresponding HTML page, the metadata content-type is set to HTML (corresponding to the standard HTTP definition).

If a multi-tenant perspective, we can think of S3 as an online storage server, each tenant can store their own information on the S3, such as: a tenant can put the http://tenantA.com site on the S3, b tenants can be stored http://tenantB.com site, each tenant share S3 use.

In addition to multi-tenant support, S3 also has the use of resources management, billing and other functions, as shown in Figure 2:

Figure 2. S3 Storage Price List

Multi-tenant and resource management support on Gae

Compared to IaaS, Google APP engine provides more system abstraction capabilities. If you make a metaphor, IaaS is equivalent to having a computer with storage, network, CPU, and other computing resources, and the PAAs Google APP engine is the operating system installed on this computer. Imagine, if you develop a traditional Java EE application, what you are concerned about, in addition to the application itself, but also: what kind of application server to deploy on, what kind of database to use, the scalability (scalability) to apply, and so on. And with Gae, you don't need to care about these things, you just need to develop the Java app based on the GAE specification and then deploy it in the Gae cloud, and Gae will help you manage everything except your application itself.

Gae itself is a multi-tenant architecture, that is, any one of the Gae-compliant Java EE specifications from different tenants can be deployed on Gae.

Also, an application instance deployed on Gae, if you want to use it as a SaaS application, can also implement multiple tenants, which means that when one of your Java apps deployed on Gae needs to be used by different tenants, you can use the Google-provided namespace API to virtualize it into multiple application instances. For example, different tenants of the SaaS application use different subdomains (subdomain), Tenanta The sub domain name is TENANTA.EXAMPLE.COM,TENANTB is tenantB.example.com and so on, you can use the following code to put different tenants in different namespaces, they can share the same datastore instance on the basis of different tenants to achieve mutual isolation.

Listing 1. GAE App multitenancy

The following is a reference fragment:

//Filter to set the namespace by different subdomain.

public class Namespacefilter implements Javax.servlet.Filter {


public void Dofilter (ServletRequest req, servletresponse Res, filterchain chain)

throws IOException, servletexception {

//make throaty set () is only called if the current namespace isn't already set.

if (namespacemanager.get () = null) {

Namespacemanager.set (Req.getservername ());


Chain into the next request.

Chain.dofilter (req, res);


//... remaining Filter methods Init () and Destroy ()


It is noteworthy that GAE namespace used thread-local storage technology. That is, the namespace Manager that you set up in the filter, whose lifetime (or a valid range) exists within a single HTTP request lifecycle (that is, during the current thread service for that request), rather than the entire session period after the tenant has logged in.

Amazon S3,gae also provides a resource management billing function, as shown in Figure 3.

Figure 3. Gae Resource Management

Here, to sum up: we see that both S3 and Gae support multiple tenants and resource management. In fact, not just S3 and Gae, multi-tenant and resource management are a core feature that any cloud computing platform must have.

How we simply think of S3 and Gae as applications running on the Java platform (the JRE is running on the bottom!). , then we can say that both S3 and Gae have made their own implementations of both requirements at the Java creator level. Further, if we ask the underlying JRE itself to support multi-tenant and resource management, there is reason to believe that these Java applications deployed on the JRE, leveraging these support from the underlying JRE, should be more efficient, concise, and easy to do this work. This is also the reason for the two important jsr:jsr284 and JSR121 of the Java platform to be discussed next. One is the resource management support of the Java platform, and the other is the Java platform's multi-tenant support.

Long before the rise of cloud computing, Sun Lab began to focus on the sharing and management of resources in the Java platform. For example, without the local support of the operating system, we cannot make a normal Java application limited to CPU usage, limited to disk IO or network bandwidth usage, and so on. When we run multiple JVM instances on the same machine, they are separate user processes, and each JVM's startup needs to instantiate itself as a separate JDK class library, with the result: JVM startup time (startup), content (Memory footprint) are consumed on repeated JVM initialization. The question we ask is: can multiple JVMs maximize the sharing of JDK runtimes? Can they be shared without interfering with each other? This is the main reason why Sun initiated Barcelona research project, multi-tasking Virtual Machine (i.e. MVM).

In the cloud computing big way today, we look back again to examine the Barcelona project, MVM all solves two goal: the resource sharing and the management, in the cloud computing environment becomes more important. As we said earlier, as a cloud computing environment two essential two features, multi-tenant and resource management, the former requires the maximization of sharing software instances, the latter requires us on the basis of sharing the use of resources to isolate and control. This coincides with MVM's goal. The following two jsr:121 and 284 are produced by the MVM source, which should also be the steps necessary for the Java platform to move towards virtualization.

(Responsible editor: Lu Guang)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.