Monday, January 6, 2014

Personal Computer v/s Server


What is a PC?

personal computer (PC) is a general-purpose computer, whose size, capabilities and original sale price makes it useful for individuals, and which is intended to be operated directly by an end-user with no intervening computer operator.

What is a Server?


server is a system (software and suitable computer hardware) that responds to requests across a computer network to provide, or help to provide, anetwork service.


            We are already very familiar with what a personal computer is since it has slowly become an intricate part of life for most of us. The term was originally meant to point out slower computers that are not suitable for the more complicated and taxing applications that are often run in a corporate server, and are therefore restricted to personal use. This has become largely untrue today since most personal computers are able to host almost any kind of server.

            Servers exist in a very wide variety of configurations and applications. There are HTTP servers, DNS server, mail servers, game server, and many more. Though it is possible to use PCs to host servers, most of the bigger companies do not do this since the loads that they often experience are far greater than what a regular PC can handle. For most business applications, high end computer servers or mainframes are used to keep thousands of users happy at the same time. These machines are way more advanced and complex than a PC.

            Servers are also kept running for extended periods of time in order to prevent uninterrupted service to clients all over the world. This requirement led to the development of technologies that are not common or present in PCs. Redundancy is very essential in servers since it allows components of the computers to fail without bringing down the whole system. Hard drives and power supplies in a server are often redundant and can be replaced with minimal or no disruption to the service.

Summary:
  • A PC is a collection of hardware while a server can either be hardware or software.
  •  A single PC can host multiple servers at the same time but with a limited number of users.
  •  Most serious businesses utilized high end servers with hardware that are not usually found in PCs to cope with great demands.
  • Servers are kept running for weeks or months at a time and requires redundant systems to cope with failure.

Sunday, January 5, 2014

Architectures

What is an Architecture?

An architecture is a blue print image or a designed structure of any object.

why do we use an architecture?

We use architectures in-order to have complete visualization of a particular object we are working with.

There are many types of Architectures. They are:

  • 1-Tier Architecture.
  • 2-Tier Architecture.
  • 3-Tier Architecture.
  • n-Tier Architecture.
1-Tier Architecture:

One-tier architecture involves putting all of the required components for a software application or technology on a single server or platform. This kind of architecture is often contrasted with multi-tiered architecture or the three-tier architecture that's used for some Web applications and other technologies where various presentation, business and data access layers are housed separately.One-tier architecture is also known as single-tier architecture.


2-Tier Architecture:

Refers to client/server architectures in which the user interface runs on the client and the database is stored on the server. The actual application logic can run on either the client or the server. A newer client/server architecture, called a three-tier architecture introduces a middle tier for the application logic.

3-Tier Architecture: 

With the advent of internet,many people jumped to the conclusion that the das of a main frame were back. A host of 'thin-client' application were developed. Thus 3-tier architecture were born. This application runs the traditional client/server model but from a web server. The client only displays the GUI and data but has no part in producing results. Due to this type of architecture there are many benefits. Some of them are:
  • Scalability.
  • Better re-use.
  • Improve data integrity.
  • Improved security.
  • reduced distribution.
  • Improved availabilty.
  • Hidden database structure.
Likewise, there are a few drawbacks:
  • Increased complexity.
  • Tools used are less compared to 2-tier (Eg: repporting tools).


N-Tier Architecture:

N-Tier architecture is an industry-proved software architecture model, suitable to support enterprise-level client/server applications by resolving issues like scalability, security, fault tolerance and etc.



N-tier application architecture provides a model for developers to create a flexible and reusable application. By breaking up an application into tiers, developers only have to modify or add a specific layer, rather than have to rewrite the enitire application over, if they decide to change technologies or scale up. In the term "N-tier," "N" implies any number -- like 2-tier, or 4-tier; basically, any number of distinct tiers used in your architecture. Application architectures are part of Layer 7 of the OSI model.



FileSystem.

What is a file system?

In computing, a file system (or filesystem) is used to control how information is stored and retrieved. Without a file system, information placed in a storage area would be one large body of information with no way to tell where one piece of information stops and the next begins.

Why do we use a file System?

We use a file system for storing the data in an organized form by which we can identify our data easily.

What if we don't have a concept of file system?

If we don't have a concept of file system then the location of data stored cant be traced easily and the retrieval of data becomes complexed.

There are many different kinds of file systems. Each one has different structure and logic. Each one has different properties of speed, flexibility, security, size and more. Some file systems have been designed to be used for specific applications.

What is Windows File System?

Windows mainly support FAT (File Allocation Table) and NTFS (New Technology File system). Windows NT 4.0, Windows 200, Windows XP, Windows .NET server and Windows workstation use NTFS as their preferred file system. Still, FAT can be used with floppy disks and older Windows versions (for multi-boot systems). FAT is the initial file system used in Windows. FAT was used with DOS, and its three versions are FAT12, FAT16 and FAT32. The number of bits used to identify a cluster is the number that is used as the suffix in the name. FAT12, FAT16 and FAT32 have 32MB, 4GB and 32GB as the maximum partition sizes.
NTFS has completely different data organization architecture. Basically, Microsoft developed NTFS to compete with UNIX, by replacing the much more simple FAT. However, the newest FAT version called exFAT is claimed to have certain advantages over NTFS. A FAT partition can be easily converted to a NTFS partition without loosing data. NTFS supports features like indexing, quota tracking, encryption, compression and repair points. Windows uses drive letter to distinguish partitions. Traditionally, The C drive is the primary partition. Primary partition is used to install and boot Windows. Drive letter can be used for mapping network drives as well.

What is Linux File System?

A variety of files systems can be sued with Linux. Commonly used file systems are ext* family (ext, ext2, ext3 and ext4) and XFS. Silicon Graphics developed XFS, which is a journaling system with high performance. The ext (extended file system) was developed in early 1990’s. It was the first file system used in Linux operating system. Remy Card developed it by getting inspiration from the UFS (UNIX File System).
On Linux, everything is a file. If something is not a file, then it is a process. Programs, audio, video, I/O devices and other devices are considered as files. In Linux, there is no difference between a file and a directory. A directory is simply a file containing names of a set of other files. Special files are a mechanism used for I/O (found in /dev). Sockets (another special file type) provide inter-process communication. Named pipes (much like sockets) are used for inter-process communication without network semantics.

What is the difference between Linux File System and Windows File System?

Windows uses FAT and NTFS as file systems, while Linux uses a variety of file systems. Unlike Windows, Linux is bootable from a network drive. In contrast to Windows, everything is either a file or a process in Linux. Linux has two kinds of major partitions called data partitions and swap partitions. Because of the existence of swap partitions, you never run out of memory in Linux (like in windows). In terms of recovery tools, only a limited number of tools can be used on Windows, while there is a large number of UNIX based recovery tools available for Linux file systems.

Environment Variables

What is an environment variable?

         Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer. They can be said in some sense to create the operating environment in which a process runs.

Examples of environment variables include:

  • Path - lists directories the shell searches, for the commands the user may type without having to provide the full path.
  • Temp - location where processes can store temporary files
  • UserProfile - indicate where a user's home directory is located in the file system.
  • AppData\{DeveloperName\AppName} - for storing application settings.
  • Temp - location where processes can store temporary files. 

Types of environment variables

The following list describes the various types of variables in descending order of precedence:
  1. System variables (built-in variables & ones from the HKEY_LOCAL_MACHINE hive)
  2. Local variables found in the HKEY_CURRENT_USER hive
  3. All environment variables and paths set in the Autoexec.bat file (if present)
  4. All environment variables and paths set in a logon script (if present)
  5. Variables used interactively in a script, batch file or application.

Why do we use environment variable?

We use these variables in order to access our required software easily, without setting the path everytime when we are using the s/w. For this purpose, we set the s/w path in environment variables and run our s/w when ever needed.

Environment Variables can be set in any of the operating system, but configuring these variables are a bit different but does the same work.

Configuring Environment Variables in windows Operating System:

1) Right click on the Computer icon on your Desktop and choose Properties option.



Figure 1


2) In the System window click on Advanced system settings in the left pane as highlighted below



Figure 2


3) In the System Properties window select Advanced tab and click on Environment Variables…button given at the bottom of the window as highlighted below



Figure 3


4) In the Environment Variables window you will notice two columns User variables for a username and System variables.



Figure 4


5) Now to add a new User variable click on New… button. In the New User Variable dialog box type the Variable name and Variable value and click OK button



Figure 5


OR

To remove a User variable click on the required User variable and then click on Delete button.

OR

To edit a User variable click on Edit… button. In the Edit User Variable dialog box edit the Variable name and Variable value and click OK button



Figure 6


Note: If you want to add, remove or edit System Variables then repeat this step under System variables column but be careful while doing this.

6) Click OK button in the Environment Variables dialog window

7) Click OK on System Properties window

8) Close System window

Configuring Environment Variables in linux OS:

You can modify each environmental or system variable using the export command. Set the PATH environment variable to include the directory where you installed the bin directory with perl and shell scripts:
 
export PATH=${PATH}:/home/vivek/bin
 
OR
 
export PATH=${PATH}:${HOME}/bin
 
And to make these settings permanent, the following must be done:
The ~/.bash_profile ($HOME/.bash_profile) or ~/.prfile file is executed when you login using console or remotely using ssh. Type the following command to edit ~/.bash_profile file, enter:$ vi ~/.bash_proflle
Append the $PATH settings, enter:
export PATH=${PATH}:${HOME}/bin
Save and close the file.

Friday, January 3, 2014

Operating System

      An operating system (OS) is a collection of software that manages computer hardware resources and provides common services for computer programs. The operating system is an essential component of the system software in a computer system. Application programs usually require an operating system to function.

        Examples of popular modern operating systems include AndroidBSDiOSLinuxOS XQNXMicrosoft Windows, Windows Phone, and IBM z/OS. All these, except Windows, Windows Phone and z/OS, share roots in UNIX.

Types of operating systems:

  • Real Time
  • Multi-User
  • Multi-tasking v/s single-tasking
  • Distributed
  • Embedded
      real-time operating system is a multitasking operating system that aims at executing real-time applications. Real-time operating systems often use specialized scheduling algorithms so that they can achieve a deterministic nature of behavior. The main objective of real-time operating systems is their quick and predictable response to events. They have an event-driven or time-sharing design and often aspects of both. An event-driven system switches between tasks based on their priorities or external events while time-sharing operating systems switch tasks based on clock interrupts.

      multi-user operating system allows multiple users to access a computer system at the same time. Time-sharing systems and Internet servers can be classified as multi-user systems as they enable multiple-user access to a computer through the sharing of time. Single-user operating systems have only one user but may allow multiple programs to run at the same time.

      A multi-tasking operating system allows more than one program to be running at the same time, from the point of view of human time scales. A single-tasking system has only one running program. Multi-tasking can be of two types: pre-emptive and co-operative. In pre-emptive multitasking, the operating system slices the CPU time and dedicates one slot to each of the programs. Unix-like operating systems such as Solaris and Linux support pre-emptive multitasking, as does AmigaOS. Cooperative multitasking is achieved by relying on each process to give time to the other processes in a defined manner. 16-bit versions of Microsoft Windows used cooperative multi-tasking. 32-bit versions of both Windows NT and Win9x, used pre-emptive multi-tasking. Mac OS prior to OS X used to support cooperative multitasking.

       A distributed operating system manages a group of independent computers and makes them appear to be a single computer. The development of networked computers that could be linked and communicate with each other gave rise to distributed computing. Distributed computations are carried out on more than one machine. When computers in a group work in cooperation, they make a distributed system.

       Embedded operating systems are designed to be used in embedded computer systems. They are designed to operate on small machines like PDAs with less autonomy. They are able to operate with a limited number of resources. They are very compact and extremely efficient by design. Windows CE and Minix 3 are some examples of embedded operating systems.

Computer

         A computer system is one that is able to take a set of inputs, process them and create a set of outputs. This is done by a combination of hardware and software.


         The computer system has one or more inputs to provide data. This data is then processed in some way. The outcome of the processing is sent to an output or it may be stored until some event happens to cause it to be output.
         The blue-print of a computer can be shown as :
         The Computer System is mainly divided into four parts:
  • Input devices.
  • CPU (Central Processing Unit).
  • Output Devices.
  • Storage device.

        Precisely, we all know about the input & output devices which are hardware components that we sense them.
        While coming to the CPU, this CPU is mainly divided into three categories:
  • Memory Unit.
  • Control Unit.
  • Arithmetic & Logic Unit (ALU).
       The Memory Unit is the part of the computer that holds data and instructions for processing.Although it is closely associated with the CPU, in actual fact it is separate from it.Memory associated with the CPU is also called primary storage, primary memory, main storage, internal storage and main memory.When we load software from a floppy disk, hard disk or CD-ROM, it is stored in the Main Memory. There are two types of memory in a computer. They are:
  • RAM.
  • ROM.
      RAM stands for Random Access Memory.This is really the main store and is the place where the programs and software we load gets stored. When the Central Processing Unit runs a program, it fetches the program instructions from the RAM and carries them out.If the Central Processing Unit needs to store the results of calculations it can store them in RAM.Random Access Memory can have instructions READ from it by the CPU and also it can have numbers or other computer data WRITTEN to it by the CPU.The more RAM in your computer, the larger the programs you can run.When we switch a computer off, whatever is stored in the RAM gets erased.The following is a photo of a common RAM chip.

   ROM stands for Read Only Memory.The CPU can only fetch or read instructions from Read Only Memory (or ROM). ROM comes with instructions permanently stored inside and these instructions cannot be over-written by the computer's CPU.ROM memory is used for storing special sets of instructions which the computer needs when it starts up.When we switch the computer off, the contents of the ROM does not become erased but remains stored permanently. Therefore it is non-volatile.

   The Control unit is a component of a computer's central processing unit (CPU) which directs operation of the processor. It controls communication and co-ordination between input/output devices. It reads and interprets instructions and determines the sequence for processing the data.
   
    It directs the operation of the other units by providing timing and control signals. All computer resources are managed by the CU (Control Unit). It directs the flow of data between the Central Processing Unit (CPU) and the other devices. The control unit was historically defined as one distinct part of the 1946 reference model of Von-Neumann architecture. In modern computer designs, the control unit is typically an internal part of the CPU with its overall role and operation unchanged.

   The functions of CU are:
  • Controls sequential instruction execution
  • Interprets instructions
  • Guides data flow through different computer areas
  • Regulates and controls processor timing
  • Sends and receives control signals from other computer devices
  • Handles multiple tasks, such as fetching, decoding, execution handling and storing results
     Arithmetic Logic Unit, ALU is one of the many components within a computer processor. The ALU performs mathematical, logical, and decision operations in a computer and is the final processing performed by the processor. After the information has been processed by the ALU, it is sent to the computer memory.In some computer processors, the ALU is divided into two distinct parts, the AU and the LU. The AU performs the arithmetic operations and the LU performs the logical operations.