Saturday 25 October 2014

Redis

Redis Tutorial

Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. Redis is written in c.
This tutorial will give you great understanding on Redis concepts needed to create and deploy a highly scalable and performance oriented system.

Redis - Overview

Redis is an open source, advanced key-value store and a serious solution for building high-performance, scalable web applications.
Redis has three main peculiarities that set it apart from much of its competition:
  • Redis holds its database entirely in memory, using the disk only for persistence.
  • Redis has a relatively rich set of data types when compared to many key-value data stores.
  • Redis can replicate data to any number of slaves.

Redis Advantages

  • Exceptionally Fast : Redis is very fast and can perform about 110000 SETs per second, about 81000 GETs per second.
  • Supports Rich data types : Redis natively supports most of the datatypes that most developers already know like list, set, sorted set, hashes. This makes it very easy to solve a variety of problems because we know which problem can be handled better by which data type.
  • Operations are atomic : All the Redis operations are atomic, which ensures that if two clients concurrently access Redis server will get the updated value.
  • MultiUtility Tool : Redis is a multi utility tool and can be used in a number of usecases like caching, messaging-queues (Redis natively supports Publish/ Subscribe ), any short lived data in your application like web application sessions, web page hit counts, etc.

Why Redis is different compared to other key-value stores?

  • Redis is a different evolution path in the key-value DBs where values can contain more complex data types, with atomic operations defined on those data types.
  • Redis is an in-memory but persistent on disk database, so it represents a different trade off where very high write and read speed is achieved with the limitation of data sets that can't be larger than memory. Another advantage of in memory databases is that the memory representation of complex data structures is much simpler to manipulate compared to the same data structure on disk, so Redis can do a lot, with little internal complexity.

 Redis - Environment

Install Redis on Ubuntu

To install the Redis on Ubuntu, go to terminal and type the following commands:
$sudo apt-get update
$sudo apt-get install redis-server
This will install redis on your machine.
Start Redis
$redis-server
Check if redis is working?
$redis-cli
This will open a redis prompt, as shown below:
redis 127.0.0.1:6379>
In the above prompt 127.0.0.1 is your machine's IP address and 6379 is port on which redis server is running. Now type the PING command as shown below.
redis 127.0.0.1:6379> ping
PONG
This shows that you have successfully installed redis on your machine.

Install Redis Desktop Manager on Ubuntu

To install redis dessktop manager on ubuntu, just download the package from http://redisdesktop.com/download Open the downloaded package and install it.
Redis desktop manager will give you UI to manage your redis keys and data.

Redis - Configuration

Redis Configuration

In Redis there is configuration file (redis.conf) available at root directory of redis. Although you can get and set all redis configurations by redis CONFIG command.

Syntax

Basic syntax of redis CONFIG command is shown below:
redis 127.0.0.1:6379> CONFIG GET CONFIG_SETTING_NAME

Example

redis 127.0.0.1:6379> CONFIG GET loglevel

1) "loglevel"
2) "notice"

To get all configuration settings just use * in place of CONFIG_SETTING_NAME

Example

redis 127.0.0.1:6379> CONFIG GET *

  1) "dbfilename"
  2) "dump.rdb"
  3) "requirepass"
  4) ""
  5) "masterauth"
  6) ""
  7) "unixsocket"
  8) ""
  9) "logfile"
 10) ""
 11) "pidfile"
 12) "/var/run/redis.pid"
 13) "maxmemory"
 14) "0"
 15) "maxmemory-samples"
 16) "3"
 17) "timeout"
 18) "0"
 19) "tcp-keepalive"
 20) "0"
 21) "auto-aof-rewrite-percentage"
 22) "100"
 23) "auto-aof-rewrite-min-size"
 24) "67108864"
 25) "hash-max-ziplist-entries"
 26) "512"
 27) "hash-max-ziplist-value"
 28) "64"
 29) "list-max-ziplist-entries"
 30) "512"
 31) "list-max-ziplist-value"
 32) "64"
 33) "set-max-intset-entries"
 34) "512"
 35) "zset-max-ziplist-entries"
 36) "128"
 37) "zset-max-ziplist-value"
 38) "64"
 39) "hll-sparse-max-bytes"
 40) "3000"
 41) "lua-time-limit"
 42) "5000"
 43) "slowlog-log-slower-than"
 44) "10000"
 45) "latency-monitor-threshold"
 46) "0"
 47) "slowlog-max-len"
 48) "128"
 49) "port"
 50) "6379"
 51) "tcp-backlog"
 52) "511"
 53) "databases"
 54) "16"
 55) "repl-ping-slave-period"
 56) "10"
 57) "repl-timeout"
 58) "60"
 59) "repl-backlog-size"
 60) "1048576"
 61) "repl-backlog-ttl"
 62) "3600"
 63) "maxclients"
 64) "4064"
 65) "watchdog-period"
 66) "0"
 67) "slave-priority"
 68) "100"
 69) "min-slaves-to-write"
 70) "0"
 71) "min-slaves-max-lag"
 72) "10"
 73) "hz"
 74) "10"
 75) "no-appendfsync-on-rewrite"
 76) "no"
 77) "slave-serve-stale-data"
 78) "yes"
 79) "slave-read-only"
 80) "yes"
 81) "stop-writes-on-bgsave-error"
 82) "yes"
 83) "daemonize"
 84) "no"
 85) "rdbcompression"
 86) "yes"
 87) "rdbchecksum"
 88) "yes"
 89) "activerehashing"
 90) "yes"
 91) "repl-disable-tcp-nodelay"
 92) "no"
 93) "aof-rewrite-incremental-fsync"
 94) "yes"
 95) "appendonly"
 96) "no"
 97) "dir"
 98) "/home/deepak/Downloads/redis-2.8.13/src"
 99) "maxmemory-policy"
100) "volatile-lru"
101) "appendfsync"
102) "everysec"
103) "save"
104) "3600 1 300 100 60 10000"
105) "loglevel"
106) "notice"
107) "client-output-buffer-limit"
108) "normal 0 0 0 slave 268435456 67108864 60 pubsub 33554432 8388608 60"
109) "unixsocketperm"
110) "0"
111) "slaveof"
112) ""
113) "notify-keyspace-events"
114) ""
115) "bind"
116) ""

Edit configuration

To update configuration you can edit redis.conf file directly or can update configurations via CONFIG set command

Syntax

Basic syntax of CONFIG SET command is shown below:
redis 127.0.0.1:6379> CONFIG SET CONFIG_SETTING_NAME NEW_CONFIG_VALUE

Example

redis 127.0.0.1:6379> CONFIG SET loglevel "notice"
OK
redis 127.0.0.1:6379> CONFIG GET loglevel

1) "loglevel"
2) "notice"

Redis - Data Types
 Redis supports 5 types of data types, which are described below:

Strings

Redis string is a sequence of bytes. Strings in Redis are binary safe, meaning they have a known length not determined by any special terminating characters, so you can store anything up to 512 megabytes in one string.

Example

redis 127.0.0.1:6379> SET name "tutorialspoint"
OK
redis 127.0.0.1:6379> GET name
"tutorialspoint"
In the above example SET and GET are redis commands, name is the key used in redis and tutorialspoint is the string value that is stored in redis.
NOTE: A String value can be at max 512 Megabytes in length.

Hashes

A Redis hash is a collection of key value pairs. Redis Hashes are maps between string fields and string values, so they are used to represent objects

Example

redis 127.0.0.1:6379> HMSET user:1 username tutorialspoint password tutorialspoint points 200
OK
redis 127.0.0.1:6379> HGETALL user:1

1) "username"
2) "tutorialspoint"
3) "password"
4) "tutorialspoint"
5) "points"
6) "200"

In the above example hash data type is used to store user's object whichh contais basic information of user. Here HMSET, HEGTALL are commands for redis while user:1 is the key.
Every hash can store up to 232 - 1 field-value pairs (more than 4 billion).

Lists

Redis Lists are simply lists of strings, sorted by insertion order. You can add elements to a Redis List on the head or on the tail.

Example

redis 127.0.0.1:6379> lpush tutoriallist redis
(integer) 1
redis 127.0.0.1:6379> lpush tutoriallist mongodb
(integer) 2
redis 127.0.0.1:6379> lpush tutoriallist rabitmq
(integer) 3
redis 127.0.0.1:6379> lrange tutoriallist 0 10

1) "rabitmq"
2) "mongodb"
3) "redis"

The max length of a list is 232 - 1 elements (4294967295, more than 4 billion of elements per list).

Sets

Redis Sets are an unordered collection of Strings. In redis you can add, remove, and test for existence of members in O(1) time complexity.

Example

redis 127.0.0.1:6379> sadd tutoriallist redis
(integer) 1
redis 127.0.0.1:6379> sadd tutoriallist mongodb
(integer) 1
redis 127.0.0.1:6379> sadd tutoriallist rabitmq
(integer) 1
redis 127.0.0.1:6379> sadd tutoriallist rabitmq
(integer) 0
redis 127.0.0.1:6379> smembers tutoriallist

1) "rabitmq"
2) "mongodb"
3) "redis"

NOTE: In the above example rabitmq is added twice but due to unique property of set it is added only once.
The max number of members in a set is 232 - 1 (4294967295, more than 4 billion of members per set).

Sorted Sets

Redis Sorted Sets are, similarly to Redis Sets, non repeating collections of Strings. The difference is that every member of a Sorted Set is associated with score, that is used in order to take the sorted set ordered, from the smallest to the greatest score. While members are unique, scores may be repeated.

Example

redis 127.0.0.1:6379> zadd tutoriallist 0 redis
(integer) 1
redis 127.0.0.1:6379> zadd tutoriallist 0 mongodb
(integer) 1
redis 127.0.0.1:6379> zadd tutoriallist 0 rabitmq
(integer) 1
redis 127.0.0.1:6379> zadd tutoriallist 0 rabitmq
(integer) 0
redis 127.0.0.1:6379> ZRANGEBYSCORE tutoriallist 0 1000

1) "redis"
2) "mongodb"
3) "rabitmq"


Redis - Commands

Redis commands are used to perform some operations on redis server.
To run commands on redis server you need a redis client. Redis client is available in redis package, which we have installed earlier.

Syntax

Basic syntax of redis client is as follows:
$redis-cli

Example

Following example explains how we can start redis client.
To start redis client, open terminal and type the command redis-cli. This will connect to your local server and now you can run any command.
$redis-cli
redis 127.0.0.1:6379>
redis 127.0.0.1:6379> PING

PONG

In the above example we connect to redis server running on local machine and executes a command PING, that checks whether server is running or not.

Run commands on remote server

To run commands on redis remote server you need to connect to server by same client redis-cli

Syntax

$ redis-cli -h host -p port -a password

Example

Following example shows how to connect to redis remote server running on host 127.0.0.1, port 6379 and has password mypass.
$redis-cli -h 127.0.0.1 -p 6379 -a "mypass"
redis 127.0.0.1:6379>
redis 127.0.0.1:6379> PING
PONG


Redis - Keys

Redis keys commands are used for managing keys in redis. Syntax for using redis keys commands is shown below:

Syntax

redis 127.0.0.1:6379> COMMAND KEY_NAME

Example

redis 127.0.0.1:6379> SET tutorialspoint redis
OK
redis 127.0.0.1:6379> DEL tutorialspoint
(integer) 1
In the above example DEL is the command, while tutorialspoint is the key. If the key is deleted, then output of the command will be (integer) 1, otherwise it will be (integer) 0

Redis keys commands

Below given table shows some basic commands related to keys:
S.N.Command & Description
1DEL key
This command deletes the key, if exists
2DUMP key
This command returns a serialized version of the value stored at the specified key.
3EXISTS key
This command checks whether the key exists or not.
4EXPIRE key seconds
Expires the key after the specified time
5EXPIREAT key timestamp
Expires the key after the specified time. Here time is in Unix timestamp format
6PEXPIRE key milliseconds
Set the expiry of key in milliseconds
7PEXPIREAT key milliseconds-timestamp
Set the expiry of key in unix timestamp specified as milliseconds
8KEYS pattern
Find all keys matching the specified pattern
9MOVE key db
Move a key to another database
10PERSIST key
Remove the expiration from the key
11PTTL key
Get the remaining time in keys expiry in milliseconds.
12TTL key
Get the remaining time in keys expiry.
13RANDOMKEY
Return a random key from redis
14RENAME key newkey
Change the key name
15RENAMENX key newkey
Rename key, if new key doesn't exist
16TYPE key
Return the data type of value stored in key.

Redis - Strings

Redis strings commands are used for managing string values in redis. Syntax for using redis string commands is shown below:

Syntax

redis 127.0.0.1:6379> COMMAND KEY_NAME

Example

redis 127.0.0.1:6379> SET tutorialspoint redis
OK
redis 127.0.0.1:6379> GET tutorialspoint
"redis"
In the above example SET and GET are the command, while tutorialspoint is the key.

Redis strings commands

Below given table shows some basic commands to manage strings in redis:
S.N.Command & Description
1SET key value
This command sets the value at the specified key
2GET key
Get the value of a key.
3GETRANGE key start end
Get a substring of the string stored at a key
4GETSET key value
Set the string value of a key and return its old value
5GETBIT key offset
Returns the bit value at offset in the string value stored at key
6MGET key1 [key2..]
Get the values of all the given keys
7SETBIT key offset value
Sets or clears the bit at offset in the string value stored at key
8SETEX key seconds value
Set the value with expiry of a key
9SETNX key value
Set the value of a key, only if the key does not exist
10SETRANGE key offset value
Overwrite part of a string at key starting at the specified offset
11STRLEN key
Get the length of the value stored in a key
12MSET key value [key value ...]
Set multiple keys to multiple values
13MSETNX key value [key value ...]
Set multiple keys to multiple values, only if none of the keys exist
14PSETEX key milliseconds value
Set the value and expiration in milliseconds of a key
15INCR key
Increment the integer value of a key by one
16INCRBY key increment
Increment the integer value of a key by the given amount
17INCRBYFLOAT key increment
Increment the float value of a key by the given amount
18DECR key
Decrement the integer value of a key by one
19DECRBY key decrement
Decrement the integer value of a key by the given number
20APPEND key value
Append a value to a key

Redis - Hashes

Redis Hashes are maps between string fields and string values, so they are the perfect data type to represent objects
In redis every hash can store up to more than 4 billion field-value pairs.

Example

redis 127.0.0.1:6379> HMSET tutorialspoint name "redis tutorial" description "redis basic commands for caching" likes 20 visitors 23000
OK
redis 127.0.0.1:6379> HGETALL tutorialspoint

1) "name"
2) "redis tutorial"
3) "description"
4) "redis basic commands for caching"
5) "likes"
6) "20"
7) "visitors"
8) "23000"

In the above example we have set redis tutorials detail (name, description, likes, visitors) in hash named tutorialspoint

Redis hash commands

Below given table shows some basic commands related to hash:
S.N.Command & Description
1HDEL key field2 [field2]
Delete one or more hash fields
2HEXISTS key field
Determine whether a hash field exists or not
3HGET key field
Get the value of a hash field stored at specified key
4HGETALL key
Get all the fields and values stored in a hash at specified key
5HINCRBY key field increment
Increment the integer value of a hash field by the given number
6HINCRBYFLOAT key field increment
Increment the float value of a hash field by the given amount
7HKEYS key
Get all the fields in a hash
8HLEN key
Get the number of fields in a hash
9HMGET key field1 [field2]
Get the values of all the given hash fields
10HMSET key field1 value1 [field2 value2 ]
Set multiple hash fields to multiple values
11HSET key field value
Set the string value of a hash field
12HSETNX key field value
Set the value of a hash field, only if the field does not exist
13HVALS key
Get all the values in a hash
14HSCAN key cursor [MATCH pattern] [COUNT count]
Incrementally iterate hash fields and associated values



Wednesday 18 June 2014

Articles

802.11n

802.11n is a wireless (Wi-Fi) standard that was introduced in 2007. It supports a longer range and higher wireless transfer rates than the previous standard, 802.11g.

802.11n devices support MIMO (multiple in, multiple out) data transfers, which can transmit multiple streams of data at once. This technology effectively doubles the range of a wireless device. Therefore, a wireless router that uses 802.11n may have twice the radius of coverage as an 802.11g router. This means a single 802.11n router may cover an entire household, whereas an 802.11g router might require additional routers to bridge the signal.

The previous 802.11g standard supported transfer rates of up to 54 Mbps. Devices that use 802.11n can transfer data over 100 Mbps. With an optimized configuration, the 802.11n standard can theoretically support transfer rates of up to 500 Mbps. That is five times faster than a standard 100Base-T wired Ethernet network.

So if your residence is not wired with an Ethernet network, it's not a big deal. Wireless technology can finally keep pace with the wired network. Of course, with the faster speeds and larger range that 802.11n provides, it is more important than ever to password protect your wireless network.
BitTorrent

BitTorrent is a peer-to-peer (P2P) file sharing protocol designed to reduce the bandwidth required to transfer files. It does this by distributing file transfers across multiple systems, thereby lessening the average bandwidth used by each computer. For example, if a user begins downloading a movie file, the BitTorrent system will locate multiple computers with the same file and begin downloading the file from several computers at once. Since most ISPs offer much faster download speeds than upload speeds, downloading from multiple computers can significantly increase the file transfer rate.

In order to use the BitTorrent protocol, you need a BitTorrent client, which is a software program that accesses the BitTorrent network. The client program allows you to search for files and begin downloading torrents, which are in-progress downloads. Most BitTorrent clients allow you to resume torrents that have been paused or stopped. This can be especially helpful when downloading large files.

Captcha

A captcha is program used to verify that a human, rather than a computer, is entering data. Captchas are commonly seen at the end of online forms and ask the user to enter text from a distorted image. The text in the image may be wavy, have lines through it, or may be highly irregular, making it nearly impossible for an automated program to recognize it. (Of course, some captchas are so distorted that they can be difficult for humans to recognize as well.) Fortunately, most captchas allow the user to regenerate the image if the text is too difficult to read. Some even include an auditory pronunciation feature.

By requiring a captcha response, webmasters can prevent automated programs, or "bots," from filling out forms online. This prevents spam from being sent through website forms and ensures that wikis, such as Wikipedia, are only edited by humans. Captchas are also used by websites such as Ticketmaster.com to make sure users don't bog down the server with repeated requests. While captchas may be a minor inconvenience to the user, they can save webmasters a lot of hassle by fending off automated programs.
The name "captcha" comes from the word "capture," since it captures human responses. It may also be written "CAPTCHA," which is an acronym for "Completely Automated Public Turing test to tell Computers and Humans Apart."

BIOS

Stands for "Basic Input/Output System." Most people don't need to ever mess with the BIOS on a computer, but it can be helpful to know what it is. The BIOS is a program pre-installed on Windows-based computers (not on Macs) that the computer uses to start up. The CPU accesses the BIOS even before the operating system is loaded. The BIOS then checks all your hardware connections and locates all your devices. If everything is OK, the BIOS loads the operating system into the computer's memory and finishes the boot-up process.

Since the BIOS manages the hard drives, it can't reside on one, and since it is available before the computer boots up, it can't live in the RAM. So where can this amazing, yet elusive BIOS be found? It is actually located in the ROM (Read-Only Memory) of the computer. More specifically, it resides in an eraseable programmable read-only memory (EPROM) chip. So, as soon as you turn your computer on, the CPU accesses the EPROM and gives control to the BIOS.

The BIOS also is used after the computer has booted up. It acts as an intermediary between the CPU and the I/O (input/output) devices. Because of the BIOS, your programs and your operating system don't have to know exact details (like hardware addresses) about the I/O devices attached to your PC. When device details change, only the BIOS needs to be updated. You can make these changes by entering the BIOS when your system starts up. To access the BIOS, hold down the key as soon as your computer begins to start up.

Cross-Browser

When a software program is developed for multiple computer platforms, it is called a crossplatform program. Similarly, when a website is developed for multiple browsers, it is called a cross-browser website.
The job of a Web developer would be much easier if all browsers were the same.

 While most browsers are similar in both design and function, they often have several small differences in the way they recognize and display websites. For example, Apple's Safari uses a different HTML rendering engines than Internet Explorer. This means the browsers may display the same Web page with slightly different page and text formatting. Since not all browsers support the same HTML tags, some formatting may not be recognized at all in an incompatible Web browser. Furthermore, browsers interpret JavaScript code differently, which means a script may work fine in one browser, but not in another.

Because of the differences in the way Web browsers interpret HTML and JavaScript, Web developers must test and adapt their sites to work with multiple browsers. For example, if a certain page looks fine in Firefox, but does not show up correctly in Internet Explorer, the developer may change the formatting so that it works with Internet Explorer. Of course, the page may then appear differently in Firefox.

The easiest fix for browser incompatibility problems is to use a more basic coding technique that works in both browsers. However, if this solution is not possible, the developer may need to add code that detects the type of browser, then outputs custom HTML or JavaScript for that browser.

Making a cross-browser site is usually pretty simple for basic websites. However, complex sites with a lot of HTML formatting and JavaScript may require significant extra coding in order to be compatible with multiple browsers. Some developers may even generate completely different pages for each browser. While CSS formatting has helped standardize the appearance of Web pages across multiple browsers, there are still several inconsistencies between Web browsers. Therefore, cross-browser design continues to be a necessary aspect of Web development.

DNS

Stands for "Domain Name System." The primary purpose of DNS is to keep Web surfers sane. Without DNS, we would have to remember the IP address of every site we wanted to visit, instead of just the domain name. Can you imagine having to remember "17.254.3.183" instead of just "apple.com"? While I have some Computer Science friends who might prefer this, most people have an easier time remembering simple names.

The reason the Domain Name System is used is because Web sites are acutally located by their IP addresses. For example, when you type in "http://www.adobe.com," the computer doesn't immediately know that it should look for Adobe's Web site. Instead, it sends a request to the nearest DNS server, which finds the correct IP address for "adobe.com." Your computer then attempts to connect to the server with that IP number. DNS is just another one of the many features of the Internet that we take for granted.

Firmware

Firmware is a software program or set of instructions programmed on a hardware device. It provides the necessary instructions for how the device communicates with the other computer hardware. But how can software be programmed onto hardware? Good question. Firmware is typically stored in the flash ROM of a hardware device. While ROM is "read-only memory," flash ROM can be erased and rewritten because it is actually a type of flash memory.

Firmware can be thought of as "semi-permanent" since it remains the same unless it is updated by a firmware updater. You may need to update the firmware of certain devices, such as hard drives and video cards in order for them to work with a new operating system. CD and DVD drive manufacturers often make firmware updates available that allow the drives to read faster media. Sometimes manufacturers release firmware updates that simply make their devices work more efficiently.

You can usually find firmware updates by going to the "Support" or "Downloads" area of a manufacturer's website. Keeping your firmware up-to-date is often not necessary, but it is still a good idea. Just make sure that once you start a firmware updater, you let the update finish, because most devices will not function if their firmware is not recognized.

IMAP

Stands for "Internet Message Access Protocol" and is pronounced "eye-map." It is a method of accessing e-mail messages on a server without having to download them to your local hard drive. This is the main difference between IMAP and another popular e-mail protocol called "POP3." POP3 requires users to download messages to their hard drive before reading them.

 The advantage of using an IMAP mail server is that users can check their mail from multiple computers and always see the same messages. This is because the messages stay on the server until the user chooses to download them to his or her local drive.

 Most webmail systems are IMAP based, which allows people to access to both their sent and received messages no matter what computer they use to check their mail.

Most e-mail client programs such as Microsoft Outlook and Mac OS X Mail allow you to specify what kind of protocol your mail server uses. If you use your ISP's mail service, you should check with them to find out if their mail server uses IMAP or POP3 mail. If you enter the wrong protocol setting, your e-mail program will not be able to send or receive mail.

Permalink

Short for "permanent link." A permalink is a URL that links to a specific news story or Web posting. Permalinks are most commonly used for blogs, which are frequently changed and updated. They give a specific Web address to each posting, allowing blog entries to be bookmarked by visitors or linked to from other websites.

Because most blogs are published using dynamic, database-driven Web sites, they do not automatically have Web addresses associated with them. For example, a blog entry may exist on a user's home page, but the entry may not have its own Web page, ending in ".html," ".asp," ".php," etc. Therefore, once the posting is outdated and no longer present on the home page, there may be no way to access it. Using a permalink to define the location of each posting prevents blog entries from fading off into oblivion.

Session



In the computing world, a session refers to a limited time of communication between two systems. Some sessions involve a client and a server, while other sessions involve two personal computers.
A common type of client/server session is a Web or HTTP session.

An HTTP session is initiated by a Web browser each time you visit a website. While each page visit constitutes an individual session, the term is often used to describe the entire time you spend on the website. For example, when you purchase an item on an ecommerce site, the entire process may be described as a session, even though you navigated through several different pages.

Another example of a client/server session is an email or SMTP session. Whenever you check your email with an email client, such as Microsoft Outlook or Apple Mail, you initiate an SMTP session. This involves sending your account information to the mail server, checking for new messages, and downloading the messages from the server. Once the messages have been downloaded, the session is complete.

An example of a session between two personal computers is an online chat, or instant messaging session. This type of session involves two computers, but neither system is considered a server or client. Instead, this type of communication is called a peer-to-peer or P2P. Another example of P2P communication is BitTorrent file sharing, where file downloads are comprised of one or more sessions with other computers on the BitTorrent network. A P2P session ends when the connection between two systems is terminated.

SMTP

Stands for "Simple Mail Transfer Protocol." This is the protocol used for sending e-mail over the Internet. Your e-mail client (such as Outlook, Eudora, or Mac OS X Mail) uses SMTP to send a message to the mail server, and the mail server uses SMTP to relay that message to the correct receiving mail server.

 Basically, SMTP is a set of commands that authenticate and direct the transfer of electronic mail. When configuring the settings for your e-mail program, you usually need to set the SMTP server to your local Internet Service Provider's SMTP settings (i.e. "smtp.yourisp.com"). However, the incoming mail server (IMAP or POP3) should be set to your mail account's server (i.e. hotmail.com), which may be different than the SMTP server.








Monday 9 June 2014

Key and Character Codes vs. Event Types




Keyboard Events and Codes





Key and Character Codes vs. Event Types


Enter your keyboard key(individual) and get specific code:


Keyboard Event Properties
Datakeydownkeypresskeyup
keyCode
charCode
Target
Character
Shift
Ctrl
Alt
Meta


Tuesday 13 May 2014

Cloud computing

Cloud Computing Tutorial

Cloud Computing provides us a means by which we can access the applications as utilities, over the internet. It allows us to create, configure, and customize the business applications online.
This tutorial will take you through a step-by-step approach while learning Cloud Computing concepts.

Cloud Computing Overview

Cloud Computing provides us a means by which we can access the applications as utilities, over the Internet. It allows us to create, configure, and customize applications online.

What is Cloud?

The term Cloud refers to a Network or Internet. In other words, we can say that Cloud is something, which is present at remote location. Cloud can provide services over network, i.e., on public networks or on private networks, i.e., WAN, LAN or VPN.
Applications such as e-mail, web conferencing, customer relationship management (CRM),all run in cloud.

What is Cloud Computing?

Cloud Computing refers to manipulating, configuring, and accessing the applications online. It offers online data storage, infrastructure and application.
cloud_computing Tutorial
We need not to install a piece of software on our local PC and this is how the cloud computing overcomes platform dependency issues. Hence, the Cloud Computing is making our business application mobile and collaborative.

Basic Concepts

There are certain services and models working behind the scene making the cloud computing feasible and accessible to end users. Following are the working models for cloud computing:
  • Deployment Models
  • Service Models

DEPLOYMENT MODELS

Deployment models define the type of access to the cloud, i.e., how the cloud is located? Cloud can have any of the four types of access: Public, Private, Hybrid and Community.
cloud_computing Tutorial

Public Cloud

The Public Cloud allows systems and services to be easily accessible to the general public. Public cloud may be less secure because of its openness, e.g., e-mail.

Private Cloud

The Private Cloud allows systems and services to be accessible within an organization. It offers increased security because of its private nature.

Community Cloud

The Community Cloud allows systems and services to be accessible by group of organizations.

Hybrid Cloud

The Hybrid Cloud is mixture of public and private cloud. However, the critical activities are performed using private cloud while the non-critical activities are performed using public cloud.

SERVICE MODELS

Service Models are the reference models on which the Cloud Computing is based. These can be categorized into three basic service models as listed below:
  1. Infrastructure as a Service (IaaS)
  2. Platform as a Service (PaaS)
  3. Software as a Service (SaaS)
There are many other service models all of which can take the form like XaaS, i.e., Anything as a Service. This can be Network as a Service, Business as a Service, Identity as a Service, Database as a Service or Strategy as a Service.
The Infrastructure as a Service (IaaS) is the most basic level of service. Each of the service models make use of the underlying service model, i.e., each inherits the security and management mechanism from the underlying model, as shown in the following diagram:
cloud_computing Tutorial

INFRASTRUCTURE AS A SERVICE (IAAS)

IaaS provides access to fundamental resources such as physical machines, virtual machines, virtual storage, etc.

PLATFORM AS A SERVICE (PAAS)

PaaS provides the runtime environment for applications, development & deployment tools, etc.

SOFTWARE AS A SERVICE (SAAS)

SaaS model allows to use software applications as a service to end users.

History

The concept of Cloud Computing came into existence in 1950 with implementation of mainframe computers, accessible via thin/static clients. Since then, cloud computing has been evolved from static clients to dynamic ones from software to services. The following diagram explains the evolution of cloud computing:
cloud_computing Tutorial

Benefits

Cloud Computing has numerous advantages. Some of them are listed below:
  • One can access applications as utilities, over the Internet.
  • Manipulate and configure the application online at any time.
  • It does not require to install a specific piece of software to access or manipulate cloud application.
  • Cloud Computing offers online development and deployment tools, programming runtime environment through Platform as a Service model.
  • Cloud resources are available over the network in a manner that provides platform independent access to any type of clients.
  • Cloud Computing offers on-demand self-service. The resources can be used without interaction with cloud service provider.
  • Cloud Computing is highly cost effective because it operates at higher efficiencies with greater utilization. It just requires an Internet connection.
  • Cloud Computing offers load balancing that makes it more reliable.
cloud_computing Tutorial

Risks

Although Cloud Computing is a great innovation in the world of computing, there also exist downsides of cloud computing. Some of them are discussed below:

SECURITY & PRIVACY

It is the biggest concern about cloud computing. Since data management and infrastructure management in cloud is provided by third-party, it is always a risk to handover the sensitive information to such providers.
Although the cloud computing vendors ensure more secure password protected accounts, any sign of security breach would result in loss of clients and businesses.

LOCK-IN

It is very difficult for the customers to switch from one Cloud Service Provider (CSP) to another. It results in dependency on a particular CSP for service.

ISOLATION FAILURE

This risk involves the failure of isolation mechanism that separates storage, memory, routing between the different tenants.

MANAGEMENT INTERFACE COMPROMISE

In case of public cloud provider, the customer management interfaces are accessible through the Internet.

INSECURE OR INCOMPLETE DATA DELETION

It is possible that the data requested for deletion may not get deleted. It happens either because extra copies of data are stored but are not available or disk destroyed also stores data from other tenants.

Characteristics

There are four key characteristics of cloud computing. They are shown in the following diagram:
cloud_computing Tutorial

ON DEMAND SELF-SERVICE

Cloud Computing allows the users to use web services and resources on demand. One can logon to a website at any time and use them.

BROAD NETWORK ACCESS

Since Cloud Computing is completely web based, it can be accessed from anywhere and at any time.

RESOURCE POOLING

Cloud Computing allows multiple tenants to share a pool of resources. One can share single physical instance of hardware, database and basic infrastructure.

RAPID ELASTICITY

It is very easy to scale up or down the resources at any time.
Resources used by the customers or currently assigned to customers are automatically monitored and resources. It make it possible

MEASURED SERVICE

Service Models & Deployment Models are described in above section.

Cloud Computing Planning

Before deploying applications to cloud, it is necessary to consider your business requirements. Following are the issues one must have to think about:
  • Data Security and Privacy Requirement
  • Budget Requirements
  • Type of cloud - public, private or hybrid
  • Data backup requirements
  • Training requirements
  • Dashboard and reporting requirements
  • Client access requirements
  • Data export requirements
To meet all of these requirements, it is necessary to have well-compiled planning. Here in this tutorial, we will discuss the various planning phases that must be practised by an enterprise before migrating the entire business to cloud. Each of these planning phases are described in the following diagram:
cloud_computing Tutorial

Strategy Planning Phase

In this, we analyze the strategy problems that customer might face. There are two steps to perform this analysis:
  • Cloud Computing Value Proposition
  • Cloud Computing Strategy Planning

CLOUD COMPUTING VALUE PROPOSITION

In this, we analyze the factors influencing the customers when applying cloud computing mode and target the key problems they wish to solve. These key factors are:
  • IT management simplification
  • operation and maintenance cost reduction
  • business mode innovation
  • low cost outsourcing hosting
  • high service quality outsourcing hosting.
All of the above analysis helps in decision making for future development.

CLOUD COMPUTING STRATEGY PLANNING

The strategy establishment is based on the analysis result of the above step. In this step, a strategy document is prepared according to the conditions a customer might face when applying cloud computing mode.

Cloud Computing Tactics Planning Phase

This step performs analysis of problems and risks in the cloud application to ensure the customers that the cloud computing successfully meet their business goals. This phase involves the following planning steps:
  • Business Architecture Development
  • IT Architecture development
  • Requirements on Quality of Service Development
  • Transformation Plan development

BUSINESS ARCHITECTURE DEVELOPMENT

In this step, we recognize the risks that might be caused by cloud computing application from a business perspective.

IT ARCHITECTURE DEVELOPMENT

In this step, we identify the applications that support the business processes and the technologies required to support enterprise applications and data systems.

REQUIREMENTS ON QUALITY OF SERVICE DEVELOPMENT

Quality of Service refers to the non-functional requirements such as reliability, security, disaster recovery, etc. The success of applying cloud computing mode depends on these non-functional factors.

TRANSFORMATION PLAN DEVELOPMENT

In this step, we formulate all kinds of plans that are required to transform current business to cloud computing modes.

Cloud Computing Deployment Phase

This phase focuses on both of the above two phases. It involves the following two steps:
  • Cloud Computing Provider
  • Maintenance and Technical Service

CLOUD COMPUTING PROVIDER

This step includes selecting a cloud provider on basis of Service Level Agreement (SLA), which defines the level of service the provider will meet.

MAINTENANCE AND TECHNICAL SERVICE

Maintenance and Technical services are provided by the cloud provider. They must have to ensure the quality of services.

Cloud Computing Technologies

There are certain technologies that are working behind the cloud computing platforms making cloud computing flexible, reliable, usable. These technologies are listed below:
  • Virtualization
  • Service-Oriented Architecture (SOA)
  • Grid Computing
  • Utility Computing

Virtualization

Virtualization is a technique, which allows to share single physical instance of an application or resource among multiple organizations or tenants (customers). It does so by assigning a logical name to a physical resource and providing a pointer to that physical resource when demanded.
cloud_computing Tutorial
The Multitenant architecture offers virtual isolation among the multiple tenants and therefore the organizations can use and customize the application as though they each have its own instance running.

Service-Oriented Architecture(SOA)

Service-Oriented Architecture helps to use applications as a service for other applications regardless the type of vendor, product or technology. Therefore, it is possible to exchange of data between applications of different vendors without additional programming or making changes to services.
cloud_computing-service_oriented_architecturecloud_computing Tutorial

Grid Computing

Grid Computing refers to distributed computing in which a group of computers from multiple locations are connected with each other to achieve common objective. These computer resources are heterogeneous and geographically dispersed.
Grid Computing breaks complex task into smaller pieces. These smaller pieces are distributed to CPUs that reside within the grid.
cloud_computing Tutorial

Utility Computing

Utility computing is based on Pay per Use model. It offers computational resources on demand as a metered service. Cloud computing, grid computing, and managed IT services are based on the concept of Utility computing.

Cloud Computing Architecture

The Cloud Computing architecture comprises of many cloud components, each of them are loosely coupled. We can broadly divide the cloud architecture into two parts:
  • Front End
  • Back End
Each of the ends are connected through a network, usually via Internet. The following diagram shows the graphical view of cloud computing architecture:
cloud_computing Tutorial

FRONT END

Front End refers to the client part of cloud computing system. It consists of interfaces and applications that are required to access the cloud computing platforms, e.g., Web Browser.

BACK END

Back End refers to the cloud itself. It consists of all the resources required to provide cloud computing services. It comprises of huge data storage, virtual machines, security mechanism, services, deployment models, servers, etc.
Important Points
  • It is the responsibility of the back end to provide built-in security mechanism, traffic control and protocols.
  • The server employs certain protocols, known as middleware, helps the connected devices to communicate with each other.

Cloud Computing Infrastructure

Cloud Infrastructure Components

Cloud infrastructure consists of servers, storage, network, management software, and deployment software and platform virtualization.
cloud_computing Tutorial

HYPERVISOR

Hypervisor is a firmware or low-level program that acts as a Virtual Machine Manager. It allows to share the single physical instance of cloud resources between several tenants.

MANAGEMENT SOFTWARE

Management Software helps to maintain and configure the infrastructure.

DEPLOYMENT SOFTWARE

Deployment software helps to deploy and integrate the application on the cloud.

NETWORK

Network is the key component of cloud infrastructure. It allows to connect cloud services over the Internet. It is also possible to deliver network as a utility over the Internet, i.e., the consumer can customize the network route and protocol.

SERVER

Server helps to compute the resource sharing and offer other services such as resource allocation and deallocation, monitoring resources, security, etc.

STORAGE

Cloud uses distributed file system for storage purpose. If one of the storage resource fails, then it can be extracted from another one which makes cloud computing more reliable.

Infrastructural Constraints

Fundamental constraints that cloud infrastructure should implement are shown in the following diagram:
cloud_computing Tutorial

TRANSPARENCY

Since virtualization is the key to share resources in cloud environment. But it is not possible to satisfy the demand with single resource or server. Therefore, there must be transparency in resources, load balancing and application, so that we can scale them on demand.

SCALABILITY

Scaling up an application delivery solution is not that easy as scaling up an application because it involves configuration overhead or even re-architecting the network. So, application delivery solution is need to be scalable which will require the virtual infrastructure such that resource can be provisioned and de-provisioned easily.

INTELLIGENT MONITORING

To achieve transparency and scalability, application solution delivery will need to be capable of intelligent monitoring.

SECURITY

The mega data center in the cloud should be securely architected. Also the control node, a entry point in mega data center also needs to be secure.

Public Cloud Model

Public Cloud

The Public Cloud allows systems and services to be easily accessible to general public, e.g., Google, Amazon, Microsoft offers cloud services via Internet.
cloud_computing Tutorial

Benefits

There are many benefits of deploying cloud as public cloud model. The following diagram shows some of those benefits:
cloud_computing Tutorial

COST EFFECTIVE

Since public cloud share same resources with large number of consumer, it has low cost.

RELIABILITY

Since public cloud employs large number of resources from different locations, if any of the resource fail, public cloud can employ another one.

FLEXIBILITY

It is also very easy to integrate public cloud with private cloud, hence gives consumers a flexible approach.

LOCATION INDEPENDENCE

Since, public cloud services are delivered through Internet, therefore ensures location independence.

UTILITY STYLE COSTING

Public cloud is also based on pay-per-use model and resources are accessible whenever consumer needs it.

HIGH SCALABILITY

Cloud resources are made available on demand from a pool of resources, i.e., they can be scaled up or down according the requirement.

Disadvantages

Here are the disadvantages of public cloud model:

LOW SECURITY

In public cloud model, data is hosted off-site and resources are shared publicly, therefore does not ensure higher level of security.

LESS CUSTOMIZABLE

It is comparatively less customizable than private cloud.

Private Cloud Model

Private Cloud

The Private Cloud allows systems and services to be accessible with in an organization. The Private Cloud is operated only within a single organization. However, It may be managed internally or by third-party.
cloud_computing Tutorial

Benefits

There are many benefits of deploying cloud as private cloud model. The following diagram shows some of those benefits:
cloud_computing Tutorial

HIGHER SECURITY AND PRIVACY

Private cloud operations are not available to general public and resources are shared from distinct pool of resources, therefore, ensures high security and privacy.

MORE CONTROL

Private clouds have more control on its resources and hardware than public cloud because it is accessed only within an organization.

COST AND ENERGY EFFICIENCY

Private cloud resources are not as cost effective as public clouds but they offer more efficiency than public cloud.

Disadvantages

Here are the disadvantages of using private cloud model:

RESTRICTED AREA

Private cloud is only accessible locally and is very difficult to deploy globally.

INFLEXIBLE PRICING

In order to fulfill demand, purchasing new hardware is very costly.

LIMITED SCALABILITY

Private cloud can be scaled only within capacity of internal hosted resources.

ADDITIONAL SKILLS

In order to maintain cloud deployment, organization requires more skilled and expertise.

Hybrid Cloud Model

Hybrid Cloud

The Hybrid Cloud is a mixture of public and private cloud. Non-critical activities are performed using public cloud while the critical activities are performed using private cloud.
cloud_computing Tutorial

Benefits

There are many benefits of deploying cloud as hybrid cloud model. The following diagram shows some of those benefits:
cloud_computing Tutorial

SCALABILITY

It offers both features of public cloud scalability and private cloud scalability.

FLEXIBILITY

It offers both secure resources and scalable public resources.

COST EFFICIENCIES

Public cloud are more cost effective than private, therefore hybrid cloud can have this saving.

SECURITY

Private cloud in hybrid cloud ensures higher degree of security.

Disadvantages

NETWORKING ISSUES

Networking becomes complex due to presence of private and public cloud.

SECURITY COMPLIANCE

It is necessary to ensure that cloud services are compliant with organization's security policies.

INFRASTRUCTURAL DEPENDENCY

The hybrid cloud model is dependent on internal IT infrastructure, therefore it is necessary to ensure redundancy across data centers.

Community Cloud Model

Community Cloud

The Community Cloud allows system and services to be accessible by group of organizations. It shares the infrastructure between several organizations from a specific community. It may be managed internally or by the third-party.
cloud_computing Tutorial

Benefits

There are many benefits of deploying cloud as community cloud model. The following diagram shows some of those benefits:

COST EFFECTIVE

Community cloud offers same advantage as that of private cloud at low cost.
Sharing Between Organizations
Community cloud provides an infrastructure to share cloud resources and capabilities among several organizations.

SECURITY

Community cloud is comparatively more secure than the public cloud.

ISSUES

  • Since all data is housed at one location, one must be careful in storing data in community cloud because it might be accessible by others.
  • It is also challenging to allocate responsibilities of governance, security and cost.

Cloud Computing Infrastructure as a Service(IaaS)

IaaS provides access to fundamental resources such as physical machines, virtual machines, virtual storage, etc., Apart from these resources, the IaaS also offers:
  • Virtual machine disk storage
  • Virtual local area network (VLANs)
  • Load balancers
  • IP addresses
  • Software bundles
All of the above resources are made available to end user via server virtualization. Moreover, these resources are accessed by the customers as if they own them.
cloud_computing Tutorial

Benefits

IaaS allows the cloud provider to freely locate the infrastructure over the Internet in a cost-effective manner. Some of the key benefits of IaaS are listed below:
  • Full Control of the computing resources through Administrative Access to VMs.
  • Flexible and Efficient renting of Computer Hardware.
  • Portability, Interoperability with Legacy Applications.

FULL CONTROL OVER COMPUTING RESOURCES THROUGH ADMINISTRATIVE ACCESS TO VMS

IaaS allows the consumer to access computing resources through administrative access to virtual machines in the following manner:
  • Consumer issues administrative command to cloud provider to run the virtual machine or to save data on cloud's server.
  • Consumer issues administrative command to virtual machines they owned to start web server or installing new applications.

FLEXIBLE AND EFFICIENT RENTING OF COMPUTER HARDWARE

IaaS resources such as virtual machines, storages, bandwidth, IP addresses, monitoring services, firewalls, etc., all are made available to the consumers on rent. The consumer has to pay based the length of time a consumer retains a resource. Also with administrative access to virtual machines, the consumer can also run any software, even a custom operating system.

PORTABILITY, INTEROPERABILITY WITH LEGACY APPLICATIONS

It is possible to maintain legacy between applications and workloads between IaaS clouds. For example, network applications such as web server, e-mail server that normally runs on consumer-owned server hardware can also be run from VMs in IaaS cloud.

Issues

IaaS shares issues with PaaS and SaaS, such as Network dependence and browser based risks. It also have some specific issues associated with it. These issues are mentioned in the following diagram:
cloud_computing Tutorial

COMPATIBILITY WITH LEGACY SECURITY VULNERABILITIES

Because IaaS offers the consumer to run legacy software in provider's infrastructure, therefore it exposes consumers to all of the security vulnerabilities of such legacy software.

VIRTUAL MACHINE SPRAWL

The VM can become out of date with respect to security updates because IaaS allows the consumer to operate the virtual machines in running, suspended and off state. However, the provider can automatically update such VMs, but this mechanism is hard and complex.

ROBUSTNESS OF VM-LEVEL ISOLATION

IaaS offers an isolated environment to individual consumers through hypervisor. Hypervisor is a software layer that includes hardware support for virtualization to split a physical computer into multiple virtual machines.

DATA ERASE PRACTICES

The consumer uses virtual machines that in turn uses the common disk resources provided by the cloud provider. When the consumer releases the resource, the cloud provider must ensure that next consumer to rent the resource does not observe data residue from previous consumer.

Characteristics

Here are the characteristics of IaaS service model:
  • Virtual machines with pre-installed software.
  • Virtual machines with pre-installed Operating Systems such as Windows, Linux, and Solaris.
  • On-demand availability of resources.
  • Allows to store copies of particular data in different locations.
  • The computing resources can be easily scaled up and down.

Cloud Computing Platform as a Service(PaaS)

PaaS offers the runtime environment for applications. It also offers development & deployment tools, required to develop applications. PaaS has a feature of point-and-click tools that enables non-developers to create web applications.
Google's App Engine, Force.com are examples of PaaS offering vendors. Developer may log on to these websites and use the built-in API to create web-based applications.
But the disadvantage of using PaaS is that the developer lock-in with a particular vendor. For example, an application written in Python against Google's API using Google's App Engine is likely to work only in that environment. Therefore, the vendor lock-in is the biggest problem in PaaS.
The following diagram shows how PaaS offers an API and development tools to the developers and how it helps the end user to access business applications.
cloud_computing Tutorial

Benefits

Following are the benefits of PaaS model:
cloud_computing Tutorial

LOWER ADMINISTRATIVE OVERHEAD

Consumer need not to bother much about the administration because it's the responsibility of cloud provider.

LOWER TOTAL COST OF OWNERSHIP

Consumer need not purchase expensive hardware, servers, power and data storage.

SCALABLE SOLUTIONS

It is very easy to scale up or down automatically based on application resource demands.

MORE CURRENT SYSTEM SOFTWARE

It is the responsibility of the cloud provider to maintain software versions and patch installations.

Issues

Like SaaSPaaS also place significant burdens on consumer's browsers to maintain reliable and secure connections to the provider systems. Therefore, PaaS shares many of the issues of SaaS. However, there are some specific issues associated with PaaS as shown in the following diagram:
cloud_computing Tutorial

LACK OF PORTABILITY BETWEEN PAAS CLOUDS

Although standard languages are used yet the implementations of platforms services may vary. For example, file, queue, or hash table interfaces of one platform may differ from another, making it difficult to transfer workloads from one platform to another.

EVENT BASED PROCESSOR SCHEDULING

The PaaS applications are event oriented which poses resource constraints on applications, i.e., they have to answer a request in a given interval of time.

SECURITY ENGINEERING OF PAAS APPLICATIONS

Since the PaaS applications are dependent on network, PaaS applications must explicitly use cryptography and manage security exposures.

Characteristics

Here are the characteristics of PaaS service model:
  • PaaS offers browser based development environment. It allows the developer to create database and edit the application code either via Application Programming Interface or point-and-click tools.
  • PaaS provides built-in security, scalability, and web service interfaces.
  • PaaS provides built-in tools for defining workflow and approval processes and defining business rules.
  • It is easy to integrate with other applications on the same platform.
  • PaaS also provides web services interfaces that allow us to connect the applications outside the platform.

PaaS Types

Based on the functions, the PaaS can be classified into four types as shown in the following diagram:
cloud_computing Tutorial

STAND-ALONE DEVELOPMENT ENVIRONMENTS

The Stand-alone PaaS works as an independent entity for a specific function. It does not include licensing, technical dependencies on specific SaaS applications.

APPLICATION DELIVERY-ONLY ENVIRONMENTS

The Application Delivery PaaS includes on-demand scaling and application security.

OPEN PLATFORM AS A SERVICE

Open PaaS offers an open source software that helps a PaaS provider to run applications.

ADD-ON DEVELOPMENT FACILITIES

The Add-on PaaS allows to customize the existing SaaS platform.

Cloud Computing Software as a Service(SaaS)

Software as a Service (SaaS) model allows to provide software application as a service to the end users. It refers to a software that is deployed on a hosted service and is accessible via Internet. There are several SaaS applications, some of them are listed below:
  • Billing and Invoicing System
  • Customer Relationship Management (CRM) applications
  • Help Desk Applications
  • Human Resource (HR) Solutions
Some of the SaaS applications are not customizable such as an Office Suite. But SaaS provides us Application Programming Interface (API), which allows the developer to develop a customized application.

Characteristics

Here are the characteristics of SaaS service model:
  • SaaS makes the software available over the Internet.
  • The Software are maintained by the vendor rather than where they are running.
  • The license to the software may be subscription based or usage based. And it is billed on recurring basis.
  • SaaS applications are cost effective since they do not require any maintenance at end user side.
  • They are available on demand.
  • They can be scaled up or down on demand.
  • They are automatically upgraded and updated.
  • SaaS offers share data model. Therefore, multiple users can share single instance of infrastructure. It is not required to hard code the functionality for individual users.
  • All users are running same version of the software.

Benefits

Using SaaS has proved to be beneficial in terms of scalability, efficiency, performance and much more. Some of the benefits are listed below:
  • Modest Software Tools
  • Efficient use of Software Licenses
  • Centralized Management & Data
  • Platform responsibilities managed by provider
  • Multitenant solutions

MODEST SOFTWARE TOOLS

The SaaS application deployment requires a little or no client side software installation which results in the following benefits:
  • No requirement for complex software packages at client side
  • Little or no risk of configuration at client side
  • Low distribution cost

EFFICIENT USE OF SOFTWARE LICENSES

The client can have single license for multiple computers running at different locations which reduces the licensing cost. Also, there is no requirement for license servers because the software runs in the provider's infrastructure.

CENTRALIZED MANAGEMENT & DATA

The data stored by the cloud provider is centralized. However, the cloud providers may store data in a decentralized manner for sake of redundancy and reliability.

PLATFORM RESPONSIBILITIES MANAGED BY PROVIDERS

All platform responsibilities such as backups, system maintenance, security, hardware refresh, power management, etc., are performed by the cloud provider. The consumer need not to bother about them.

MULTITENANT SOLUTIONS

Multitenancy allows multiple users to share single instance of resources in virtual isolation. Consumers can customize their application without affecting the core functionality.

Issues

There are several issues associated with SaaS, some of them are listed below:
  • Browser based risks
  • Network dependence
  • Lack of portability between SaaS clouds

BROWSER BASED RISKS

If the consumer visits malicious website and browser becomes infected, and the subsequent access to SaaS application might compromise the consumer's data.
To avoid such risks, the consumer can use multiple browsers and dedicate a specific browser to access SaaS applications or can use virtual desktop while accessing the SaaS applications.

NETWORK DEPENDENCE

The SaaS application can be delivered only when network is continuously available. Also network should be reliable but the network reliability cannot be guaranteed either by cloud provider or the consumer.

LACK OF PORTABILITY BETWEEN SAAS CLOUDS

Transferring workloads from one SaaS cloud to another is not so easy because work flow, business logics, user interfaces, support scripts can be provider specific.

Open SaaS and SOA

Open SaaS uses SaaS applications that are developed using open source programming language. These SaaS applications can run on any open source operating system and database. Open SaaS has several benefits, some of these are listed below:
  • No License Required
  • Low Deployment Cost
  • Less Vendor Lock-in
  • More portable applications
  • More Robust Solution
The following diagram shows the SaaS implementation based on SOA:
cloud_computing Tutorial


Cloud Computing Identity as a Service(IDaaS)

Overview

Employees in a company require to login into system to perform various tasks. These systems may be based on local server or cloud based. Following are the problems that an employee might face:
  • Remembering different username and password combinations for accessing multiple servers.
  • If an employee leaves the company, it's required to ensure that each of the user's account has been disabled. This increases workload on IT staff.
To solve above problems, a new technique emerged which is known as Identity as a Service (IDaaS).
IDaaS offers management of identity (information) as a digital entity. This identity can be used during electronic transactions.

Identity

Identity refers to set of attributes associated with something and make it recognizable. All objects may have same attributes, but their identity cannot be the same. This unique identity is assigned through unique identification attribute.
There are several identity services that have been deployed to validate services such as validating web sites, transactions, transaction participants, client, etc. Identity as a Service may include the following:
  • Directory Services
  • Federated Services
  • Registration
  • Authentication Services
  • Risk and Event monitoring
  • Single sign-on services
  • Identity and Profile management

Single Sign-On (SSO)

To solve the problem of using different username & password combination for different servers, companies now employ Single Sign-On software, which allows the user to login only one time and manages the user's access to other systems.
SSO has single authentication server, managing multiple accesses to other systems, as shown in the following diagram:
cloud_computing Tutorial

SSO WORKING

There are several implementations of SSO. Here, we will discuss the common working of SSO:
cloud_computing Tutorial
Following steps explain the working of Single Sign-On software:
  1. User logs into the authentication server using a username and password.
  2. The authentication server returns the user's ticket.
  3. User sends the ticket to intranet server.
  4. Intranet server sends the ticket to the authentication server.
  5. Authentication server sends the user's security credentials for that server back to the intranet server.
If an employee leaves the company, then it just required to disable the user at the authentication server, which in turn disables the user's access to all the systems.

Federated Identity Management (FIDM)

FIDM describes the technologies and protocols that enable a user to package security credentials across security domains. It uses Security Markup Language (SAML) to package a user's security credentials as shown in the following diagram:
cloud_computing Tutorial

OpenID

It offers users to login into multiple websites with single account. Google, Yahoo!, Flickr, MySpace, WordPress.com are some of the companies that support OpenID.

Benefits

  • Increased site conversation rates.
  • Access to greater user profile content.
  • Fewer problems with lost passwords.
  • Ease of content integration into social networking sites.

Cloud Computing Network as a Service(NaaS)

Overview

Networks as a Service allows us to access to network infrastructure directly and securely. NaaS makes it possible to deploy custom routing protocols.
NaaS uses virtualized network infrastructure to provide network services to the consumer. It is the responsibility of NaaS provider to maintain and manage the network resources which decreases the workload from the consumer. Moreover, NaaS offers network as a utility.
NaaS is also based on pay-per-use model.

How NaaS is delivered?

To use NaaS model, the consumer is required to logon to the web portal, where he can get online API. Here, the consumer can customize the route.
In turn, consumer has to pay for the capacity used. It is also possible to turn off the capacity at any time.

Mobile NaaS

Mobile NaaS offers more efficient and flexible control over mobile devices. It uses virtualization to simplify the architecture to create more efficient processes.
Following diagram shows the Mobile NaaS service elements:
cloud_computing Tutorial

NaaS Benefits

NaaS offers a number of benefits, some of them are discussed below:
cloud_computing Tutorial

INDEPENDENCE

Each consumer is independent and can segregate the network.

BURSTING

Customers have to pay for high-capacity network only when needed.

RESILIENCE

There exists reliability treatments that can be applied for critical applications.

ANALYTICS

There exists data protection solution for highly sensitive applications.

EASE OF ADDING NEW SERVICE ELEMENTS

It is very easy to integrate new service elements to the network.

SUPPORT MODELS

There exists more open support models, which help to reduce the operation cost.

ISOLATION OF CUSTOMER TRAFFIC

The customer traffic is logically isolated.

Cloud Computing Management

Overview

It is the responsibility of cloud provider to manage resources and their performance. Management may include several aspects of cloud computing such as load balancing, performance, storage and backups, capacity, deployment , etc. Management is required to access full functionality of resources in the cloud.

Cloud Management Tasks

Cloud Management involves a number of tasks to be performed by the cloud provider to ensure efficient use of cloud resources. Here, we will discuss some of these tasks:
cloud_computing Tutorial

AUDIT SYSTEM BACKUPS

It is required to timely audit the backups to ensure you can successfully restore randomly selected files of different users. Backups can be performed in following ways:
  • Backing up files by the company, from on-site computers to the disks that reside within the cloud.
  • Backing up files by the cloud provider.
It is necessary to know if cloud provider has encrypted the data, who has access to that data and if the backup is taken at different locations, you must know where.

SYSTEM'S DATA FLOW

The managers should develop a diagram describing a detailed process flow. This process flow will describe the movement of company's data throughout the cloud solution.

BEWARE OF VENDOR LOCK-IN

The managers must know the procedure to exit from services of a particular cloud provider. There must exist procedures, enabling the managers to export company's data to a file and importing it to another provider.

KNOWING PROVIDER'S SECURITY PROCEDURES

The managers should know the security plans of the provider for different services:
  • Multitenant use
  • E-commerce processing
  • Employee screening
  • Encryption policy

MONITOR CAPACITY PLANNING AND SCALING CAPABILITIES

The managers should know the capacity planning in order to ensure whether the cloud provider will meet the future capacity requirement for his business or not.
It is also required to manage scaling capabilities in order to ensure services can be scaled up or down as per the user need.

MONITOR AUDIT-LOG USE

In order to identify the errors in the system, managers must audit the logs on a regular basis.

SOLUTION TESTING AND VALIDATION

It is necessary to test the solutions provided by the provider in order to validate that it gives the correct result and is error-free. This is necessary for a system to be robust and reliable.

Cloud Computing Data Storage

Cloud Storage is a service that allows to save data on offsite storage system managed by third-party and is made accessible by a web services API.

Storage Devices

Storage devices can be broadly classified into two categories:
  • Block Storage Devices
  • File Storage Devices

BLOCK STORAGE DEVICES

Block Storage Devices offer raw storage to the clients. This raw storage can be partitioned to create volumes.

FILE STORAGE DEVICES

File Storage Devices offers storage to clients in form of files, maintaining its own file system. This storage is in the form of Network Attached Storage (NAS).

Cloud Storage Classes

Cloud Storage can be broadly classified into two categories:
  • Unmanaged Cloud Storage
  • Managed Cloud Storage

UNMANAGED CLOUD STORAGE

Unmanaged Cloud Storage means that the storage is preconfigured for the consumer. The consumer cannot format nor the consumer can install own file system or change drive properties.

MANAGED CLOUD STORAGE

Managed Cloud Storage offers online storage space on demand. Managed cloud storage system presents what appears to the user to be a raw disk that the user can partition and format.

Creating Cloud Storage System

The cloud storage system stores multiple copies of data on multiple servers and in multiple locations. If one system fails, then it only requires to change the pointer to stored object's location.
To aggregate storage assets into cloud storage systems, the cloud provider can use storage virtualization software, StorageGRID. It creates a virtualization layer that fetches storage from different storage devices into a single management system. It can also manage data from CIFS and NFS file system over the Internet. The following diagram shows how SystemGRID virtualizes the storage into storage clouds:
cloud_computing Tutorial

Virtual Storage Containers

Virtual storage containers offer high performance cloud storage systems. Logical Unit Number (LNU)of device, files and other objects are created in virtual storage containers. Following diagram shows a virtual storage container, defining a cloud storage domain:
cloud_computing Tutorial

Challenges

Storing the data in cloud is not that simple task. Apart from its flexibility and convenience, it also has several challenges faced by the consumers. The consumers require ability to:
  • Provision additional storage on demand.
  • Know and restrict the physical location of the stored data.
  • Verify how data was erased?
  • Have access to a documented process for surely disposing of data storage hardware.
  • Administrator access control over data.

Cloud Computing Virtualization

Virtualization

Virtualization is a technique, which allows to share single physical instance of an application or resource among multiple organizations or tenants (customers). It does so by assigning a logical nameto a physical resource and providing a pointer to that physical resource when demanded.

Virtualization Concept

Creating a virtual machine over existing operating system and hardware is referred as Hardware Virtualization. Virtual Machines provide an environment that is logically separated from the underlying hardware.
The machine on which the virtual machine is created is known as host machine and virtual machineis referred as a guest machine. This virtual machine is managed by a software or firmware, which is known as hypervisor.

HYPERVISOR

Hypervisor is a firmware or low-level program that acts as a Virtual Machine Manager. There are two types of hypervisor:
Type 1 hypervisor runs on bare system. LynxSecure, RTS Hypervisor, Oracle VM, Sun xVM Server, VirtualLogic VLX are examples of Type 1 hypervisor. The following diagram shows the Type 1 hypervisor.
cloud_computing Tutorial
The type1 hypervisor does not have any host operating system because they are installed on a bare system.
Type 2 hypervisor is a software interface that emulates the devices with which a system normally interacts. Containers, KVM, Microsoft Hyper V, VMWare Fusion, Virtual Server 2005 R2, Windows Virtual PC and VMWare workstation 6.0 are examples of Type 2 hypervisor. The following diagram shows the Type 2 hypervisor.
cloud_computing Tutorial

Types of Hardware Virtualization

Here are the three types of hardware virtualization:
  1. Full Virtualization
  2. Emulation Virtualization
  3. Paravirtualization

FULL VIRTUALIZATION

In Full Virtualization, the underlying hardware is completely simulated. Guest software does not require any modification to run.
cloud_computing Tutorial

EMULATION VIRTUALIZATION

In Emulation, the virtual machine simulates the hardware and hence become independent of the it. In this, the guest operating system does not require modification.
cloud_computing Tutorial

PARAVIRTUALIZATION

In Paravirtualization, the hardware is not simulated. The guest software run their own isolated domains.
cloud_computing Tutorial
VMware vSphere is highly developed infrastructure that offers a management infrastructure framework for virtualization. It virtualizes the system, storage and networking hardware.

Cloud Computing Security

Security in cloud computing is a major concern. Data in cloud should be stored in encrypted form. To restrict client from direct accessing the shared data, proxy and brokerage services should be employed.

Security Planning

Before deploying a particular resource to cloud, one should need to analyze several attributes about the resource such as:
  • Select which resources he is going to move to cloud and analyze its sensitivity to risk.
  • Consider cloud service models such as IaaS, PaaS, and SaaS. These models require consumer to be responsible for security at different levels of service.
  • Consider which cloud type such as public, private, community or hybrid.
  • Understand the cloud service provider's system that how data is transferred, where it is stored and how to move data into and out of cloud.
Mainly the risk in cloud deployment depends upon the service models and cloud types.

Understanding Security of Cloud

SECURITY BOUNDARIES

A particular service model defines the boundary between the responsibilities of service provider and consumer. Cloud Security Alliance (CSA) stack model defines the boundaries between each service model and shows how different functional units relate to each other. The following diagram shows theCSA stack model:
cloud_computing Tutorial

Key points to CSA model:

  • IaaS is the most basic level of service with PaaS and SaaS next two above levels of service.
  • Moving upwards each of the service inherits capabilities and security concerns of the model beneath.
  • IaaS provides the infrastructure, PaaS provides platform development environment and SaaS provides operating environment.
  • IaaS has the least level of integrated functionalities and integrated security while SaaS has the most.
  • This model describes the security boundaries at which cloud service provider's responsibility ends and the consumer's responsibilities begin.
  • Any security mechanism below the security boundary must be built into the system and above should me maintained by the consumer.
Although each service model has security mechanism but security needs also depends upon where these services are located, in private, public, hybrid or community cloud.

Understanding Data Security

Since all the data is transferred using Internet, data security is of major concern in cloud. Here are key mechanisms for protecting data mechanisms listed below:
  • Access Control
  • Auditing
  • Authentication
  • Authorization
All of the service models should incorporate security mechanism operating in all above-mentioned areas.

ISOLATED ACCESS TO DATA

Since data stored in cloud can be accessed from anywhere, therefore to protect the data, we must have a mechanism to isolate data from direct client access.
Brokered Cloud Storage Access is one of the approaches for isolating storage in cloud. In this approach, two services are created:
  • A broker with full access to storage but no access to client.
  • A proxy with no access to storage but access to both client and broker.

WORKING OF BROKERED CLOUD STORAGE ACCESS SYSTEM

When the client issue request to access data:
  • The client data request goes to proxy's external service interface.
  • The proxy forwards the request to the broker.
  • The broker requests the data from cloud storage system.
  • The cloud storage system returns the data to the broker.
  • The broker returns the data to proxy.
  • Finally the proxy sends the data to the client.
All of the above steps are shown in the following diagram:
cloud_computing Tutorial

Encryption

Encryption helps to protect data from being compromised. It protects data that is being transferred as well as data stored in the cloud. Although encryption helps to protect data from any unauthorized access, it does not prevent from data loss.

Cloud Computing Operations

Overview

Cloud computing operation refers to delivering superior cloud service. Today, cloud computing operations have become very popular and widely employed by many of the organizations just because it allows to perform all business operations over the Internet.
These operations can be performed using a web application or mobile based applications. There are a number of operations that are performed in cloud, some of them are shown in the following diagram:
cloud_computing Tutorial

Managing Cloud Operations

There are several ways to manage day-to-day cloud operations, as shown in the following diagram:
cloud_computing Tutorial
  • Always employ right tools and resources to perform any function in the cloud.
  • Things should be done at right time and at right cost.
  • Selecting an appropriate resource is mandatory for operation management.
  • The process should be standardized and automated to avoid repetitive tasks.
  • Using efficient process will eliminate the waste and redundancy.
  • One should maintain the quality of service to avoid re-work later.

Cloud Computing Applications

Cloud Computing has its applications in almost all the fields such as business, entertainment, data storage, social networking, management, entertainment, education, art and global positioning system, etc. Some of the widely famous cloud computing applications are discussed here in this tutorial:

Business Applications

Cloud computing has made businesses more collaborative and easy by incorporating various apps such as MailChimp, Chatter, Google Apps for business, and Quickbooks.
SNApplication Description
1MailChimp
It offers an e-mail publishing platform. It is widely employed by the businesses to design and send their e-mail campaigns.
2Chatter
Chatter app helps the employee to share important information about organization in real time. One can get the instant feed regarding any issue.
3Google Apps for Business
Google offers creating text documents, spreadsheets, presentations, etc., on Google Docswhich allows the business users to share them in collaborating manner.
4Quickbooks
It offers online accounting solutions for a business. It helps in monitoring cash flow, creating VAT returns and creating business reports.

Data Storage and Backup

Box.com, Mozy, Joukuu are the applications offering data storage and backup services in cloud.
SNApplication Description
1Box.com
Box.com offers drag and drop service for files. It just required to drop the files into Box and access from anywhere.
2Mozy
Mozy offers online backup service for files during a data loss.
3Joukuu
Joukuu is a web-based interface. It allows to display a single list of contents for files stored inGoogle Docs, Box.net and Dropbox.

Management Applications

There are apps available for management task such as time tracking, organizing notes. Applications performing such tasks are discussed below:
SNApplication Description
1Toggl
It helps in tracking time period assigned to a particular project.
2Evernote
Evernote is an application that organizes the sticky notes and even can read the text from images which helps the user to locate the notes easily.
3Outright
It is an accounting app. It helps to track income, expenses, profits and losses in real time.

Social Applications

There are several social networking services providing websites such as Facebook, Twitter, etc.
SNApplication Description
1Facebook
Facebook offers social networking service. One can share photos, videos, files, status and much more.
2Twitter
Twitter helps to interact directly with the public. One can follow any celebrity, organization and any person, who is on twitter and can have latest updates regarding the same.

Entertainment Applications

SNApplication Description
1Audiobox.fm
It offers streaming service, i.e., music can be stored online and can be played from cloud using service's own media player.

Art Applications

SNApplication Description
1Moo
It offers art services such as designing and printing business cards, postcards and minicards.

Cloud Computing Providers

Various Cloud Computing platforms are available today. The following table contains the popular Cloud Computing platforms:
SNPlatform's Description
1Salesforce.com
This is a Force.com development platform. This provide a simple user interface and lets users log in, build an app and push it in the cloud.
2Appistry
The Appistry's CloudQ platform is efficient in delivering a runtime application platform. This platform is very useful to create scalable and service oriented applications.
3AppScale
The AppScale is an open source platform for Google App Engine applications.
4AT&T
The AT&T allows access to virtual servers and manages the virtualization infrastructure. This virtualization infrastructure includes network, server and storage.
5Engine Yard
The Engine Yard is a Rails Application cloud computing platform.
6Enomaly
Enomaly provides the Infrastructure-as-a-Service platform.
7FlexiScale
The FlexiScale offers a cloud computing platform that allows flexible, scalable and automated cloud infrastructure.
8GCloud3
The GCloud3 offers private cloud solution in its gPlatform.
9Gizmox
The Gizmox Visual WebGUI platform is best suited for developing new web apps and modernize the legacy apps based on ASP.net, DHTML, etc.
10GoGrid
The GoGrid platform allows the users to deploy web and database cloud services.
11Google
The Google's App Engine lets the users build, run and maintain their applications on Google's infrastructure.
12LongJump
The LongJump offers a Business Application Platform, a platform-as-a-Service (PaaS).
13Microsoft
The Microsoft's Windows Azure is a cloud computing platform offering an environment to create cloud apps and services.
14OrangeScape
OrangeScape offers a Platform-as-a-Service (Paas) for non-programmers. Building an app is as easy as spreadsheet.
15RackSpace
The RackSpace provide servers-on-demand via a cloud-driven platform of virtualized servers.
16Amazon EC2
The Amazon EC2 (Elastic Compute Cloud) lets the users configure and control computing resources while running them on Amazon's environment.

Cloud Computing Challenges

Cloud computing, an emergence technology, has placed many challenges in different aspects. Some of these are shown in the following diagram:
cloud_computing Tutorial

SECURITY & PRIVACY

Security and Privacy of information is the biggest challenge to cloud computing. Security and privacy issues can be overcome by employing encryption, security hardware and security applications.

PORTABILITY

This is another challenge to cloud computing that applications should easily be migrated from one cloud provider to another. There should not be vendor lock-in. However, it is not yet made possible because each of the cloud provider uses different standard languages for their platforms.

INTEROPERABILITY

Application on one platform should be able to incorporate services from other platform. It is made possible via web services. But writing such web services is very complex.

COMPUTING PERFORMANCE

To deliver data intensive applications on cloud requires high network bandwidth, which results in high cost. If done at low bandwidth, then it does not meet the required computing performance of cloud application.

RELIABILITY AND AVAILABILITY

It is necessary for cloud systems to be reliable and robust because most of the businesses are now becoming dependent on services provided by third-party.

Mobile Cloud Computing

Cloud Computing offers such smartphones that have rich Internet media experience and require less processing, less power. In term of Mobile Cloud Computing, processing is done in cloud, data is stored in cloud. And the mobile devices serve as a media for display.
Today smartphones are employed with rich cloud services by integrating applications that consume web services. These web services are deployed in cloud.
There are several Smartphone operating systems available such as Google's Android, Apple's iOS, RIM BlackBerry, Symbian, and Windows Mobile Phone. Each of these platforms support third-party applications that are deployed in cloud.

Architecture

MCC includes four types of cloud resources:
  • Distant mobile cloud
  • Distant immobile cloud
  • Proximate mobile computing entities
  • Proximate immobile computing entities
  • Hybrid
The following diagram shows the framework for mobile cloud computing architecture:
cloud_computing Tutorial

Issues

Despite of having significant development in field of mobile computing, there still exists many issues:

EMERGENCY EFFICIENT TRANSMISSION

There should be a frequent transmission of information between cloud and the mobile devices.

ARCHITECTURAL ISSUES

Mobile cloud computing is required to make architectural neutral because of heterogeneous environment.

LIVE VM MIGRATION

It is challenging to migrate an application, which is resource-intensive to cloud and to execute it via Virtual Machine.

MOBILE COMMUNICATION CONGESTION

Due to continuous increase demand for mobile cloud services, the workload to enable smooth communication between cloud and mobile devices has been increased.

SECURITY AND PRIVACY

This is one of the major issues because mobile users share their personal information over the cloud.