5. 1r fail - POO - Solucions - ORM
Avantatges
● Funciona amb les BD lliures més
populars.
● Només cal aprendre com definir les
correspondències
● Per sota hi ha una BD de les de tota la
vida.
Inconvenients
● Limitacions en la traducció automàtica de
l'esquema d'objectes a taules.
● Traducció ineficient d'objectes a SQL.
● Mala gestió dels canvis en l'esquema
(NULLs).
Projectes lliures
● Hibernate (Java i C#) - LGPL v2.1
● QxORM (Qt/C++) - GPLv3
● Doctrine (PHP) - MIT
● SQL Alchemy (Python) - MIT
● DataMapper (Ruby) - MIT
6. Primer fail - La POO - Solucions -
OODB
Avantatges
● No hi ha practicament traducció.
(eficiència)
● Persistència transparent. (netedat)
● El codi es l'esquema (lazy evolution)
● Query By Example
● Pot executar-se en servidor o acoblada.
Inconvenients
● Cada OODB esta feta a la seva manera.
● No hi ha un model matemàtic darrere.
● Menys suport de la industria.
Projectes lliures
● db4o (Java i C#) - GPL v3
● Eyedb (Java i C++) - LGPL
● ZODB (Python) - Zope Public License
● PicoLisp (Lisp) - MIT
12. 2n fail - Escenari OLAP
Primera Solució - MOLAP
Avantatges
● Són per rapides que el
ROLAP perquè pre-calculen
les agregacions i
comprimeixen dades.
Inconvenients
● Problemes gestionant moltes
dimensions.
● No hi ha llenguatge estàndard
de consultes. MDX vs SDX
Llicència
● GNU GPLv2
13. 2n fail - Escenari OLAP
Segona solució - Column Stores
Partició
vertical
automàtica
Avantatges
● SQL com a llenguatge
de consultes
● Consultes
dinàmiques i en temps
reals.
Inconvenients
● No té bitmaps
(encara).
● El disc es un coll
d'ampolla
Llicència
● Mozilla Public License
Pipelining
Compressió de
columnes
Disc
14. 2n fail - Escenari OLAP
El factor humà - ETL
Inconvenients
● S'han de descobrir totes
els fonts de dades de la
organització.
○ BDs
○ Fulls de càlcul
■ XLS
■ CSV
■ ...
○ XML
○ ...
● Escriure lectures
● Escriure transformacions
● Escriure al DW
● Projectes llargs i cars
Eines ETL lliures
● Pentaho Kettle - Apache
● Palo ETL Server - GPL
15. Segon fail - Escenari OLAP/OLTP
Fi de l'ETL - In-memory hybrid store
Partició
vertical
híbrida
Minimitza "miss"
a cache
Compressió de
columnes i
bitmaps
In-memory
RS/WS
Hybrid Storage
OpenSource Licence
of the Hasso-Plattner
Institute
16.
17. 3r fail - Explosió de dades
Fonaments - CAP Theorem
18. 3r fail - Explosió de dades
Fonaments - BASE
Basically
Available Soft-state
Eventually -
consistent
És el contrari d'ACID:
● Availability
● Consistency
● Isolation
● Durability
- Consistència
+ Disponibilitat
Es podria construir
una BD que triés
entre CP o AP
segons la situació
(Yahoo PNUTS)
19. Tercer fail - Explosió de dades
Solucions - Key Value (CP) - Hadoop
Distributed B+ tree
Avantatges
● Suporta petabytes
de dades
Inconvenients
● No accepta SQL
● Temps llarg
d'inicialització
● Els B+ són molt
costosos de
distribuir
Llicència
● Apache License
20. Tercer fail - Explosió de dades
Solucions - Key Value (AP) -
Cassandra
Consistent hashing
Avantatges
● Menys costós
de distribuir
Inconvenients
● Obliga a una
topologia de
xarxa en anell
Llicència
● Apache
License
21. 3r fail - Explosió de dades
Llenguatges - Map-Reduce
És la API de consulta per Key-Value Stores.
Una consulta es realitza a partir de 2 funcions
que s'han de programar:
● La funció de Map (obté valors interessants)
○ S'executa per cada element de la store i genera un
key-value a partir de cada key-value.
● La funció de Reduce (els sumaritza)
○ S'executa a partir de al sortida del Map i genera un
nou key-value per cada key-value que entra.
L'execució d'aquestes funcions es reparteix en
Mappers i Reducers.
22. 3r fail - Explosió de dades
Llenguatges - Consulta, anàlisi i aprenentatge
Hive Pig R Mahout
Avantatges Tradueix HiveQL a
Map-Reduce.
El llenguatge
HiveQL és similar
a SQL.
Defineix un fluxe
de dades i
transformacions.
Llenguatge
estadístic popular.
Biblioteca
d'algorismes
d'aprenentatge
automàtic
distribuits.
Inconveninets No és utils quan
s'han de fer moltes
transformacions
sobre els dades.
L'optimitzador no
sempre dona els
plans òptims.
Llenguatge poc
familiar.
Diverses
integracions amb
Hadoop possibles.
Massa aparatós si
no fa falta
estadística.
Només útil en
programes que
han d'aprendre.
Agents intel·ligents
deliberatius,
Llicència Apache License Apache License GPL Apache License
23. 3r fail - Explosió de dades
- Document Stores
- Key + semi-structured value (tree)
Indexos en
arbre
multiatribut
Serveis
RESTful
Memory
mapped files
Ús de
llenguatges web
Avantatges
● Infraestructura barata.
● Els valors no ocupen tant com en un
SGBDR.
● Llenguatges de consulta i dades familiar.
Inconvenients
● Per ser eficient s'ha de des-normalitzar.
● Fragmentació per canvi de mida.
● Funciona millor en esquema d'agregats.
MongoDB CouchDB eXist
Consulta Javascript
API
Javascri
pt Map
Reduce
XQuery
Dades BSON JSON XML
Extres RESTful,
Javascript
procedures
Master to
master
replication
Plugins
Llicència Apache Apache LGPL
24. 4t fail - "Database hugging" -
- Graph Databases and Open Data
Connectada
amb altres BD
Moltes eines
de creació,
adminstració i
explotació
Basat en la
teoria de grafs
Base de dades
semàntica
Avantatges
● Expressen les relacions millor que cap
altre tipus de BD
● Eviten hi ha joins sinó enllaços directes.
● Molt eficient per trobar elements
relacionats a partir d'un inicial.
Inconvenients
● Molt ineficient quan es fa cerca sobre un
valor d'un atribut que no esta com a node.
● Poc (però més) escalable.
● Projectes lliures
○ Bases de dades en graf:
■ Neo4j (RESTful i més) - GPL
■ Virtuoso Open-Source - GPL
○ Creació de portals
■ Linked Media Framework - Apache
○ Refinar dades
■ Open refine - BSD
○ Visualitzar dades
■ R - GPL
■ Processing - GPL
■ Gephi - CDDL o GPL
25. 5è fail - Posant-ho tot junt
- Persistència poliglota
26. Algunes persones que han influït en
aquesta presentació
Bio
"I am an author, speaker… essentially a
loud-mouthed pundit on the topic of
software development. I’ve been working in
the software industry since the mid-80’s
where I got into the then-new world of
object-oriented software. I spent much of
the 90’s as a consultant and trainer helping
people develop object-oriented systems,
with a focus on enterprise applications. In
2000 I joined ThoughtWorks."
Conceptes
● Domain Layer Patterns
● Polyglot persistence
○ First Scott Leberking
Llibres
● Paterns of Enterprise Application
Architecture
● NoSQL Distilled
Web http://martinfowler.com
Martin Fowler
27. Algunes persones que han influït en
aquesta presentació
Bio
"Herb Sutter is a leading authority on
software development. Herb is a consultant
and trainer, has served for a decade as
chair of the ISO C++ standards committee,
and is a software architect at Microsoft
where he has been the lead designer of
C++/CLI, C++/CX, C++ AMP, and other
technologies."
Publicacions
● The free lunch is over http://www.
gotw.ca/publications/concurrency-ddj.
htm
Web
● http://herbsutter.com
Herb Sutter
28. Algunes persones que han influït en
aquesta presentació
Hasso Plattner
Bio
"Prof. Dr. h.c. mult. Hasso C. Plattner is a
Co-founder of SAP AG. He had been
responsible for SAPs strategy and business
development, product and technology
strategy as well as for marketing and global
communications."
Conceptes
● In-memory databases
● HYRISE
Llibres
● In-memory Data Management
Web
● hhttp://dschool.stanford.
edu/bio/hasso-plattner/
29. Algunes persones que han influït en
aquesta presentació
Michael Stonebraker
Bio
"Michael Stonebraker has been a pioneer of
data base research and technology for more
than 25 years. He was the main architect of
the object-relational DBMS, POSTGRES,
developed at the University of California at
Berkeley where Stonebraker was professor.
He is the founder of three successful
startups, whose objective was to
commercialize POSTGRES and other
prototypes."
Publicacions i projectes
● The End of an Architechtural Era
○ With Daniel Abadi et. al.
● VoltDB
Web
● http://www.csail.mit.edu/user/1547
30. Algunes persones que han influït en
aquesta presentació
Eric Brewer
Bio
"Dr. Brewer focuses on all aspects of
Internet-based systems, including
technology, strategy, and government. As a
researcher, he has led projects on scalable
servers, search engines, network
infrastructure, sensor networks, and
security. His current focus is (high)
technology for developing regions, with
projects in India, Ghana, and Uganda
among others, and including
communications, health care, education,
and e-government. "
Conceptes
● CAP Theorem
● BASE
Publicacions
● CAP Twelve Years Later: How the
"Rules" Have Changed
Web
● http://www.cs.berkeley.edu/~brewer/
31. Algunes persones que han influït en
aquesta presentació
Tim Berners-Lee
Bio
"A graduate of Oxford University, Tim
Berners-Lee invented the World Wide Web,
an internet-based hypermedia initiative for
global information sharing while at CERN,
the European Particle Physics Laboratory,
in 1989. He wrote the first web client and
server in 1990. His specifications of URIs,
HTTP and HTML were refined as Web
technology spread."
Conceptes
● Open Data
● Linked Data
Web
● http://www.w3.org/People/Berners-
Lee/
32. Algunes persones que han influït en
aquesta presentació
Oscar Romero
Bio
"My main interests are databases, data integration
and business intelligence. My PhD thesis focused
on data warehousing but since then, I have been
working on many other topics such as NOSQL (and
any technology beyond relational databases), open
data platforms (mostly at the database level),
recommendation systems and semantic-aware
systems (based or exploiting semantic formalisms
such as ontology languages or RDF)."
Idees
● Estructura de la presentació
● DIY databases
Assignatures
● Diseeny de Bases de Dades
● Conceptes de Bases de Dades
Especialitzades
Web
● http://www.essi.upc.edu/~oromero/
34. Agraïments
Per l'espai i per la formació rebuda
Per la organització
Per ser-hi quan els necessites
Per la difusió de la xerrada
35. Altres fonts
● Anna Queralt - BSC - Introduction to Object Databases
● Seminar on MongoDB - Telefónica R&D - Pablo Enfedaque,
● Josep Jordana - Catalunya Dades Obertes - Seminar on Open
Data and Linked Data
● Cristina Gómez - FIB - ESSI - Contingut de l'assignatura AS
● Jorge Fernàndez - FIB - ESSI - Contingut de l'assignatura CSI
● Oscar Romero - FIB - ESSI - Contingut de l'assignatura CBDE
● Infography. "Every Minute of the Day"