Nosql
@fmasanori
http://www.slideshare.net/fmasanori
@fmasanori
• • • • • • • • Graduado IME-USP e Mestrado ITA ed e lint Cobra Tecnologia Software Express Credicard Mastercard PriceWaterhouseCoopers ITAU BankBoston Docente FATEC SJC (amo dar aulas) Interesses: Python, NoSQL, Google Technology, Facebook
Conhecendo os assistentes
• • • • • Python? NoSQL? pymongo? redis-py? pycassa?
Agenda
• LucidDB: my first NoSQL experiment • Flexible Schema • Horizontal Scalability • MongoDB (document) • Redis (key-value) • Cassandra (columnar) • Demo
LucidDB
• 3 years ago • Benchmark LucidDB x MySQL for Business Intelligence applications • LucidDB: columnar NoSQL for BI • Analytic applications:
– Read only – Massive aggregations – Denormalization
Queries
• Which movie genres generate the most revenue? (Q1) • How is our revenue evolving over time? (Q2) • At which time of day do costumers place the most orders? (Q3) • How effective are the promotions we launch? (Q4)
Average time (ms)
35000 30000
25000
20000
LucidDB
15000 MySQL
10000
5000
0 Q1 Q2 Q3 Q4
“Life begins at end of your comfort zone”
Neale Donald Walsch
Slide EuroPython 2012 Python, Flask e MongoDB depois de 20 anos com .NET
“It’s better to think of NoSQL as a movement rather than a technology”
Martin Fowler
NoSQL vale a pena
Job Trends (indeed.com)
Job Trends (indeed.com)
Job Trends (indeed.com)
O que as empresas esperam de um NoSQL?
Dynamic Schema
O que as empresas esperam de um NoSQL?
Flexible Schema
Relational DB
Relational DB
Martin Fowler
Impedance mismatch
• The difference between the relational model and the inmemory data structures (Fowler) • Limitations of relational DB: values only in tuples • We need a more complex structure than a set of tuples as a data unit
Aggregate Model Costumers Orders
Martin Fowler
Aggregate Model
Costumers
Martin Fowler
Scalability
If I had