May 5, 2012

What's the Cloud computing? Why the Cloud?

What's the cloud computing? 
Most of the session I'm attending related to the cloud computing starting with this question but every time you 'll find another definitions !! ..Any way I love the NIST Definition of Cloud Computing


Cloud computing is a model for enabling ubiquitous, convenient, on-demand network access to a shared
pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that
can be rapidly provisioned and released with minimal management effort or service provider interaction.
This cloud model is composed of five essential characteristics, three service models, and four deployment
models.


Essential Characteristics:
On-demand self-service. A consumer can unilaterally provision computing capabilities, such as server time and network storage, as needed automatically without requiring human
interaction with each service provider.  
Broad network access. Capabilities are available over the network and accessed through standard mechanisms that promote use by  heterogeneous thin or thick  client platforms (e.g.,
mobile phones, tablets, laptops, and workstations). 
Resource pooling. The provider’s computing resources are pooled to serve multiple consumers using a multi-tenant model, with different physical and virtual resources dynamically
assigned and reassigned according to consumer demand. There is a sense of location
independence in that the customer generally has no control or knowledge over the exact
location of the provided resources but may be able to specify location at a higher level of
abstraction (e.g., country, state, or datacenter). Examples of resources include storage,
processing, memory, and network bandwidth. 
Rapid elasticity. Capabilities can be elastically provisioned and released, in some cases
automatically, to scale rapidly outward and inward commensurate with demand. To the
consumer, the capabilities available for provisioning often appear to be unlimited and can
be appropriated in any quantity at any time. 
Measured service. Cloud systems automatically control and optimize resource use by leveraging a metering capability at some level of abstraction appropriate to the type of service (e.g., storage, processing, bandwidth, and active user accounts). Resource usage can be
monitored, controlled, and reported, providing transparency for both the provider and
consumer of the utilized service.

Service Models:
Software as a Service (SaaS). The capability provided to the consumer is to use the provider’s applications running on a cloud infrastructure. The applications are accessible from
various client devices through either a thin client interface, such as a web browser (e.g.,
web-based email), or a program interface. The consumer does not manage or control the
underlying cloud infrastructure including network, servers, operating systems, storage, or
even individual application capabilities, with the possible exception of limited  userspecific application configuration settings. 
Platform as a Service (PaaS). The capability provided to the consumer is to deploy onto the cloud infrastructure consumer-created or acquired applications created using programminglanguages, libraries, services, and tools supported by the provider.The consumer does not manage or control the underlying cloud infrastructure including network, servers, operating systems, or storage, but has control over the deployed applications and possibly configuration settings for the application-hosting environment. 
Infrastructure as a Service (IaaS).  The capability provided to the consumer is to provision
processing, storage, networks, and other fundamental computing resources where the
consumer is able to deploy and run arbitrary software, which can include operating
systems and applications. The consumer does not manage or control the underlying cloud
infrastructure but has control over operating systems, storage, and deployed applications;
and possibly limited control of select networking components (e.g., host firewalls).


You will find other service models in this post
http://muhammadhamed.blogspot.com/2010/10/cloud-computing-definitions-and-types.html

Like Data-as-a Service, Identity and policy as aservice .. etc.
Deployment Models:
Private cloud. The cloud infrastructure is provisioned for exclusive use by a single organization comprising multiple consumers (e.g., business units). It may be  owned, managed, and operated by the organization, a third party, or some combination of them, and it may exist
on or off premises. 
Community  cloud. The cloud infrastructure  is  provisioned for exclusive use by  a specific
community of consumers from organizations that  have shared concerns (e.g., mission,
security requirements,  policy, and compliance considerations). It may be  owned,
managed, and operated by  one or more of the organizations in the community, a third
party, or some combination of them, and it may exist on or off premises. 
Public cloud. The cloud infrastructure is provisioned for open use by the general public. It may be owned, managed, and operated by a business, academic, or government organization, or some combination of them.  It exists on the premises of the cloud provider. 
Hybrid cloud. The cloud infrastructure is a  composition of two or more  distinct  cloud
infrastructures (private, community, or public) that remain unique entities, but are bound
together by standardized or proprietary technology that enables  data and application
portability (e.g., cloud bursting for load balancing between clouds).  

Why should I transform to the cloud?

The fact that cloud provides a new business model which is pay-as-you-go .. in this model you will pay only for what you actually used, you will not reserve a complete servers with a specific bandwidth ..etc as in the old model but you will request at any time a a machine <virtual machine> .. think about your own infrastructure if you want to scale your own infrastructure how much time you need to buy the Hardware and configure, and plugin it into your infrastructure .. in the cloud this done via a clicks.

the matter of the cloud of being Elastic encourages The small and medium companies to start their own business.. How? he can request a cluster of machines with small money .. and he can scale it at any time with just clicks if the business expanded.

So transforming to the cloud will save a lot of money and will handle a lot of risks.


I hope this could help. In the next posts I'll speak about building application for the cloud.

References

May 4, 2012

Why Graph database? Why Neo4j?

I have introduced before a simple overview about the NoSQL databases , what they are? and what is its types? in this post
http://muhammadhamed.blogspot.com/2012/04/nosql-graphdb-document-db-key-value.html


What's the Neo4j?


Neo4j is a high-performance, NOSQL graph database with all the features of a mature and robust database. The programmer works with an object-oriented, flexible network structure rather than with strict and static tables — yet enjoys all the benefits of a fully transactional, enterprise-strength database. For many applications, Neo4j offers performance improvements on the order of 1000x or more compared to relational DBs.

Neo4j is an open source project available in a GPLv3 Community edition, with Advanced and Enterprise editions available under both the AGPLv3 and commercial licenses, supported by Neo TechnologyLearn which license is right for you.

Why and When to use the graph databases?

The graph databases are built upon the graph theory. As you know that there are a lot of real life problems can be formed as a graph which is Nodes, Arcs, and properties of both. For example let's say that we need to develop a social site like this :



If you tried to implement this in RDBMS and you'll have to develop a very complicated queries while it will be simple if you used the Graph model <breadth or depth search and return paths>. Also besides the fact that the Neo4J is solve most of the RDMS scalability as it is horizontal scalable. Most of the problems that have challenges are the network like problems .. think about the Social like facebook, google .. etc. Can you imagine how to represent some recursive relation into RDBMS ?!! .. Regarding the performance of the Neo4J check this :

think that how much your application will be elastic -able to run for small but can run for big scale- for example u developed a site you now have 1000 people and after months your users became 1000000 people simply the application can serve more due to using a horizontal scalable  database.

see this comparison for querying RDBM and Neo4j:

for 1000 people:
  • RDBMS 100ms.
  • Neo4j 2ms.
for 1000000 people:


  •  Neo4j 2ms.
Here are a good summery when to use the graph databases (Neo4j) check this for more: http://highscalability.com/neo4j-graph-database-kicks-buttox

Most applications today handle data that is deeply associative, i.e. structured as graphs (networks). The most obvious example of this is social networking sites, but even tagging systems, content management systems and wikis deal with inherently hierarchical or graph-shaped data.


This turns out to be a problem because it’s difficult to deal with recursive data structures in traditional relational databases. In essence, each traversal along a link in a graph is a join, and joins are known to be very expensive. Furthermore, with user-driven content, it is difficult to pre-conceive the exact schema of the data that will be handled. Unfortunately, the relational model requires upfront schemas and makes it difficult to fit this more dynamic and ad-hoc data.


A graph database uses nodes, relationships between nodes and key-value properties instead of tables to represent information. This model is typically substantially faster for associative data sets and uses a schema-less, bottoms-up model that is ideal for capturing ad-hoc and rapidly changing data.

Neo4j's Key Characteristics


  • Dual license: open source and commercial.
  • Well suited for many web use cases such as tagging, metadata annotations, social networks, wikis and other network-shaped or hierarchical data sets.
  • An intuitive graph-oriented model for data representation. Instead of static and rigid tables, rows and columns, you work with a flexible graph network consisting of nodes, relationships and properties.
  • Decent documentation, active and responsive email list, a few releases, good buzz. All a good sign for something that has a chance to last a while.
  • Has bindings for a number of languages Python, Jython, Ruby, and Clojure. No binding for .Net yet. The recommendation is to access using a REST interface.
  • Disk-based, native storage manager completely optimized for storing graph structures for maximum performance and scalability. SSD ready.
  • Massive scalability. Neo4j can handle graphs of several billion nodes/relationships/properties on a single machine.
  • Frequently outperforms relational backends with >1000x for many increasingly important use cases.
  • Powerful traversal framework for high-speed traversals in the node space.
  • Small footprint. Neo4j is a single <500k jar with one dependency (the Java Transaction API).
  • Simple and convenient object-oriented API.
  • Retrieving children is trivial in a graph database.
  • No need to flatten and serialize an object graph as graphs are native to a graph database.
  • Fully transactional like a real database. Supports JTA/JTS, XA, 2PC, Tx recovery, deadlock detection, etc.
  • Current implementation is built to handle large graphs that don't fit in memory with durability. It's not a cache, it's a fully persistent transactional store.
  • No events or triggers. Planned in a future release.
  • No sharding. A suggestion for how one might shard is here.
  • Some common graph calculations are missing. For example, in a social network finding a common friend for a set of users.
  • Separates data and logic with a more "natural" representation than tables. This makes it easy to use Neo4j as the storage tier for OO code while keeping behaviour and state separate.
  • Neo4j traverses depths of 1000 levels and beyond at millisecond speed. That's many orders of magnitude faster than relational systems.

  • For more about Neo4j check this :



    In the next post I'll present to you how to use the Neo4j to solve real life problem using Java.


    I hope this could help. 

    References