NoSQL Typologie et Panorama
description
Transcript of NoSQL Typologie et Panorama
2
NoSQLTypologie et Panorama
08/02/2011Pierre Couzy – Microsoft
3
Une heure pour couvrir 40 ans…• Qui peut le plus peut le moins ?
• Dire ce qu’on n’est pas, c’est ne pas être ce qu’on dit ?
• Typologie, code et aphorismes
• La minute de l’auvergnat
• Questions-réponses
http://geekandpoke.typepad.com/geekandpoke/2011/01/nosql.html?
4
Pourquoi NoSQL ?
“This growth has forced us into horizontal and vertical partitioning strategies that have eliminated most of the value of a relational database, while still incurring all the overhead.”
• Digg, Mars 2010
w01
Form1
w02 w-n
...
SQLSQL
Form2
Form-n
Form1
Form2
Form-n
Form1
Form2
Form-n
5
Le théorême de CAP ?
http://www.cs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf
Mais je vous recommande également ceci http://dbmsmusings.blogspot.com/2010/04/problems-with-cap-and-yahoos-little.html
6
Au final …
http://en.wikipedia.org/wiki/NoSQL
7
(et entre nous…)
Les bases de données relationnellessont-elles vraiment ACID ?
8
Un peu de code ? • Reprenons les principaux mouvements NoSQL
• Clé-Valeur• Colonne• Document• Graphe
9
Clé-Valeur
10
Orienté colonne
var results = from c in context.InventoryTable where c.PartitionKey == productLine && c.LastUpdateDate >= updatedSince select c;
GET http://<compte>.table.core.windows.net/InventoryTable()?$filter=(PartitionKey%20eq%20'Aliment')%20and%20(LastUpdateDate%20ge%20datetime'2011-01-06T16%3A33%3A31.2217664Z') HTTP/1.1
11
Pas de schéma fixe mais un schéma “flexible” : • Chaque ligne ou entité peut voir sa structure (ses propriétés) varier au sein
d’une même table.Les trois propriétés obligatoires pour chaque entité• PartitionKey – Première Colonne (Performance des requêtes & Montée en charge)• RowKey – Identifie de manière unique l’entité dans la partition• Timestamp - Read Only - Optimistic Concurrency
Un Index par table = Partitionkey + RawkeyLes types supportés par les propriétés des entités sont les suivants:
• String, Binary, Bool, DateTime, GUID, Int, Int64, and Double
Compte deStockage
Stockage
Session 1 Titre Time Sujet
TableEntité(ligne)
Propriété(colonne)
AnnéeSessions
Session 2… Titre Time urlAnnée
Jusque1Mo / Entité
Jusque 252 Propriétés
Partition Key
Row Key
Time Stamp…
12
L’orienté document
13
L’orienté Graphe
14
Quelques architectures
15
Quelques architectures
16
Quelques architectures
Stockage et exécution répartis sur de (nombreux) serveurs
w01
Form1
w02 w-n
...Form2
Form-n
Form1
Form2
Form-n
Form1
Form2
Form-n
Données Form1 Données Form2 Données Form-n
17
Quelques architectures
Données noSql
Données SQLDonnées SQL
Donn
ées n
oSql
Données noSql
Données noSql
18
Combiner ?• Sql Azure et auto-sharding ?
19
Comment choisir ?• Faire une typologie de la donnée
• référence • d’activité• Ressource
• .. Et une typologie de requêtage• Clé de hachage • Index • Map-Reduce • Ad hoc
20
Auto-Complétion en Redis ?
http://antirez.com/post/autocomplete-with-redis.html
21
Pour finir…• The Friends table contains many million rows, while
Diggs holds hundreds of millions. Computing the intersection with a JOIN is much too slow in MySQL, so we have to do it in PHP.
• […] the fully denormalized Cassandra dataset weighs in at 3 terabytes and 76 billion columns
22
MSDN et TechNet : l’essentiel des ressources techniques à portée de clic
http://technet.com http://msdn.com
Portail administration et infrastructure pour informaticiens
Portail de ressources technique pour développeurs
23