g p srinagar government polytechnic srinagar cse …

44
G P SRINAGAR

Upload: others

Post on 20-Jul-2022

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

G P S

RINAGAR

Dell
Text Box
GOVERNMENT POLYTECHNIC SRINAGAR CSE 6TH SEM OPEN SOURCE TECHNOLOGY
Page 2: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

G P S

RINAGAR

Page 3: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

G P S

RINAGAR

Page 4: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

G P S

RINAGAR

Page 5: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

G P S

RINAGAR

Page 6: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

G P S

RINAGAR

Page 7: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

G P S

RINAGAR

Page 8: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

G P S

RINAGAR

Page 9: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

G P S

RINAGAR

Page 10: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

G P S

RINAGAR

Page 11: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

G P S

RINAGAR

Page 12: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

G P S

RINAGAR

Page 13: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

1

Open Source Software

Open source software is software like any other.

However it is distinguished by its license, or terms of

use, which guarantees certain freedoms, in contrast to

closed proprietary software which restricts these rights.

Open source software guarantees the right to

access and modify the source code, and to use, reuse

and redistribute the software, all with no royalty or

other costs. In some cases, there can be an obligation to

share improvements with the wider community, thus

guaranteeing global benefit.

1. Use the software without access restrictions, within the

terms of the license applied

2. View the source code

3. Improve and add to the object and source code, within

the terms of the license applied and this may include a

term making it mandatory to publish modified code on

the community website

G P S

RINAGAR

Page 14: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

2

4. Distribute the source code.

The Open Source Initiative (OSI) maintains the

Open Source Definition (OSD), and is recognised

globally as the authority on certifying whether a license

is truly open source.

The restated policy on open source software aimed

to ensure maximum value for money for taxpayers. The

policy reflected changes to both the open source market

and the Government's approach to IT. The policy set out

a requirement for there to be a level playing field for

open source software, and encouraged the use of open

standards and the re-use of already purchased software.

The Action Plan set out the steps needed across

Government, and with our IT suppliers, to take

advantage of the benefits of open source. The key points

of the Government‘s policy are set out below:

G P S

RINAGAR

Page 15: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

3

(1) The Government will actively and fairly consider

open source solutions alongside proprietary ones in

making procurement decisions,

(2) Procurement decisions will be made on the basis on

the best value for money solution to the business

requirement, taking account of total lifetime cost of

ownership of the solution, including exit and transition

costs, after ensuring that solutions fulfil minimum and

essential capability, security, scalability, transferability,

support and manageability requirements.

(3) The Government will expect those putting forward

IT solutions to develop where necessary a suitable mix

of open source and proprietary products to ensure that

the best possible overall solution can be considered.

(4) Where there is no significant overall cost difference

between open and non-open source products, open

source will be selected on the basis of its additional

inherent flexibility.

G P S

RINAGAR

Page 16: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

4

Pros and cons of Open Source

Solutions In recent years the software and wider IT

marketplace has developed to make open source

products more competitive and easier to include in

enterprise business solutions. However the suitability

of open source is best determined on a case-bycase

basis and requires a detailed and well-informed

evaluation. A fair assessment needs to be made as to

which solution offers the best value for the taxpayer, it

is important to bear in mind that there will be pros and

cons for any solution.

Pros of Open Source may include:

1. The acquisition cost, development and

implementation contract costs are likely to be lower

than for proprietary software. It is less likely that there

will be contractually-bound upgrade costs. However,

the total cost of ownership over the lifetime of usage

must be taken into account

G P S

RINAGAR

Page 17: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

5

2. Data transferability; with open source code and a

move towards open data formats, there are greater

opportunities to share data across interoperable

platforms 3. Increased opportunities for reuse. Because

open source is free from per user or per instance costs

and there is a guaranteed freedom to use in any way,

reuse is enabled.

4. Paying once for development (if at all) and reuse

across government where appropriate, therefore

offering cost effectiveness.

5. By virtue of their collaborative design, many user-

facing open source products are intuitive for the user

6. Potential for fast cycle time of releases and bug fixes;

7. Opportunities for customization and community

innovation within government and the wider public

sector, and also citizens, SMEs.

G P S

RINAGAR

Page 18: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

6

8. Open source licences do not limit or restrict who can

use the software, the type of user, or the areas of

business in which the software can be used.

9. Open Source solutions are scalable in both directions

– upwards and downwards with a reduction in the risk

of longer term financial implications.

Cons of Open Source may include:

1. If the source code is made available to the wider

community, it is also vulnerable to threats from the

hacker community.

2. Intellectual property rights – as code is modified and

adapted by departments, there may be legal risks

around whether the code retains its open source status

and who owns the intellectual property rights of the

modified code.

G P S

RINAGAR

Page 19: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

7

Intellectual property (IP)

Intellectual property (IP) is a term referring to

creation of the intellect (the term used in studies of the

human mind) for which a is assigned to designated

owners by law. Some common types of intellectual

property rights (IPR), in some foreign countries

intellectual property rights is referred to as industrial

property, copyright, patent and trademarks, trade

secrets all these cover music, literature and other

artistic works, discoveries and inventions and words,

phrases, symbols and designs. Intellectual Property

Rights are themselves a form of property called

intangible property.

Although many of the legal principles governing IP and

IPR have evolved over centuries, it was not until the 19

th century that the term intellectual property began to

be used and not until the late 20 th century that it

G P S

RINAGAR

Page 20: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

8

became common place in the majority of the world. IP is

divided into two categories for ease of understanding:

1. Industrial Property

2. Copyright Industrial property, which includes

inventions (patents), trademarks, industrial designs,

and geographic indications of source; and Copyright,

which includes literary and artistic works such as

novels, poems and plays, films, musical works, artistic

works such as drawings, paintings, photographs and

sculptures, and architectural designs.

Rights related to copyright include those of performing

artists in their performances, producers of phonograms

in their recordings, and those of broadcasters in their

radio and television programs.

Open Source and Open Standards

Open source and open standards are not the same

thing. Open source refers to software whose source

G P S

RINAGAR

Page 21: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

9

code is freely available to users for reference,

debugging, modification, and/or extension. Open

standards are, typically, specifications: formal

descriptions of software or software interfaces. Open

standards may have reference implementations, but the

description in the formal standard typically takes

precedence over the behaviour of a reference

implementation.

It is interesting that the two phrases use the word

"open" so differently: For open source, open means that

the source code must be distributed with every copy of

an executable application and every recipient must be

allowed to modify and distribute the source code freely

to subsequent users. In open standards, open signifies

that the standards process is open to participation and

that the completed standards are available to everyone.

Working documents and drafts are typically kept

private to the issuing organization's members, and

G P S

RINAGAR

Page 22: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

10

there may be reasonable conditions for participation

such as membership fees, but any person or company

may participate as a member at a meaningful level.

Many standards organizations give copies of their

standards away for free and the right to implement a

standard is typically also free and, if not, is available on

fair and equitable terms.

Open Source Licensing

A lot of confusion is out there about what exactly

licensing means. When you license your work, you’re

not giving away any of your rights. You still hold the

original copyright (or patent if you have one) on that

work. What a license does is grant specific permissions

for others to use that work.

Licensing is a great alternative to just releasing your

work into the public domain or granting permissions on

a case-by-case basis. By releasing into the public

G P S

RINAGAR

Page 23: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

11

domain, you relinquish any copyright, and no one is

obligated to list you as the original author or

contributor. In the latter case, you may end up spending

more time dealing with individual permissions than

designing or developing.

Open-source licenses make it easy for others to

contribute to a project without having to seek special

permission. It also protects you as the original creator,

making sure you at least get some credit for your

contributions. It also helps to prevent others from

claiming your work as their own.

1. GNU General Public License

The GNU General Public Licence (GPL) is probably one

of the most commonly used licenses for open-source

projects. The GPL grants and guarantees a wide range of

rights to developers who work on open-source projects.

G P S

RINAGAR

Page 24: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

12

Basically, it allows users to legally copy, distribute and

modify software. This means you can:

Copy the software.. Copy it onto your own servers,

your client’s servers, your own computer, pretty much

anywhere you want. There’s no limit to the number of

copies you can make.

Distribute the software however you want.. Provide

a download link on your website. Put the software on a

bunch of thumb drives and give them away. Print out

the source code and throw it from the rooftops (please

don’t, though, because that would waste a lot of paper

and make a mess).

Charge a fee to distribute the software.. If you want

to charge someone to provide the software, set it up on

their website or do anything else related to it, you can

do so. But, you must give them a copy of the GNU GPL,

which basically tells them that they could probably get

G P S

RINAGAR

Page 25: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

13

the software elsewhere for free. Best to be up front

about that, and about why you’re charging them.

Make whatever modifications to the software you

want.. If you want to add or remove functionality, go

ahead. If you want to use a portion of the code in

another project, you can. The only catch is that the other

project must also be released under the GPL.

Please note that it is very important to see source and

binaries distribution as two very different things. Also,

there are issues and restrictions with some licenses

when used with applications released under “each

other”.

2. GNU LESSER GENERAL PUBLIC LICENSE

You should be aware of another GNU license: the Lesser

General Public Licence (LGPL). It grants fewer rights to

a work than the standard GPL. Generally, the LGPL is

appropriate for libraries that want to allow linking from

G P S

RINAGAR

Page 26: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

14

non-GPL and non-open-source software. Because the

GPL requires that other software with parts of licensed

code to also be licensed under the GPL, developers

cannot use GPL-licensed code for paid and proprietary

software. The LGPL negates this by not requiring other

projects with parts of the code to be similarly licensed.

3. BSD License

BSD licenses represent a family of permissive free

software licenses that have fewer restrictions on

distribution compared to other free software licenses

such as the GNU General Public License. Among

different versions of the license two versons are

particularly important: the New BSD License/Modified

BSD License, and the Simplified BSD License/FreeBSD

License. Both have been verified as GPL-compatible free

software licenses, and have been accepted as open

source licenses by the Open Source Initiative.

G P S

RINAGAR

Page 27: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

15

The New BSD License (“3-clause license”) allows

unlimited redistribution for any purpose as long as its

copyright notices and the license’s disclaimers of

warranty are maintained. The license also contains a

clause restricting use of the names of contributors for

endorsement of a derived work without specific

permission. The primary difference between the New

BSD License and the Simplified BSD license is that the

latter omits the non-endorsement clause.

4. MIT License

The MIT License is the shortest and probably broadest

of all the popular open-source licenses. Its terms are

very loose and more permissive than most other

licenses. The basic provision of the license (minus the

information that it is provided without warranty, which

comprises the final paragraph) is as follows:

G P S

RINAGAR

Page 28: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

16

Permission is hereby granted, free of charge, to any

person obtaining a copy of this software and associated

documentation files (the “Software”), to deal in the

Software without restriction, including without

limitation the rights to use, copy, modify, merge,

publish, distribute, sublicense, and/or sell copies of the

Software, and to permit persons to whom the Software

is furnished to do so, subject to the following

conditions:

The above copyright notice and this permission notice

shall be included in all copies or substantial portions of

the Software.

What this means is that:

You can use, copy and modify the software however you

want. No one can prevent you from using it on any

project, from copying it however many times you want

G P S

RINAGAR

Page 29: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

17

and in whatever format you like, or from changing it

however you want.

You can give the software away for free or sell it. You

have no restrictions on how to distribute it.

The only restriction is that it be accompanied by the

license agreement.

The MIT License is the least restrictive license out there.

It basically says that anyone can do whatever they want

with the licensed material, as long as it’s accompanied

by the license.

5. Apache License

The Apache License, Version 2.0, grants a number of

rights to users. These rights can be applied to both

copyrights and patents. Because some licenses can be

applied only to copyrights and not patents, this

flexibility would be an obvious factor in a patent

G P S

RINAGAR

Page 30: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

18

developer’s choice of license Here are some more

details on what the Apache License allows:

Rights are perpetual.. Once they’ve been granted, you

can continue to use them forever.

Rights are worldwide.. If the rights are granted in one

country, then they’re granted in all countries. For

example, if you’re in the US and the original license was

granted in India, you’re not prevented from using the

code under the license.

Rights are granted for no fee or royalty.. Not only will

you not be charged any kind of up-front usage fee, but

you will not be charged fees on a per-usage or any other

basis either.

Rights are non-exclusive.. You can use the licensed

work, and so can anyone else.

Rights are irrevocable.. No one can take these rights

away once they’re granted. In other words, you don’t

need to worry that down the road, when you’ve created

G P S

RINAGAR

Page 31: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

19

some awesome derivative of the licensed code, someone

will swoop in and say,

Creative Commons

Creative Commons (CC) licenses aren’t quite open-

source licenses, but they are commonly used for design

projects. A wide variety of CC licenses is available, each

granting certain rights. A CC license has four basic parts,

which can be enacted individually or in combination.

Here’s an overview of the parts:

Attribution. The author must be attributed as the

creator of the work. Beyond that, the work can be

modified, distributed, copied and otherwise used.

Share Alike. The work can be modified, distributed and

so forth, but only under the same CC license.

Non-Commercial. The work can be modified,

distributed and so on, but not for commercial purposes.

The language about what constitutes “commercial” is a

G P S

RINAGAR

Page 32: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

20

bit vague (no express definition is provided), so you

may want to clarify this in your own projects. For

example, some might interpret “non-commercial” as

simply meaning that you can’t sell the work. Others

might take it to mean that you can’t even put the work

on a website that has advertising. Still others might

consider something is “commercial” only if it makes a

profit.

No Derivative Works. This means you can copy and

distribute the licensed work, but you can’t modify it in

any way or create work based on the original.

OPERATING SYSTEM

Every time you switch on your computer, you see a

screen where you can perform different activities like

write, browse the internet or watch a video. What is it

G P S

RINAGAR

Page 33: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

21

that makes the computer hardware work like that? How

does the processor on your computer know that you are

asking it to run a mp3 file? Well, it is the operating

system or the kernel which does this work.

A kernel is a program at the heart of any operating

system that takes care of fundamental stuff, like letting

hardware communicate with software. So, to work on

your computer, you need an Operating System(OS).

In fact, you are using one as you read this on your

computer. Now, you may have used popular OS's like

Windows, Apple OS X but here we will learn what Linux

is and what benefits it offers over other OS choices.

Linux

Linux is an operating system or a kernel. It is

distributed under an open source license. Its

functionality list is quite like UNIX.

G P S

RINAGAR

Page 34: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

22

UNIX is called the mother of operating systems

which laid out the foundation to Linux. Unix is designed

mainly for mainframes and is in enterprises and

universities. While Linux is fast becoming a household

name for computer users, developers, and server

environment. You may have to pay for a Unix kernel

while in Linux it is free.

Linux is open-source, free to use kernel. It is used

by programmers, organizations, profit and non- profit

companies around the world to create Operating

systems to suit their individual requirements. To

prevent hacking attempts, many organizations keep

their Linux operating systems private. Many others

make their variations of Linux available publicly so the

whole world can benefit at large. These versions/ types

/kinds of Linux operating system are called

Distributions.

G P S

RINAGAR

Page 35: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

23

primarily it has these components: the Kernel,

Hardware layer, System library, Shell and System utility.

1. The kernel is the core part of the operating system,

which is responsible for all the major activities of the

LINUX operating system.

W3C

Protocols are the languages that programs and

devices use to “talk” to each other. It is the

basic protocol for exchanging Web pages and related

information around the Internet. W3C also defines the

SOAP protocol that can be used to build more

sophisticated services on top of the Web.

Created in 1994, W3C is an international

community of member organizations that articulates

web standards so that websites look and work the

same in all web browsers. ... In particular, W3C

G P S

RINAGAR

Page 36: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

24

standards for XML and CSS ensure that every website

will function the same on any browser.

XML

Extensible markup Language or XML plays a

significant role in the present world of

web development, it is perfectly useful for those who

wish to make use of web technologies for distributing

information across the web. Like HTML, XML is also

being used to format a document with a web browser

XML is used to encode all communications to a web

service. For example, a client invokes a web service by

sending an XML message, then waits for a

corresponding XML response. Webservices are XML-

based information exchange systems that use the

Internet for direct application-to-application

interaction.

G P S

RINAGAR

Page 37: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

25

The extensible Markup Language (XML) is an open

standard facilitating a means to share data and

information between computers and computer

programs as unambiguously as possible. Once

transmitted, it is up to the receiving computer program

to interpret the data for some useful purpose thus

turning the data into information. Sometimes the data

will be rendered as HTML. Other times it might be used

to update and/or query a database. Originally intended

as a means for Web publishing, the advantages of XML

have proven useful for things never intended to be

rendered as Web pages.

It is helpful to compare XML to other written

languages. Like others, XML has a certain syntax. One on

hand, the syntax is very simple. You really only need to

know six or seven rules in order to create structurally

sound -- oftentimes called "well-formed" -- XML

documents. On the other hand, since XML is also

G P S

RINAGAR

Page 38: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

26

intended to be read by computers, the rules are very

particular. If you make even the slightest syntactical

error the whole thing is ruined. Here are the rules:

1. XML documents always have one and only one root

element

2. Element names are case-sensitive

3. Elements are always closed

4. Elements must be correctly nested

5. Elements' attributes must always be quoted

6. There are only five entities defined by default (<, >, &, ",

and ')

7. When necessary, namespaces must be employed to

eliminate vocabulary clashes.

MySQL Database

G P S

RINAGAR

Page 39: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

27

Database

A database is a separate application that stores a

collection of data. Each database has one or more

distinct APIs for creating, accessing, managing,

searching and replicating the data it holds.

Other kinds of data stores can also be used, such as

files on the file system or large hash tables in memory

but data fetching and writing would not be so fast and

easy with those type of systems.

Nowadays, we use relational database

management systems (RDBMS) to store and manage

huge volume of data. This is called relational database

because all the data is stored into different tables and

relations are established using primary keys or other

keys known as Foreign Keys.

A Relational DataBase Management System

(RDBMS) is a software that −

G P S

RINAGAR

Page 40: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

28

Enables you to implement a database with tables,

columns and indexes.

Guarantees the Referential Integrity between rows of

various tables.

Updates the indexes automatically.

Interprets an SQL query and combines information

from various tables.

RDBMS Terminology

Before we proceed to explain the MySQL database

system, let us revise a few definitions related to the

database.

Database − A database is a collection of tables, with

related data.

Table − A table is a matrix with data. A table in a

database looks like a simple spreadsheet. G P S

RINAGAR

Page 41: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

29

Column − One column (data element) contains data of

one and the same kind, for example the column

postcode.

Row − A row (= tuple, entry or record) is a group of

related data, for example the data of one subscription.

Redundancy − Storing data twice, redundantly to make

the system faster.

Primary Key − A primary key is unique. A key value

can not occur twice in one table. With a key, you can

only find one row.

Foreign Key − A foreign key is the linking pin between

two tables.

Compound Key − A compound key (composite key) is

a key that consists of multiple columns, because one

column is not sufficiently unique.

Index − An index in a database resembles an index at

the back of a book.

G P S

RINAGAR

Page 42: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

30

Referential Integrity − Referential Integrity makes

sure that a foreign key value always points to an

existing row.

MySQL Database

MySQL is a fast, easy-to-use RDBMS being used for

many small and big businesses. MySQL is developed,

marketed and supported by MySQL AB, which is a

Swedish company. MySQL is becoming so popular

because of many good reasons −

MySQL is released under an open-source license. So you

have nothing to pay to use it.

MySQL is a very powerful program in its own right. It

handles a large subset of the functionality of the most

expensive and powerful database packages.

MySQL uses a standard form of the well-known SQL

data language.

G P S

RINAGAR

Page 43: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

31

MySQL works on many operating systems and with

many languages including PHP, PERL, C, C++, JAVA, etc.

MySQL works very quickly and works well even with

large data sets.

MySQL is very friendly to PHP, the most appreciated

language for web development.

MySQL supports large databases, up to 50 million rows

or more in a table. The default file size limit for a table

is 4GB, but you can increase this (if your operating

system can handle it) to a theoretical limit of 8 million

terabytes (TB).

MySQL is customizable. The open-source GPL license

allows programmers to modify the MySQL software to

fit their own specific environments.

MySQL Server works in:

G P S

RINAGAR

Page 44: G P SRINAGAR GOVERNMENT POLYTECHNIC SRINAGAR CSE …

GOVERNMENT POLYTECHNIC SRINAGAR GARHWAL

COMPUTER SCIENCE & ENGINEERING - 6th sem

OPEN SOURCETECHNOLOGY

32

• client/server systems → a system that consists of a

multi-threaded SQL server that supports different

backends, several different client programs and

libraries, administrative tools, and a wide range of

application programming interfaces (APIs).

• embedded systems → provide MySQL Server as an

embedded multi-threaded library that can be linked

into an application to get a smaller, faster, easier-to-

manage standalone product.

G P S

RINAGAR