Download - Python et NoSQL
![Page 1: Python et NoSQL](https://reader034.vdocuments.pub/reader034/viewer/2022052214/556598c2d8b42a0a768b484f/html5/thumbnails/1.jpg)
Ronan Amicel@amicel
Soirée AFPY – 28 novembre 2011 – La Cantine
http://www.slideshare.net/ronan.amicel/python-et-nosql
Python et NoSQL
![Page 2: Python et NoSQL](https://reader034.vdocuments.pub/reader034/viewer/2022052214/556598c2d8b42a0a768b484f/html5/thumbnails/2.jpg)
Quand on n’aqu’un marteau...
SGBDR Mon besoin
Modèle de données relationnel ?
Requêtage SQL ?
Cohérence forte ?
Persistence oui ?
... ... ...
![Page 3: Python et NoSQL](https://reader034.vdocuments.pub/reader034/viewer/2022052214/556598c2d8b42a0a768b484f/html5/thumbnails/3.jpg)
![Page 4: Python et NoSQL](https://reader034.vdocuments.pub/reader034/viewer/2022052214/556598c2d8b42a0a768b484f/html5/thumbnails/4.jpg)
• Une alternative à une base relationnelle
• Un complément à une base relationnelle
No SQL ?
![Page 5: Python et NoSQL](https://reader034.vdocuments.pub/reader034/viewer/2022052214/556598c2d8b42a0a768b484f/html5/thumbnails/5.jpg)
Modèles de données
• Relationnel : MySQL, PostgreSQL, ...
• Clé-valeur : Berkeley DB, Tokyo Cabinet, leveldb, memcached, membase, Redis...
• Document : CouchDB, MongoDB, Riak...
• Graphe : Neo4J, FlockDB...
• Colonne : BigTable, Cassandra, HBase...
![Page 6: Python et NoSQL](https://reader034.vdocuments.pub/reader034/viewer/2022052214/556598c2d8b42a0a768b484f/html5/thumbnails/6.jpg)
• Stockage de documents (sans schéma)
• Requêtes sur tous les attributs
• Pourquoi ?
– plus facile que SQL !– rapide
![Page 7: Python et NoSQL](https://reader034.vdocuments.pub/reader034/viewer/2022052214/556598c2d8b42a0a768b484f/html5/thumbnails/7.jpg)
• Stockage de documents (sans schéma)
• Requêtes : vues map/reduce en JavaScript
• Pourquoi ?
– flexible– idéal pour applications distribuées
(réplication, cohérence relâchée...)
![Page 8: Python et NoSQL](https://reader034.vdocuments.pub/reader034/viewer/2022052214/556598c2d8b42a0a768b484f/html5/thumbnails/8.jpg)
• Stockage en mémoire (+ persistence)
• Clé-valeur structuré : listes, ensembles...
• Pourquoi ?
– couteau suisse : cache, compteurs, communication inter-processus (queues, pub/sub)...
– très rapide (~75 000 req/s sur mon MBP)
![Page 9: Python et NoSQL](https://reader034.vdocuments.pub/reader034/viewer/2022052214/556598c2d8b42a0a768b484f/html5/thumbnails/9.jpg)
Base de données Accès bas niveau Accès haut niveau
SQL SQLAlchemy (Core) SQLAlchemy (ORM)
MongoDB pymongo mongolite
CouchDB couchdb-python couchdbkit
Redis redis-py redisco
Riak riak-python-client -
Cassandra pycassa tragedy / lazyboy
HBase PyHBase -
Solr pysolr sunburnt
Et en Python ?
![Page 10: Python et NoSQL](https://reader034.vdocuments.pub/reader034/viewer/2022052214/556598c2d8b42a0a768b484f/html5/thumbnails/10.jpg)
Questions ?