How the cloud provider manages the connection between mobile applications and the cloud

Source: Internet
Author: User
Keywords Cloud computing mobile apps

Traditional client and server-side software technologies use a software solution called sockets to establish a connection. The use of sockets has not changed as the industry has grown from a static, fat client to a mobile thin client. But over the years, sockets have changed their shape and become more complex. As a result, this technology becomes difficult to understand, not to mention a comprehensive understanding of how sockets are used in the enterprise, or how they are used in conjunction with mobile and cloud technologies.

This article will help you understand the concept of sockets, the types of sockets you can use for your applications, the pros and cons of using sockets in mobile and cloud solutions, and how cloud service providers can support sockets.

Getting Started with sockets

A socket combination uses an Internet protocol (IP) address or a domain Name System (DNS) address and port number to connect the client software to the server-side software. A common example of this combination is WEB mail, such as, where a colon (:) is the separator between the DNS address and the port number. Sockets allow you to establish a session-level connection to hold data transfer or perform transactions.

Type of socket

Sockets are used to establish a session between the client and the server to perform transactions or transmit data. When the enterprise deploys or uses sockets, they can use different types of sockets and different protocols depending on the type of application, security requirements, and skill sets of the development team. Socket types include the Internet, streaming, raw, and domain sockets. The Internet and streaming sockets are most popular, thanks to their ease of use, their architecture, and the popularity of Web and application servers in contemporary data centers.

For Internet sockets, HTTP based sockets are the primary choice for thin clients or web-based systems, especially for applications that do not require encryption to enforce security. Also note that HTML V5 (HTML5) introduces WebSockets, which is extremely similar to Internet sockets. (See Resources For more information about the links.) When additional security is required, the enterprise should select a stream socket. Although Internet sockets are currently popular because of the proliferation of thin client applications, streaming sockets are also popular.

The most popular streaming based sockets are based on the Transmission Control Protocol (TCP) stack and are often used for fat client applications. (Note that TCP is occasionally used for thin client connections.) When additional security is required for socket connections, a solution based on Secure Sockets Layer (SSL)/Transport Layer Security (TLS) is also available. TLS protects data in motion by combining the use of a public key infrastructure (PKI) with SSL based HTTP (i.e., HTTPS). Note that when dealing with sensitive data, it is often necessary to use TLS, which includes personally identifiable information, protected health information, cardholder data, or payment, bank, or mortgage data. Organizations that need more flexibility to establish client-server connections should consider raw sockets.

The original socket does not depend on a specific transport mechanism, so the package sent on the connection using the original socket contains a header and the "original" package itself. These sockets are often used by network devices, such as firewalls and routers, that use both the Internet Control Message protocol and the Internet Group Management Protocol. Because of the generality of the original sockets, internal systems are sometimes used to encode them, so these sockets can be used in the context of a private cloud, an internal cloud. Enterprises using the UNIX® system have another socket to choose from: Domain sockets.

A domain socket contains an interprocess communication (IPC) protocol. IPC is a socket that is often used for legacy platforms, such as UNIX, although some people may think that the need to connect mainframe systems to mobile or cloud environments is trivial, but this requirement is likely to arise and needs to be mentioned. Regardless of which socket is used, all sockets have a basic development and usage structure, which is described in the next section.

Structure of sockets

The system architecture or platform, security requirements, and the programming language you use for the platform help determine which type of socket you should use. Also, choosing whether to use an application programming interface (API) or an internally developed socket can affect the structure of sockets. For example, if a business intends to use a cloud-based linux®, Apache, MySQL, and PHP (LAMP) stack to perform server-side processing on the Amazon elastic Compute Cloud (Amazon EC2) platform, it is likely to take a A socket on the Internet. Conversely, if a developer wants to find a socket based API for a mobile client session from an Apple IPad running Apple IOS 5, the logical choice would be the Twisted framework, which uses streaming sockets.

The socket structure used by Twisted reflects its streaming and event-based architecture, so it is very similar to a tcp/stream based socket (that is, WinSock) in Windows®, whose chart reflects its dependency on callbacks from the client (see Figure 1).

Figure 1. WinSock Client-Server interaction

The figure shows the WinSock client-server interaction

From a code perspective, you can better understand the structure of sockets by examining the domain sockets that are created for the UNIX mainframe platform using the C programming language. Listing 1 visually explains how to create a domain-based socket on UNIX using C.

Listing 1. domain-based sockets created in UNIX using C
struct Sockaddr_out
short int sout_family;
unsigned short int sout_port; /*remember Firewall rules*/
struct OUT_ADDR sout_addr; /*router too*/
unsigned char sout_zero [8];

Advantages and disadvantages of using sockets

The type of socket you choose may have a positive or negative impact on quality of service (QoS) because the socket maintains state from the client and server side. As a result, many sockets help maintain the transactional integrity of the application. However, when used in conjunction with KPI encryption, sockets also maintain the confidentiality and integrity of the transaction.

Encryption helps organizations protect data, but it also increases overhead and can negatively impact the user experience through QoS. Sockets can also be difficult to develop or configure, so the organization's developers must have an enhanced set of skills. Finally, different technologies specify which sockets you can use, so the need to use sockets on a particular platform may limit your choice.

Using sockets has both advantages and disadvantages, and each type of socket has specific advantages and disadvantages. The internet-based socket APIs are bundled in most popular application server stacks (such as the Microsoft®.net Framework, Apache Tomcat, and Ibm®websphere®application server). These types of sockets, however, bring limited security and transactional integrity. The session-based socket API provides security and enhanced transactional integrity, and can be included in most application servers. However, they need to consume a large amount of resources and may affect QoS. The original socket is generic, but the cost of using it is higher complexity and lower security. Finally, domain-based socket APIs introduce scalability for UNIX environments, but they only apply to certain platforms, so service providers and API developers can provide the least support.

How the cloud provider supports sockets

Cloud computing is redefining the old application Service provider (ASP) model. However, real cloud products also have more features from ASPs, such as resource pooling, on-demand, multi-tenant, and rapid recovery. Cloud service providers provide services based on different cloud services and deployment models.

The cloud service model is a method by which organizations can use the cloud based on business requirements, such as the infrastructure that is the service (IaaS), the platform as a service (PaaS), or the Software as a service (SaaS). IaaS gives cloud consumers the highest level of flexibility, and SaaS offers the least flexibility. However, in addition to the highest flexibility, IaaS gives cloud consumers the need to manage and monitor the environment. So IaaS consumers need to start building (virtual) servers from the operating system layer. For PaaS, consumers need to build databases, applications, and business rules, and then load data. For SaaS, consumers simply load data into a pre-built application.

Cloud deployment models include public cloud, private cloud, mixed cloud, and community cloud. An example of a common cloud model is Google app Engine, where applications and data are stored in a Google Datacenter. In this model, consumers actually occupy a niche in Google's "Top" architecture. Most large organizations use the cloud internally as a private cloud. An example of a private cloud is an organization that uses cloud features (such as resource pools, on-demand, multi-tenant, or quick recovery) to process information within its own data center. Organizations can also provide a private cloud at the provider's site. Examples include Terremark customers and organizations using Amazon Virtual Private Cloud (Amazon VPC). Examples of mixed consumers include pharmaceutical companies such as Pfizer, which use private clouds to store their research and development data, (through TLS) securely send data to public clouds for user computing and then send data back to the private cloud. In fact, the hybrid model leverages the advantages of public and private domain. One example of a community cloud that leverages resource pools to a large extent is that many schools in a school district share server resources to process information.

Based on the selected cloud service and deployment model, cloud consumers can use different socket types. Generally speaking, internet-based and streaming sockets are supported by all reputable providers (Amazon Web Services, Rackspace, Windows azure™ and Google App Engine), and PaaS and IaaS products. Consumers of SaaS solutions do not have to worry about using sockets directly, but they may need to have third parties interact with SaaS providers through sockets. However, the provider does not provide organized support for the original socket, but theoretically, the organization can accept and process the original socket by using and configuring the IaaS environment. Finally, some businesses have found a business case for moving mainframe environments to virtualization or private cloud platforms; Therefore, virtualization and private cloud technology providers (such as OpenStack, Xen, Microsoft, and VMware) do not explicitly mention their support for domain-based sockets. However, this situation can change as private cloud technology is used more widely.



Socket has existed for a long time and is still alive. The introduction of mobile and cloud technologies means that sockets have changed shape and have been expanded to deal with these emerging markets. As more enterprises and technologies begin to focus on mobile and cloud solutions, socket developers are also concerned about them. However, not all sockets are the same, and enterprises should carefully consider the advantages and disadvantages of these sockets before deciding which sockets should be used by an application and which provider should be selected to handle the transaction.

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: 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.