Java Programming Tips ...

Popular Java/J2EE Development/Testing Tools

1. IDE => Eclipse/Netbeans/IntelliJ IDEA/JBuilder/JDeveloper/WSAD

2. Application Server => WebSphere/Weblogic/Sun GlassFish/Apache Tomcat/JBoss/JRun/Iplanet/NES(Netscape Enterprise Server)/NAS(Netscape Application Server) /IPLANET(It is latest version of NES and NAS)

3. Database Server => Oracle/Sqlserver/Sybase/MySql/DB2(if Application is Mainframe)

4. Middle Tier => EJB/Hibernate/TopLink/JDO/JMS/Corba(TAO,JavaOrb,OmniOrb ...)

5. Web Application Frameworks => Struts/Spring/JSF/GWT/Apache Wicket/Grails/Adobe Flex/ OpenLaszlo/SAILS/Tapestry

6. XML Parser => Xerces(Apache Parser)/JAXP(Sun Parser)

7. XSLT Parser => Xalan(Apache XSLT)/Saxon

8. JAVA XML Binding => JAXB/Castor/XMLBeans

9. Unit Testing Framework for Java => JUnit/GJTester

10. Unit Testing Framework for Servlets => Cactus/AppPerfect

11. Unit Testing Framework for Servlets/JSP/EJB => HtmlUnit/AppPerfect

12. Unit Testing Framework for Java Database Programming => SQLUnit / DBUnit / DAO

13. Java Memory Leak Tool => HeapRoots / JRockit JVM

14. Java Performance Checking Tool => Apache JMeter / JProfiler / JUnitPerf / The Grinder

15. Java Code Static Analysis Tool => ASSENT(TCS Product)/JTest

16. Java Code Coverage Tools => CheckStyle/PMD

17. Java Build Tool => Ant/Maven/Apache Ivy


18. Java Bug tracking Tool => Jira/Bugzilla/SVN Trac/QC(Quality Center)

19. Java Webservices Tool/Libraries => Jersey(RESTful) / Restllet / Axis(SOAP WebServices)

20. Java Common Utilities API => Apache Commons Library ( Please check this Library before you develop any new Java Utilities Classes)

21. Java Reporting Tools => BI Crystal Reports/Actuate/Jasper Reports/JCharts

22. Open Source UML & Modeling in Java => AgroUML/WebUML/Jude/Violet

23. Logging Tools => Log4J / Commons Logging / AspectJ / Log4plsql(Open-Source Tool for PL/SQL Logging) / jLo

24. Java Security Frameworks => Acegi, JaaS

25. Java Graph/Network Visualization Tools => Tom Sawyer / VizServer / Giny


26. Java Desktop GUI : AWT/SWING/GWT/SWT/JFace

27. Open Source Wiki Engines in Java => JSPWiki / MediaWiki

28. Web Browsers => Chrome/Mozilla FireFox/Safari/IE


29. Miscellaneous:

a. Continuous Integration/Build Tools => Jenkins / Hudson


b. Encryption/Decryption Libraries => JASYPT (Pretty good Java cryptography library to encrypt/decrypt your usernames, passwords, files ...)

c. Image API => Jai (Java Advanced API for Imaging)

d. Configuration Management Tools - Subversion / CVS

e. Java Service Wrapper (To run your java applications as a windows service)

f. Content Management System(CMS) - plone / zoomla / zope / drupal

g. Java Persistence API(JPI)

h. JCR - Content Repository API for Java (JCR) is a specification for a Java platform API for accessing content repositories in a uniform manner

i. MULE - Mule is the world's most widely used open source Enterprise Service Bus (ESB).

j. JSON - JSON (JavaScript Object Notation) is a lightweight data-interchange formatFor data-oriented applications, prefer JSON to XML due to its simplicity and ease of processing on the client side. XML may be great on the server side, but JSON is definitely easier to deal with on the client side. Popular JSON libraries are Jackson, Gson.

k. Rhino - Javascript Engine in Java

l. Apache Lucene/Solr - A high-performance, full-featured text search engine library written entirely in Java

m. JavaScript Web Frameworks - AngularJS, Dojo

n. JavaScript Unit Testing - Jasmine

Core Java Focus:
1. Core Java Fundamentals (Core Packages)

2. Collections, Generics, Reflections
3. Multithreaded Programming
4. AWT/SWING GUI Programming
5. JDBC programming
6. Network Progamming (sockets, ...)
7. HTTP Programming
8. RMI
9. JNDI

Compared to JDK 4.0 ( 1.4.4) , JDK 5.0 ( 1.4.5) has more features like -
1. Generics => which are like C++ STL (Standard Template Library)

2. Variable Args
3. enum
4. Auto Boxing
5. Reading Commandline Arguments
6. printf

J2EE Focus:
Here you will focus on one of the J2EE Web Application Frameworks -

Any Web Application Framework => Presentation Tier, Middle Tier
Examples:

1. Struts => Presentation Tier(Servlets,JSP),Middle Tier(EJB)
2. Spring => Presentation Tier(Servlets, JSP), Middle Tier(Hibernate)
...

So the common and fundamental stuff in J2EE is Servlets, JSP
Servlets => HTML code Snippets embedded with JAVA code
JSP => Java Code Snippets embedded with HTML code

So we can say Servlets & JSP in J2EE as Fundamentals of J2EE programming.
To be a good one in J2EE, You have to be proficient in atleast one Application Server & one Database Server based on the Operating System that you are going to deploy J2EE Products/Applications.

Application Server can be => WebSphere/JBoss
Database Server can be => Oracle/SqlServer ( if OS is Windows then SqlServer )

Thanks To:
Special Thanks to my husband, Krishna Koney for his inspiration, contribution and continuous support to write this Java/J2EE post.

Books:

1. "Thinking in Java , 3rd Edition" by Bruce Eckle - http://www.mindview.net/Books/TIJ/


2. Joshua Bloch effective Java (2nd edition) - http://uet.vnu.edu.vn/~chauttm/e-books/java/Effective.Java.2nd.Edition.May.2008.3000th.Release.pdf

3."'J2EE Web Services: The Ultimate Guide" by Richard Monson-Haefel -http://books.google.com/books?id=NNqmolbaApQC&pg=PA1&dq=j2ee&sig=ACfU3U3-RDn6uGY8QZ6DjYPT_Fb_dSPiKA#PPA885,M1

4. "J2EE Design Patterns" by William Crawford, Jonathan Kaplan -
http://books.google.com/books?id=N_cEwmcSauUC&printsec=frontcover&dq=j2ee&sig=ACfU3U0cgVRY8TUXpZc8TH31xU_4Z_XgRA

5. "Core J2ee Patterns: Best Practices and Design Strategies" by Deepak Alur, John Crupi -
http://books.google.com/books?id=1dx34EMVyi8C&printsec=frontcover&dq=j2ee&sig=ACfU3U34F4XCp2YQSIge-EQHvjjJqQcU9w#PPA11,M1

6. "J2EE and JAX: developing Web applications and Web services" by Michael Yawn -
http://books.google.com/books?id=SK0Im1uI3jsC&printsec=frontcover&dq=j2ee&lr=&sig=ACfU3U3gToC6jT-YLbNQ5WRzKgL7hlmNcQ

7. "Sun Certified Enterprise Architect for J2EE Study Guide (exam 310-051)" by Paul R. Allen, Joseph J. Bambara -
http://books.google.com/books?id=GJRKjnwYJcgC&printsec=frontcover&dq=j2ee&lr=&sig=ACfU3U3qAxMyrwvi8V26J7QYGiwp1vZkDA

8. "Sun Certified Enterprise Architect for J2EE technology study guide" by Mark Cade, Simon Roberts -
http://books.google.com/books?id=qczD49Yc9OoC&pg=PA11&dq=j2ee&sig=ACfU3U3fiZUtuhg0RHFnbFJEz5ZXu8-dlQ#PPP1,M1

9. "Core Web Programming" by Marty Hall and Larry Brown

10. "CodeNotes for J2EE: EJB, JDBC, JSP, and Servlets" by Gregory Brill

Ref:

1. Open Source Software in Java - http://java-source.net/

2. Open Source Testing Tools in Java - http://java-source.net/open-source/testing-tools

3. Java/J2EE IDEs Overview - http://www.devx.com/Java/Article/34009

4. J2EE Interview Questions - http://www.geekinterview.com/Interview-Questions/J2EE

5. J2EE Overview - http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Overview.html

6. J2EE Overview - http://www.comptechdoc.org/docs/kanti/ejb/j2eeoverview.html

7. .NET vs J2EE - http://www.oreillynet.com/pub/a/oreilly/java/news/farley_0800.html

8. Java Desktop GUI - http://www.javaworld.com/javaworld/jw-04-2004/jw-0426-swtjface.html

9. Java Content Repository(JCR) API -http://en.wikipedia.org/wiki/Content_repository_API_for_Java

10. Mule -
http://www.mulesource.com/products/mule.php

http://www.theserverside.com/tt/articles/article.tss?track=NL-461&ad=645256&l=COISWithMuleandJCR&asrc=EM_NLN_3809631&uid=3048354

11. JSON - http://www.subbu.org/weblogs/main/2006/08/json_vs_xml_1.html

12. Ruby Blog - http://ola-bini.blogspot.com/2008/06/fractal-programming.html

13. Java Interview Questions -http://www.indijava.in/community/faq/java_interview_questions

14. Runtime Code Generation with JVM & CLR - http://www.itu.dk/~sestoft/rtcg/rtcg.pdf


15. JVM vs CLR memory allocation - http://benpryor.com/blog/2006/05/04/jvm-vs-clr-memory-allocation/

16. Javascript Engines : WebMonkey(in C) , Rhino(In Java) - http://www.mozillazine.org/

17. Runtime Code Generation with JVM & CLR - http://www.itu.dk/~sestoft/rtcg/rtcg.pdf

18. JVM vs CLR memory allocation - http://benpryor.com/blog/2006/05/04/jvm-vs-clr-memory-allocation/

19. PHP Frameworks - CAKE, ZEND, SYMFONY

20. Java Server Magazine - http://www.javaskyline.com/

C++ Programming Tips ...


C++ VC++ Interview Preparation Spectrum:

General Concepts 1. Pointers

2. Algorithms/Programs for basic String Operations

3. Reverse of a String using Pointers

4. Swap 2 numbers without using temporary variables & Swap 2 numbers using XOR operator

5. Find the duplicate number in an NOT sorted Array of numbers ... Best Search alogorithm

6. Algorithms/Programs regarding Single Linked Lists, Double Linked Lists, Binary Search, Hash Tables, Tree, B-Tree
    a. Reverse a Single Linked List
    b. Finding whether a Loop is present in Single Linked List
    c. Finding whether a Loop is present in Single Linked List & Break the Loop


C++ Concepts
1. Difference between Pointers and References, Why References in C++, C++ Function Pointers, extern "C"

2. Constructor, Private Constructor, Singleton, Initializer List, Destructor, Virtual Destructor,Pure Virtual Destructor, new, delete , Private Inheritance

3. Copy Constructor, Assignment Operator , Shallow Binding vs Deep Binding

4. Static Member Functions, Friend Functions

5. Runtime Polymorphism , Virtual Pointers, Virtual Tables, Abstract Classes

6. Templates, STL (Vector, List, Map ...)

7. C++ TypeCasting(dynamic_cast,reinterpret_cast,static_cast,constant_cast), dynamic_cast w.r.t C++ References ,Smart Pointers , auto_ptr


OS specific Concepts(Windows, Unix (AIX, Solaris, HPUX, Linux))

Windows
1. Inter Process Communication (Named pipes, WinSock, Memory Mapped Files, Window Messages (SendMessage, PostMessage))

2. MultiThreading

3. Thread Synchronization(Critical Section, Mutex, Events, Semaphore, WaitForSingleObject,WaitForMultipleObject)

4. Windows Hooks , Windows Timers, Windows Services

5. Component Object Model(COM), COM Threading Models, IDL, MIDL, IUnknown, IDispatch, Monikers

6. Microsoft Foundation Classes(MFC), Document View Architecture, Command Message Flow, Customizing MFC Controls, MFC Subclassing, MFC HTTP Programming(WinInet), MFC Wizards, MFC Panes , MVC Design Pattern

7. MFC Subclassing (1. Override the IsSubclassedControl and PreCreateWindow member functions of COleControl 2. Modify the OnDraw member function)
...

Unix1. Inter Process Communication (Pipes, Named pipes, Sockets, Messages Queues & Shared Memory)

2. Multithreading (Pthreads, OS specific threads)

3. Thread Synchronization mechanisms (Semaphore, Mutex, Condition Variable)

4. UNIX Systems Calls, Signals


Database Programming (Sqlserver, Oracle on Windows & Sybase, Oracle on UNIX)
1. Accessing Database on Windows using ODBC, OLEDB, ADO

2. Accessing Database on UNIX using Database specific API (example: OCI/OCCI API to access Oracle)

3. Developing Stored Procedures using TSQL on SqlServer & Sybase

4. Developing Stored Procedures using PL/SQL on Oracle

5. Understand SqlInjection and how to prevent it
...

GUI Programming
1. GUI programming using Win32 API

2. MFC Programming in Windows , modal & modeless dialogs, SDI vs MDI, Message Command Flow in MFC , MFC Subclassing, Customizing MFC Controls

3. Developing ActiveX controls using MFC

4. Using Curses Library on Unix

5. Using Motif/QT/… on Unix


Advanced Topics
1. Design Patterns ( Read GOF book on Patterns)The link below explains Design Patterns in general & has C++/Java example code for each Design pattern.
Link : http://www.vincehuston.org/dp/

2. SOA Architecture ; Developing WebServices (using either gSoap (or) Microsoft specific )

3. Popular Design Patterns : Singleton, Factory, Observer, Command, Decorator, Facade, Builder

Misc
1. XML (MSXML Parser on Windows, Xerces parser, Expat (Written in "C"))
2. XSLT Parser(Xalan C++ parser)
3. Boost Regular Expression Libray / PCRE
4. HTTP (GET/POST)


ACE(Adaptive Communication Environment) - http://www.cs.wustl.edu/~schmidt/ACE.html



Books:

C++ Books


1. "Thinking in C++" by Bruce Eckle - http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

2. Charles Petzold Website -
http://www.charlespetzold.com/

3. Douglas C. Schmidt -
http://www.ece.uci.edu/~schmidt/

4. Vijay Mukhi's Website (Online Books) -
http://www.vijaymukhi.com/

5. Online Books -
http://www.esnips.com/

6. Online Books -
http://onlinebooks.library.upenn.edu/

7. Online Books -
http://safari.informit.com/

8. Safari Online Books -
http://safari.oreilly.com/

9. "Effective C++" by Scott Meyers (ISBN #0201924889) "More Effective C++" by Scott Meyers (ISBN #020163371X)

10. "The C++ Standard Library" by Nicolai Josuttis (ISBN #0201379260)

11. "Accelerated C++" by Koenig and Moo (ISBN #020170353X)


VC++ Books

1. "Programming Windows With MFC" by Jeff Prosise

2. "Programming Applications for Microsoft Windows" by Jeffrey Richter

3. "Microsoft Windows Internals" by Mark E. Russinovich, David A. Solomon

4. "Programming Windows" by Charles Petzold


C/C++(UNIX) Books

1. "UNIX Network Programming" by W. Richard Stevens

2. "Advanced Programming in the UNIX(R) Environment" by W. Richard Stevens

3. "Design of the UNIX Operating System" by Maurice J. Bach

Arduino Development

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.

Arduino is a single-board microcontroller, intended to make building interactive objects or environments more accessible. The hardware consists of an open-source hardware board designed around an 8-bit Atmel AVR microcontroller, or a 32-bit Atmel ARM. Current models feature a USB interface, 6 analog input pins, as well as 14 digital I/O pins that accommodate various extension boards.


Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is programmed using the Arduino programming language and the Arduino development environment. Arduino projects can be stand-alone or they can communicate with software on running on a computer (e.g. Flash, Processing, MaxMSP. The boards can be built by hand or purchased preassembled; the software can be downloaded for free. The hardware reference designs (CAD files) are available under an open-source license, you are free to adapt them to your needs.


avr-gcc, avr-g++, avr-objcopy, avrdude are the tools used in compiling 'C' code on arduino.


ref:


wiki - http://en.wikipedia.org/wiki/Arduino


Arduino website - http://www.arduino.cc/


Opensource Hardware Group(All about Arduino) - http://opensourcehardwaregroup.com/


Arduino IDE - http://arduino.cc/en/main/software


Arduino development environment - http://arduino.cc/en/guide/Environment


Arduino Development tools - http://playground.arduino.cc/Main/DevelopmentTools


Arduino library - https://github.com/arduino/Arduino/tree/master/hardware/arduino/cores/arduino


Arduino Makefile - https://github.com/sudar/Arduino-Makefile


Programming Arduino Uno in pure C/C++ - 

Arduino IDE for Microsoft Visual Studio and Atmel Studio - http://www.visualmicro.com/

Introduction to Arduino - http://www.instructables.com/id/Intro-to-Arduino/


Intel Arduino compatible Galileo board - http://www.intel.com/content/www/us/en/do-it-yourself/galileo-maker-quark-board.html


Arduiono IDE and sketch development overview - http://opensourcehardwaregroup.com/tutorial-3-arduino-ide-and-sketch-overview/


Arduino boards summary - http://www.hobbytronics.co.uk/arduino-summary


Advanced Arduino Hacking - https://pragprog.com/magazines/2011-04/advanced-arduino-hacking


Arduino Books -


Arduino Cookbooks -

Arduino Cookbook 2nd edition - 

Arduino Cookbook 1st edition - 

Apache Hadoop - An open source implementation of MapReduce programming model

MapReduce, a programming model and implementation developed by Google for processing massive-scale, distributed data sets. Apache Hadoop is an open source MapReduce implementation software framework that supports running data-intensive distributed applications on large cluster built of commodity hardware.

Apache Hadoop is an open source software framework that supports data-intensive distributed applications licensed under the Apache v2 license. It enables applications to work with thousands of computational independent computers and petabytes of data. Hadoop was derived from Google's MapReduce and Google File System (GFS) papers.Hadoop is a top-level Apache project being built and used by a global community of contributors, written in the Java programming language. Yahoo! has been the largest contributor[3] to the project, and uses Hadoop extensively across its businesses.

Apache Hadoop is a framework for running applications on large cluster built of commodity hardware. The Hadoop framework transparently provides applications both reliability and data motion. Hadoop implements a computational paradigm named Map/Reduce, where the application is divided into many small fragments of work, each of which may be executed or re-executed on any node in the cluster. In addition, it provides a distributed file system (HDFS) that stores data on the compute nodes, providing very high aggregate bandwidth across the cluster. Both MapReduce and the Hadoop Distributed File System are designed so that node failures are automatically handled by the framework.

As a conceptual framework for processing huge data sets, MapReduce is highly optimized for distributed problem-solving using a large number of computers. The framework consists of two functions, as its name implies. The map function is designed to take a large data input and divide it into smaller pieces, which it then hands off to other processes that can do something with it. The reduce function digests the individual answers collected by map and renders them to a final output.

In Hadoop, you define map and reduce implementations by extending Hadoop's own base classes. The implementations are tied together by a configuration that specifies them, along with input and output formats. Hadoop is well-suited for processing huge files containing structured data. One particularly handy aspect of Hadoop is that it handles the raw parsing of an input file, so that you can deal with one line at a time. Defining a map function is thus really just a matter of determining what you want to grab from an incoming line of text.

HDFS(Hadoop Distributed File System): a distributed file-system that stores data on commodity machines, providing very high aggregate bandwidth across the cluster.

HDFS is so good for -


  • Storing large files
    • Terabytes, Petabytes, etc...
    • Millions rather than billions of files 100MB or more per file
  • Streaming data
    • Write once and read-many times patterns
    • Optimized for streaming reads rather than random reads
    • Append operation added to Hadoop 0.21
  • “Cheap” Commodity Hardware
    • No need for super-comp

HDFS is not so good for - 



  • Low-latency reads
    • High-throughput rather than low latency for small chunks of data
    • HBase addresses this issue
  • Large amount of small files
    • Better for millions of large files instead of billions of small files
    • For example each file can be 100MB or more
  • Multiple Writers
    • Single writer per file
    • Writes only at the end of file, no-support for arbitrary offset


pig vs hive:

Pig is a language for expressing data analysis and infrastructure processes. Pig is a platform for analyzing large data sets that consists of a high-level language for expressing data analysis programs, coupled with infrastructure for evaluating these programs. Pig is translated into a series of MapReduce jobs that are run by the Hadoop cluster. Pig is extensible through user-defined functions that can be written in Java and other languages. Pig scripts provide a high level language to create the MapReduce jobs needed to process data in a Hadoop cluster.

Apache Hive provides a data warehouse function to the Hadoop cluster. Through the use of HiveQL you can view your data as a table and create queries like you would in a database. To make it easy to interact with Hive we use a tool in the Hortonworks Sandbox called Beeswax. Beeswax gives us an interactive interface to Hive. We can type in queries and have Hive evaluate them for us using a series of MapReduce jobs.



PIG is a procedural data-flow language. A procedural language is executing step-by-step approach defined by the programmers. You can control the optimization of every step. 
HIVE looks like SQL language. Thus, it becomes declarative language. You can specify what should be done rather how should be done. Optimization is difficult in HIVE since HIVE depends on its own optimizer

Ref:

MapReduce: Simplified Data Processing on Large Clusters - http://static.usenix.org/events/osdi04/tech/full_papers/dean/dean.pdf


Apache Hadoop Goes Realtime at Facebook - http://borthakur.com/ftp/RealtimeHadoopSigmod2011.pdf


Java development 2.0: Big data analysis with Hadoop MapReduce - http://www.ibm.com/developerworks/java/library/j-javadev2-15/index.html


To Hadoop, or not to Hadoop - https://www.ibm.com/developerworks/mydeveloperworks/blogs/theTechTrek/entry/to_hadoop_or_not_to_hadoop2?lang=en


What is Hadoop - http://www-01.ibm.com/software/data/infosphere/hadoop/

Distributed data processing with Hadoop, Part 1: Getting started - http://www.ibm.com/developerworks/linux/library/l-hadoop-1/

Distributed data processing with Hadoop, Part 2: Going further - http://www.ibm.com/developerworks/linux/library/l-hadoop-2/


Distributed data processing with Hadoop, Part 3: Application development - http://www.ibm.com/developerworks/linux/library/l-hadoop-3/


An introduction to the Hadoop Distributed File System - http://www.ibm.com/developerworks/web/library/wa-introhdfs/


Scheduling in Hadoop - http://www.ibm.com/developerworks/linux/library/os-hadoop-scheduling/index.html


Using MapReduce and load balancing on the cloud - http://www.ibm.com/developerworks/cloud/library/cl-mapreduce/


Intel Big Data - http://www.intel.com/bigdata


Apache Hadoop Framework Spotlights - http://www.intel.com/content/www/us/en/big-data/big-data-apache-hadoop-framework-spotlights-landing.html


Miscellaneous:


  • The Hadoop wiki provides community input related to Hadoop and HDFS.
  • The Hadoop API site documents the Java classes and interfaces that are used to program to Hadoop and HDFS.
  • Wikipedia's MapReduce page is a great place to begin your research into the MapReduce framework.
  • Visit Amazon S3 to learn about Amazon's S3 infrastructure.
  • The developerWorks Web development zone specializes in articles covering various web-based solutions.
       Get products and technologies
  • The Hadoop project site contains valuable resources pertaining to the Hadoop architecture and the MapReduce framework.
  • The Hadoop Distributed File System project site offers downloads and documentation about HDFS.
  • Venture to the CloudStore site for downloads and documentation about the integration between CloudStore, Hadoop, and HDFS.
       Discuss

Multi-Tenant Architecture

Multitenancy refers to a principle in software architecture where a single instance of the  software runs on a server, serving multiple client organizations (tenants). Multitenancy is contrasted with a multi-instance architecture where separate software instances (or hardware systems) are set up for different client organizations. With a multitenant architecture, a software application is designed to virtually partition its data and configuration, and each client organization works with a customized virtual application instance. Multitenancy is also regarded as one of the essential attributes of cloud computing.

Differentiation from Virtualization:

In a multitenancy environment, multiple customers share the same application, running on the same operating system, on the same hardware, with the same data-storage mechanism. The distinction between the customers is achieved during application design, thus customers do not share or see each other's data. Compare this with virtualization where components are abstracted enabling each customer application to appear to run on a separate physical machine.

Approaches to Managing Multi-Tenant Data:
  1. Separate Databases
  2. Shared Database, Separate Schemas
  3. Shared Database, Shared Schema
Hybrid Multi-Tenant Database Architecture:
  1. Single Tenant - While this approach offers customers a separate custom database, it does not allow for a scalable solution thereby requiring software vendors to maintain multiple highly variable database schemas making software upgrades more difficult and restricting the ability of the vendor to maintain one core code base.
  2. Multi-Tenant with Identical Schemas - While this approach offers substantial scalability, it limits the breadth of configuration options for each individual customer forcing them to cope with limited business process support from the application.
  3. Multi-Tenant with Custom Schemas - While this approach offers a wide range of configuration options for the customer, it limits the vendor's ability to maintain one core code base and/or forces the vendor to introduce customer specific complexity into the master code line potentially impacting performance.
ref:

Convert your web application to a multi-tenant SaaS solution - http://www.ibm.com/developerworks/cloud/library/cl-multitenantsaas/

An Open Multi-Tenant Architecture to Leverage SMEs - http://www.europeanjournalofscientificresearch.com/ISSUES/EJSR_65_4_14.pdf

A Multi-Tenant Architecture for Business Process Execution - http://people.apache.org/~hemapani/research/papers/ode-multi-tenancy.pdf

Securing Multi-Tenancy and Cloud Computing - http://www.juniper.net/us/en/local/pdf/whitepapers/2000381-en.pdf

SaaS strategies for Software Delivery - http://msdn.microsoft.com/en-us/library/aa479069.aspx