Software Libero e RDBMS

annuncio pubblicitario
Software Libero e RDBMS
DB2 Express-C 9 e MySQL Community Server a confronto
Alessandro Benati
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
RDBMS
Il termine Relational DataBase
Management System (RDBMS),
RDBMS sistema
relazionale per la gestione di basi di dati,
indica un sistema basato sul modello
relazionale (Entity/Relationship), introdotto
da Edgar F. Codd nel 1970, mentre lavorava
per IBM, con l’articolo “A Relational Model of
Data for Large Shared Data Banks”.
Banks”
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
RDBMS
Una nota definizione dei requisiti che un
RDBMS dovrebbe avere, è data dalle
famose 12 regole di Codd.
Codd
•
•
•
•
•
•
•
Regola 0: il sistema deve potersi definire
come relazionale, base di dati e sistema di
gestione. Affinché un sistema possa definirsi
sistema relazionale per la gestione di basi di
dati (RDBMS), tale sistema deve usare le
proprie funzionalità relazionali (e solo quelle)
per gestire la base di dati.
Regola 1: l'informazione deve essere
rappresentata sotto forma di tabelle.
Regola 2: l’accesso ai dati deve essere
garantito tramite la relazione tabella-chiave
primaria e valore della chiave primaria.
Regola 3: il sistema deve supportare i valori
di NULL.
Regola 4: la descrizione del database deve
avvenire ad un livello logico tramite i
metadati.
Regola 5: deve esistere un linguaggio che
permetta la gestione dei dati (come SQL).
SQL
Regola 6: si possono creare delle viste per
vedere una parte dei dati. Queste viste
devono essere aggiornabili.
•
•
•
•
•
•
Regola 7: le operazioni che avvengono su
database devono avvenire anche sulle
tabelle.
Regola 8: i dati memorizzati nel database
devono essere indipendenti dalle strutture di
memorizzazione fisiche
Regola 9: i dati devono essere indipendenti
dalla struttura logica del database per
garantire la crescita naturale e la
manutenzione del database.
Regola 10: le restrizioni sui dati devono
essere memorizzate nel database.
Regola 11: l'accesso ai dati è indipendente
dal tipo di supporto per la lettura o
memorizzazione degli stessi.
Regola 12: l'accesso ai dati non deve
annullare le restrizioni o i vincoli di integrità
del linguaggio principale (SQL).
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Player di Mercato
Prima del 1994, se qualcuno avesse voluto
un RDBMS SQL-based senza pagare uno
sproposito, avrebbe dovuto desistere.
Le soluzioni commerciali dominanti erano
Oracle,
Oracle Sybase e Informix.
Informix
Questi database erano progettati per gestire
“valanghe” di dati, erano potenti e pieni di
funzioni, a scapito delle risorse e del TCO.
TCO
Mediamente le risorse necessarie a questi
motori database erano dell’ordine delle
decine di migliaia di dollari.
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Player di Mercato
.
4th Dimension
Adabas
DB2
Informix
4D s.a.s
Software AG
IBM
IBM
Release
Date
1984
1970
1982
1985
Ingres
Ingres Corp.
1974
CodeGear
Microsoft
1985
1992
Microsoft
1989
Oracle
Oracle Corporation
1979
Oracle Rdb
Oracle Corporation
PostgreSQL Global
Development Group
Sybase
Teradata
1984
Latest Stable
Version
v11 SQL
2006
9
11.0
Ingres 2006 II
9.0.4
2007
12 (2007)
9.00.3042 (2005
SP2)
11g Release 1
(September 2007)
7.2
1989
8.2.5
BSD
1992
1984
10.0
V2R8.2
Proprietary
Proprietary
Product
Maintainer
InterBase
Microsoft Access
Microsoft SQL
Server
PostgreSQL
SQL Anywhere
Teradata
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Software
License
Proprietary
Proprietary
Proprietary
Proprietary
GPL and
proprietary
Proprietary
Proprietary
Proprietary
Proprietary
Proprietary
Un po’ di storia
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
La comparsa di Linux
Nel 1991 appare Linux,
Linux come risposta alle
varie insoddisfazioni che Linus Torvalds,
Torvalds un
giovane programmatore finlandese, trovava
in Minix,
Minix un sistema operativo Unix-like a
microkernel, creato da Andrew Tanenbaum
nel 1987.
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
La comparsa di Linux
.Le principali critiche di Torvalds erano le
seguenti:
•Minix non era free software e neanche
completamente open source;
source
•sebbene portabile, non supportava appieno
la nuova architettura i386 a 32bit.
Queste critiche sfociarono poi in un dibattito
pubblico tra i due sul newsgroup
comp.os.minix, dal titolo Linux is
obsolete.
obsolete
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
La comparsa di Linux
“Don`t
get me wrong, I am not unhappy with LINUX. It will get all the
.
people who want to turn MINIX in BSD UNIX off my back. But in all
honesty, I would suggest that people who want a **MODERN** "free"
OS look around for a microkernel-based, portable OS, like maybe GNU
or something like that.“ - Andrew Tanenbaum
“I also agree that linux takes the non-portability to an extreme: I got my
386 last January, and linux was partly a project to teach me about it.
Many things should have been done more portably if it would have been
a real project. I'm not making overly many excuses about it though: it
was a design decision, and last april when I started the thing, I didn't
think anybody would actually want to use it. I'm happy to report I was
wrong, and as my source is freely available, anybody is free to try to
port it, even though it won't be easy.” - Linus Torvald
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Un po’ di storia
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Un po’ di storia: DB2
DB2 ha una lunga storia ed è considerato in
qualche modo il primo database a fare uso
del linguaggio SQL, anche se il primo a
sfruttare commercialmente le idee di Codd
fu Larry Ellison,
Ellison fondatore di Oracle,
Oracle con
grande “disappunto” da parte di IBM.
La prima versione del prodotto con tale
nome, risale al 1982, su piattaforma
mainframe, successore del System
R(elational) del 1978.
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Un po’ di storia: DB2
Codd aveva anche pensato a un linguaggio
relazionale, chiamato Alpha, per il database
da lui pensato, ma per ragioni di scarsa
lungimiranza il gruppo di sviluppo non fu
posto sotto di lui.
Il risultato di ciò fu che il gruppo produsse un
linguaggio che violava molti dei suoi punti.
punti
Tale linguaggio si chiamò inizialmente
Structured English QUEry Language,
Language
SEQUEL,
SEQUEL nome poi cambiato in SQL per
ragioni di copyright.
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Un po’ di storia: MySQL
MySQL è legato in qualche modo alla tesi di
dottorato di David Hughes, che scelse un
database SQL come strumento per la
raccolta dati del suo monitor di rete,
chiamato Minerva.
All’epoca fu giocoforza scegliere Postgres
come DBMS, il quale supportava una
variante di SQL non standard, denominata
PostQUEL.
PostQUEL Fu così che Hughes scrisse un
modulo che convertisse SQL standard in
linguaggio PostQUEL. Tale prodotto fu
chiamato mSQL (miniSQL).
(miniSQL)
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Un po’ di storia: MySQL
La crescita di Minerva rese insufficiente
Postgres, a causa di limiti tecnologici, ciò
indusse Hughes a rivalutare mSQL,
mSQL
aggiungendogli le funzioni di archiviazione e
di ricerca dei dati, trasformandolo cioè in
vero e proprio DBMS.
Più tardi un altro sviluppatore, Michael
Widenius, pensò di utilizzare mSQL per le sue
applicazioni web, aggiungendo alcune ciò che
all’epoca mSQL non aveva, ad esempio gli
indici. Fu così che nacque MySQL 1.0
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Un po’ di storia: MySQL
Con l'aiuto di Aladdin Peter Deutsch MySQL
diventa "più libero” del predecessore mSQL e
rappresenta il primo database “open” al
mondo. Già dalla prima versione viene
effettuato il porting per i sistemi Unix, Win32
e OS/2, al punto che si contavano circa
500.000 server MySQL.
MySQL
Curiosità: pare sia incerta l’origine del nome,
ma la più attendibile vuole che derivi dal
soprannome della figlia di Widenius, My.
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
A Confronto!
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
A Confronto!
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
A Confronto: edizioni
MySQL
offre due versioni basate su GPL e due
.
licenze commerciali:
2.MySQL Standard (full transactional support
database)
3.MySQL Max (early adopters database with
advanced features)
4.MySQL Pro (commercially licensed version
of MySQL Standard)
5.MySQL Classic (commercially licensed, basic
in-memory database)
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
A Confronto: edizioni
DB2 copre un vasto range di applicazioni o
piattaforme:
2.DB2 Cloudscape (Java-based lightweight embed.)
3.DB2 UDB for LUW
a)DB2 Express Edition (2 CPU, 4GB RAM, for
SMB)
b)DB2 Workgroup Edition (4 CPU, no RAM limit)
c) DB2 Enterprise Server Edition (Highly mission
critical applications & clusters)
d)DB2 Personal Edition (for non commercial use)
4.DB2 z/OS (for IBM zSeries mainframes)
5.DB2 for iSeries (for AS400 platforms)
5.DB2 Everyplace (for mobile and PDA)
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
A Confronto: edizioni
DB2 Express-C is a free version of DB2
Express Edition (DB2 Express) for the
community.
It’s a no-charge data server for use in
development and deployment of applications
including: XML, C/C++, Java, .NET, PHP, and
more.
DB2 Express-C can be run on up to 2 dualcore CPU servers, with up to 4 GB of
memory, any storage system setup and with
no restrictions on database size or any other
artificial restrictions (Linux and Windows).
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
A Confronto: features
Sistemi Operativi Supportati
Windows Mac OS X Linux BSD UNIX
z/OS
DB2
Yes
No
Yes
No
Yes
Yes
MySQL
Yes
Yes
Yes
Yes
Yes
Maybe
Caratteristiche fondamentali
ACID
Referential
Atomicity, Consistency,
Integrity
Isolation, Durability
Transactions Unicode
DB2
Yes
Yes
Yes
Yes
MySQL
Yes*
Yes*
Yes*
Yes*
Note: for transactions and referential integrity, the InnoDB table type must be used; Windows installer
sets this as default if support for transactions is selected, on other operating systems the default table
type is MyISAM. However, even the InnoDB table type permits storage of values that exceed the data
range; some view this as violating the Integrity constraint of ACID.
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
A Confronto: features
Limiti
DB2
MySQL
Max DB
size
Max
table
size
Max
row
size
Max
cols
per
row
Max
LOB size
Max
CHAR
size
Max
NUMBER
size
512TB
512TB
32KB
1012
2GB
32KB
64 bits
Unlimited
2GB
(FAT32)
to 16TB
(Solaris)
3398
4GB
(longtext,
longblob)
64KB
(text)
64 bits
64KB
Tabelle e viste
Temporary
Table
Materialized
View
DB2
Yes
Yes
MySQL
Yes
No*
Note: materialized views can be emulated using stored procedures and triggers.
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
A Confronto: features
Indici
DB2
RR+ tree
Hash
Expr.
Partial
Reverse
Bitmap
GiST
GIN
No
Yes
No
No
Yes
Yes
No
No
No
No
No
No
No
No
MEMORY
MySQL
MyISAM
tables
only
Cluster
(NDB)
InnoDB
tables
only
Proprietà DB
Union
Inner
Joins
Outer
Joins
Inner
Selects
Merge
LOBs
DB2
Yes
Yes
Yes
?
Yes
Yes
MySQL
Yes
Yes
Yes
Yes
Yes
Yes
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
A Confronto: features
Altri Oggetti
Data
Domain
Cursor
Trigger
Function Procedure
External
Routine
DB2
No
Yes
Yes
Yes
Yes
Yes
MySQL
No
Yes
Yes
Yes
Yes
Yes
Partitioning
DB2
MySQL
List
Shadow
Native
Replication
API
Range
Hash
Composite
(Range+Hash)
Yes
Yes
Yes
Yes
?
?
Yes (5.1.6)
Yes
(5.1.6)
?
?
Yes
Yes
(5.1.6) (5.1.6)
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Al Lavoro!
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
A Confronto: setup
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
A Confronto: setup
rpm -i MySQLserver5.0.glibc23.i386.rpm
!!!
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Conclusioni
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Conclusione
“Nel 2006 avete pianificato il passaggio da
database proprietario a Software Libero e/o
Open Source?” In Europa il 40% ha risposto
sì, il 60% in America Latina e il 50% in Asia.
Questi dati, pubblicati da Gartner,
Gartner indicano
un forte cambiamento preannunciato già
negli scorsi anni dai sostenitori del software
libero ed open. L’idea è che le soluzioni
“aperte” crescono inesorabilmente e rubano
fette di mercato alle grandi software house.
Quest' idea, priva di credibilità per anni,
sembra iniziare a spaventare molti.
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Conclusione
.
Research
Publication Date: 2 May 2007
ID Number: G00148562
MySQL Will Open IBM System-i to New
Applications and Customers
Donald Feinberg
MySQL's and IBM's plan for the MySQL
database management system to run on the
System i platform brings hundreds of new
applications to System i and should be
welcome news to small and midsize
businesses.
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Links
•http://it.wikipedia.org/wiki/Edgar_F._Codd
•http://it.wikipedia.org/wiki/12_regole_di_Codd
•http://it.wikipedia.org/wiki/Linux
•http://it.wikipedia.org/wiki/Minix
•http://www-306.ibm.com/software/data/db2/express/download.html
•http://dev.mysql.com/downloads/mysql/5.0.html
•http://en.wikipedia.org/wiki/Comparison_of_relational_database_manageme
nt_systems
•http://www-it.mysql.com/company/legal/licensing/faq.html
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Grazie!
LinuxDays ’07 – Imola 27/10/2007 – Granarolo Faentino 3/11/2007
Scarica