mysql & postgresql

25
 MySQL & PostgreSQL By Kanchana Welagedara Lanka Software Foundation www.opensource.lk

Upload: others

Post on 12-Sep-2021

34 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MySQL & PostgreSQL

   

MySQL & PostgreSQL

ByKanchana Welagedara

Lanka Software  Foundation         www.opensource.lk

Page 2: MySQL & PostgreSQL

   

Agenda● Introduction● History● Licensing● Features● Commercial DB Engines vs Open Source DB 

Engines● Demonstration with XAMPP ● Q&A

Page 3: MySQL & PostgreSQL

   

Introduction 

www.postgresql.org

WWW.mysql.org

Page 4: MySQL & PostgreSQL

   

Introduction ­MySQL & Postgressql usage● BioPharma● Defense● e­Commerce● Education● Energy● Finance● Gaming● Travel

● Government● Healthcare● Manufacturing● Media● Open Source Projects● Retail● Technology● Telecom

Page 5: MySQL & PostgreSQL

   

Introduction­MySQL& Postgres users

Page 6: MySQL & PostgreSQL

   

How it All Began ...

Page 7: MySQL & PostgreSQL

   

History­PostgreSQLUniversity Of California Berkley ­1986 

POSTGRES project

Prof.Michael Stonebraker

Page 8: MySQL & PostgreSQL

   

History ­MySQL● mSQL project●  MySQL ­1995 may●     MySQL first Windows Release ­1998●        Version 3.23: beta from June  ­2000●          production release January   ­ 2001●            Version 4.0: beta    August – 2002●              Version 4.1 (r­trees, subqueries)March ­2003●                Version 5.0: beta ­      2005 (cursors,stored    

                                                               procedures,                                        triggers, views, XA transactions)

Founder MySQL ABDavid Axmark

Page 9: MySQL & PostgreSQL

   

Licensing ­ MySQL● GNU General Public License (GPL) for GPL 

projects ­If your project is 100 % GPL in its distribution

● Commercial License for commercial applications­If you DON'T want to distribute the source code for your application.

Page 10: MySQL & PostgreSQL

   

Licensing ­ PostgreSQL● Berkley License ­ It allows for any use as long 

as a copy of the Berkley License is included with it.

● Much Simpler 

Page 11: MySQL & PostgreSQL

   

Features ­Storage● MySQL­ Multiple Storage 

Engines● Native storage engines 

(MyISAM, Falcon, Merge, Memory (heap), Federated, Archive, CSV, Blackhole, Cluster) 

● Partner­developed storage engines (InnoDB, solidDB, NitroEDB, BrightHouse)

● Community­developed storage engine 

● Custom storage engine

● PostgreSQL­Single data Storage mechanism 

Page 12: MySQL & PostgreSQL

   

Feature ­Data Integrity● MySQL and PostgreSQL are ACID ( Atomic, 

Consistent, Isolated, Durable )Compliant.● Both Support partial rollbacks of transactions 

and deadlocks.● MySQL ­ Row­level locking● PostgreSQL ­Multi Version Concurrency 

Control (MVCC) default or RLL optional

Page 13: MySQL & PostgreSQL

   

Features­The Advanced Features

MySQLPostgreSQLPostgreSQLviews,

triggers, stored procedures, cursors

Commercial DB 

inheritance,sequences,user­defined data types

Page 14: MySQL & PostgreSQL

   

Features ­Replication

MySQL PostgreSQL

single­master, multi­slave replication scenarios

multi­master, multi­slave replication from a third­party vendor&  additional Replication methods

Page 15: MySQL & PostgreSQL

   

Features­Database Interface Methods● Support ODBC and JDBC for network 

connectivity● Native database access methods● Authentication for the database● Both support access via C/C++, Java, Perl, 

Python, and PHP

Page 16: MySQL & PostgreSQL

   

More Features● Stored Procedures and Triggers ­PL/pgSQL, is 

very similar to Oracle's PL/SQL,PostgreSQL's procedures and triggers can be written in PL/TCL, PL/perl,PL/python

● Indexes­ Single column, multi­column, unique, and primary key indexes,MySQL supports  full text indexes out of the box

● Data Types­Large Objects Data Types,GIS,PostgresSQL ­user define data type

Page 17: MySQL & PostgreSQL

   

● GUI Tools­Tools to manage DB,Natively on your operating system or Web­based tools

● Data Migration­Tools to migrate data from commercial databases

● Backup­ come with scripts to facilitate a simple text dump of your database data and its schema,simple database recovery­­>soft failures,database crashes or unexpected power failures

Page 18: MySQL & PostgreSQL

   

Platform Support

LinuxFreeBSDWindowsMacOS

MySQL

Oracle ,DB2

PostgreSQL

AIX, BSDiHP­UX,NetBSD, Novell NetWare, OpenBSD, OS/2 Warp, QNX, SGI IRIX, Solaris, SunOS, SCO OpenServer, SCO Tru64,

Page 19: MySQL & PostgreSQL

   

Commercial DB   vs                      MySQL &PostgresSQL

Product GradeMySQL Very GoodPostgresSQL Very GoodOracle Poor

MySQL: FreeOracle8: Number of processors * number of MHz * USD 15Postgres: FreePrice of the smallest multi­user installation MySQL: FreeOracle8: 5 * USD 160Postgres: Free

Prices

Page 20: MySQL & PostgreSQL

   

Commercial DB vs MySQL & PostgresCategory Problem

Importance Assessment

MySQL Oracle8 Postgres

C C B C ASQL B B C B B

B B C A A

A C D A C

C C C A A

B C B A B

A C D A ALocks A C D A A

A D C A C

B C D A A

B D A A BBackup A C C A C

C C A B A

Central database

Lab-participan

ts

Elementary features

Basic data types

Declarative constraintsProgramming abstractionsGeneration of idsNational chars

Transactions

Transactions

Multiuser access

Programming in DB

Stored procedures and triggers

Administration

Access control

Data migration

Page 21: MySQL & PostgreSQL

   

Commercial DB vs MySQL & Postgres

B D D A B

B D D A D

A C C A CSize limits A B B A C

A C D A B

C D C A C

B D D B D

Performance and VLDB

Structures supporting optimizationSupport for OLAPAllocation of the disk space

VLDB implementations

Distributed databases

Access to multiple databasesHeterogeneous systems support

Category Problem

Importance Assessment

MySQL Oracle8 PostgresCentral

database

Lab-participan

ts

Page 22: MySQL & PostgreSQL

   

Commercial DB vs MySQL & Postgres

C C D A B

C C D A C

C C D A B

B C B A B

A A A A A

A A B A BXML B C D A DCASE B C D A D

Reliability Recovery A B C A CPrices C A A D A

A B C B D

A C D A D

Special data types

Post-relational extensionsSupport for special data types

Application development and interfaces

Embedded SQLStandard interfacesAdditional interfacesWeb technology

Commercial issues

Technical supportPosition on the market

Category Problem

Importance Assessment

MySQL Oracle8 PostgresCentral

database

Lab-participan

ts

Page 23: MySQL & PostgreSQL

   

Using open source DB in Developments .....

Prerequisites 

1. XAMPP  (www.apachefriends.org)  installed2. jdk 1.4 / +3. Eclipse ­­­>PHPEclipse(www.eclipse.org)

Page 24: MySQL & PostgreSQL

   

Q & A

?

Page 25: MySQL & PostgreSQL

   

Thank You!

Lanka Software Foundationwww.opensource.lk