introducción a nosql y mongodb webinar
DESCRIPTION
El segmento de la base de datos está evolucionando, al mismo tiempo que vemos como nuevos, almacenes escalables de datos emergen. Key value stores, grandes columnas de almacenamiento y bases de datos orientados en documentos, ofrecen una alternativa atractiva a la base de datos relacional tradicional. Evitando las suposiciones tradicionales sobre los cuales se construyeron las bases de datos anteriores, esta nueva clase de soluciones de no-relacionales o "NoSQL" adquieren la capacidad de escalar horizontalmente. Además, las soluciones NoSQL ofrecen alternativas interesantes al modelo tradicional de datos relacional. Esta presentación mostrara a los asistentes, los conceptos claves y necesarios para comprender y evaluar los almacenes de datos NoSQL. Vamos a explorar las diferencias fundamentales que existen entre las diversas clases de soluciones NoSQL y que concluyen con un examen en profundidad, de la base de datos MongoDB orientada a documentos. Esta presentación incluirá: Orígenes del movimiento NoSQL Una visión general del segmento de NoSQL La filosofía y la creación de MongoDB MongoDB, arquitectura del sistema MongoDB, ejemplos de usoTRANSCRIPT
![Page 1: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/1.jpg)
1
Introducción al NoSQL y MongoDB
13 de septiembre, 2012
Robert Stam
![Page 2: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/2.jpg)
2
• 1970's Aparecen las bases de datos relacionales– El almacenamiento es costoso– Los datos se normalizan– El almacenamiento es abstraído de la
aplicación
Un poco de historia
![Page 3: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/3.jpg)
3
• 1970's Aparecen las bases de datos relacionales– El almacenamiento es caro– Los datos se normalizan– El almacenamiento es abstraído de la
aplicación
• 1980's Aparecen versiones comerciales de las RDBMS– Modelo cliente/servidor– SQL emerge como estándar
Un poco de historia
![Page 4: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/4.jpg)
4
• 1970's Aparecen las bases de datos relacionales– El almacenamiento es caro– Los datos se normalizan– El almacenamiento es abstraído de la
aplicación
• 1980's Aparecen versiones comerciales de las RDBMS– Modelo cliente/servidor– SQL emerge como estándar
• 1990's Las cosas empiezan a cambiar– Cliente/servidor => arquitectura 3-niveles– Aparecen el internet y la web
Un poco de historia
![Page 5: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/5.jpg)
5
• 2000's Web 2.0– Aparece "Social Media"– Aceptación de E-Commerce– Continuan bajando precios de HW– Incremento masivo de datos coleccionados
Un poco de historia
![Page 6: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/6.jpg)
6
• 2000's Web 2.0– Aparece "Social Media"– Aceptación de E-Commerce– Continuan bajando precios de HW– Increment masivo de datos coleccionados
• Resultado– Requerimiento continuo para escalar dramáticamente– ¿Cómo podemos escalar?
Un poco de historia
![Page 7: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/7.jpg)
7
OLTP / operational
BI / reporting
Bases de datos entre 2000 - 2010
+ transacciones complejas+ datos tabulares+ consultas ad hoc- O<->R mapeo es difícil- problemas de velocidad y escalabilidad- no es muy ágil
![Page 8: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/8.jpg)
8
OLTP / operational
BI / reporting
Bases de datos entre 2000 - 2010
+ transacciones complejas+ datos tabulares+ consultas ad hoc- O<->R mapeo es difícil- problemas de velocidad y escalabilidad- no es muy ágil
+ consultas ad hoc+ SQL como protocolo estándar entre clientes y servidores+ crece horizontalmente mejor que las bases de datos operacionales- algunos limites de escalabilidad - esquemas rígidos- no es en tiempo real, pero funciona bien con cargas masivas en horas de la madrugada
![Page 9: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/9.jpg)
9
OLTP / operational
BI / reporting
Bases de datos entre 2000 - 2010
+ transacciones complejas+ datos tabulares+ consultas ad hoc- O<->R mapeo es difícil- problemas de velocidad y escalabilidad- no es muy ágil
+ consultas ad hoc+ SQL como protocolo estándar entre clientes y servidores+ crece horizontalmente mejor que las bases de datos operacionales- algunos limites de escalabilidad - esquemas rígidos- no es tiempo real, pero funciona bien con cargas masivas en horas de la madrugada
Menos problemas aquí
![Page 10: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/10.jpg)
10
OLTP / operational
BI / reporting
Bases de datos entre 2000 - 2010
+ transacciones complejas+ datos tabulares+ consultas ad hoc- O<->R mapeo es difícil- problemas de velocidad y escalabilidad- no es muy ágil
+ consultas ad hoc+ SQL como protocolo estándar entre clientes y servidores+ crece horizontalmente mejor que las bases de datos operacionales- algunos limites de escalabilidad - esquemas rígidos- no es tiempo real, pero funciona bien con cargas masivas en horas de la madrugada
Menos problemas aquí Más problemas aquí
![Page 11: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/11.jpg)
11
OLTP / operational
BI / reporting
cacheo
Archivos
planos
Particionamiento al nivel de la aplicación
Bases de datos entre 2000 - 2010
+ transacciones complejas+ datos tabulares+ consultas ad hoc- O<->R mapeo es difícil- problemas de velocidad y escalabilidad- no es muy ágil
+ consultas ad hoc+ SQL como protocolo estándar entre clientes y servidores+ crece horizontalmente mejor que las bases de datos operacionales- algunos limites de escalabilidad - esquemas rígidos- no es tiempo real, pero funciona bien con cargas masivas en horas de la madrugada
![Page 12: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/12.jpg)
12
• Metodología de desarrollo ágil• Ciclos de desarrollo cortos• Constante evolución de
requerimientos• Flexibilidad de diseño
Desarrollo de software
![Page 13: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/13.jpg)
13
• Metodología de desarrollo ágil• Ciclos de desarrollo cortos• Constante evolución de
requerimientos• Flexibilidad de diseño
• Esquema relacional• Difícil de evolucionar
• Migraciones lentas y difíciles• En sincronía con la aplicación
• Pocos desarrolladores interactúan directamente con la base de datos
Desarrollo de software
![Page 14: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/14.jpg)
14
Soluciones parciales
![Page 15: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/15.jpg)
15
Soluciones parciales
![Page 16: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/16.jpg)
16
Necesidades reales
• Escalabilidad horizontal• Más resultados en tiempo real• Desarrollo más veloz• Modelo de datos flexible• Bajo costo inicial• Bajo costo de operación
![Page 17: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/17.jpg)
17
Relacional vs
No-relacional
¿Qué es NoSQL?
![Page 18: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/18.jpg)
18
Bases de datos en el 2012
Escalableno-
relacional (“nosql”)
OLTP / operational
BI / reporting
+ velocidad y escalabilidad- consultas ad hoc limitadas- no son muy transaccionales- no usan SQL/no hay estándares+ se acoplan bien al model OO+ ágiles
![Page 19: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/19.jpg)
19
¿Qué es NoSQL?
La próxima generación de bases de datos no-relacionales
Una colección de productos muy diferentes• Diferentes modelos de datos (no-relacionales)• La mayoría no usan SQL para las consultas• No requieren un esquema predefinido• Algunos permiten estructuras de datos
flexibles
![Page 20: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/20.jpg)
20
• Relacional • Key-Value• Documentos• XML• Grafos• Columnas
Relacional vs NoSQL
![Page 21: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/21.jpg)
21
• Relacional
• ACID• (atomicity, consistency,
isolation, durability)
• Key-Value• Documentos• XML• Grafos• Columnas
• BASE• (basically available, soft
state, eventual consistency)
Relacional vs NoSQL
![Page 22: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/22.jpg)
22
• Relacional
• ACID
• Confirmación en 2 fases (two-phase commit)
• Key-Value• Documentos• XML• Grafos• Columnas
• BASE
• Transacciones atómicas al nivel de documentos
Relacional vs NoSQL
![Page 23: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/23.jpg)
23
• Relacional
• ACID
• Confirmación en 2 fases (two-phase commit)
• Uniones (joins)
• Key-Value• Documentos• XML• Grafos• Columnas
• BASE
• Transacciones atómicas al nivel de documentos
• No hay uniones (joins)
Relacional vs NoSQL
![Page 24: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/24.jpg)
24
Productos principales NoSQL
![Page 25: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/25.jpg)
25
• Cantidad de transacciones
• Confiabilidad• Mantenimiento• Facilidad de uso• Escalabilidad• Costo
Factores determinantes
![Page 26: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/26.jpg)
26
MongoDB: Introducción
![Page 27: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/27.jpg)
27
Breve historia de MongoDB
• Diseñado y desarrollado por los fundadores de DoubleClick, ShopWiki, GILT Groupe, etc…
• Programación empieza a fines del 2007
• Primer sitio en producción: marzo 2008 businessinsider.com
• Código abierto – AGPL, escrito en C++
• Versión 0.8 – primera versión oficial febrero 2009
• Versión 1.0 – agosto 2009
• Versión 2.0 – septiembre 2011
• Versión 2.2 – agosto 2012
![Page 28: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/28.jpg)
28
MongoDBObjetivos de diseño
![Page 29: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/29.jpg)
29
MongoDB: NoSQL, alto rendimiento, escalable
![Page 30: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/30.jpg)
30
• Orientado a documentos• Basado en documentos JSON• Esquema flexible
• Arquitectura escalable• Auto-sharding• Replicación y alta disponibilidad
• Características importantes• Índices secundarios• Lenguaje de consulta (consultas ad hoc)• Map/Reduce (agregación)
MongoDB: NoSQL, alto rendimiento, escalable
![Page 31: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/31.jpg)
31
Documentos JSON• Modelo de datos poderoso y flexible• Conversión transparente de objetos en la aplicación (OO) a documentos JSON• Flexibilidad para datos dinámicos• Mejor localidad de datos
![Page 32: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/32.jpg)
32
Ejemplo de esquema relacional
![Page 33: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/33.jpg)
33
{ _id : ObjectId("4e2e3f92268cdda473b628f6"),title : “Too Big to Fail”,when : Date(“2011-07-26”),author : “joe”,text : “blah”
}
Ejemplo de documento JSON
![Page 34: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/34.jpg)
34
{ _id : ObjectId("4e2e3f92268cdda473b628f6"),title : “Too Big to Fail”,when : Date(“2011-07-26”),author : “joe”,text : “blah”,tags : [“business”, “news”, “north america”]
}
> db.posts.find( { tags : “news” } )
Ejemplo de documento JSON
![Page 35: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/35.jpg)
35
{ _id : ObjectId("4e2e3f92268cdda473b628f6"),title : “Too Big to Fail”,when : Date(“2011-07-26”),author : “joe”,text : “blah”,tags : [“business”, “news”, “north america”],votes : 3,voters : [“dmerr”, “sj”, “jane” ]
}
Ejemplo de documento JSON
![Page 36: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/36.jpg)
36
{ _id : ObjectId("4e2e3f92268cdda473b628f6"),title : “Too Big to Fail”,when : Date(“2011-07-26”),author : “joe”,text : “blah”,tags : [“business”, “news”, “north america”],votes : 3,voters : [“dmerr”, “sj”, “jane” ],comments : [
{ by : “tim157”, text : “great story” },{ by : “gora”, text : “i don’t think so” },{ by : “dmerr”, text : “also check out...” }
]}
Ejemplo de documento JSON
![Page 37: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/37.jpg)
37
{ _id : ObjectId("4e2e3f92268cdda473b628f6"),title : “Too Big to Fail”,when : Date(“2011-07-26”),author : “joe”,text : “blah”,tags : [“business”, “news”, “north america”],votes : 3,voters : [“dmerr”, “sj”, “jane” ],comments : [
{ by : “tim157”, text : “great story” },{ by : “gora”, text : “i don’t think so” },{ by : “dmerr”, text : “also check out...” }
]}
> db.posts.find( { “comments.by” : “gora” } )> db.posts.ensureIndex( { “comments.by” : 1 } )
Ejemplo de documento JSON
![Page 38: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/38.jpg)
38
Tiempo de búsqueda en disco y velocidad de lectura
Búsqueda = 5+ ms Lectura = súper rápido
Post
Author Comment
![Page 39: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/39.jpg)
39
Post
Author
CommentCommentCommentCommentComment
Tiempo de búsqueda en disco y velocidad de lectura
![Page 40: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/40.jpg)
40
MongoDB es una base de datos de propósito general
• Índices secundarios• Consultas dinámicas• Orden de los resultados (sort)• Operaciones poderosas: update, upsert• Funciones para agregaciones• Viable como almacenamiento primario
![Page 41: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/41.jpg)
41
Escalabilidad
• Escalabilidad lineal• Alta disponibilidad• Incrementar capacidad sin sacar la
aplicación de servicio• Transparente a la aplicación
![Page 42: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/42.jpg)
42
Alta disponibilidad
Conjunto de réplicas (replica sets)• Alta disponibilidad/transferencia automática• Redundancia de los datos• Recuperación en caso de desastre• Transparente a la aplicación• Posibilidad de mantenimiento sin sacar la
aplicación de servicio
![Page 43: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/43.jpg)
43
Replica Sets
AsynchronousReplication
![Page 44: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/44.jpg)
44
Replica Sets
AsynchronousReplication
![Page 45: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/45.jpg)
45
Replica Sets
AsynchronousReplication
![Page 46: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/46.jpg)
46
Replica Sets
![Page 47: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/47.jpg)
47
Replica Sets
Elección automática
![Page 48: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/48.jpg)
48
Replica Sets
![Page 49: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/49.jpg)
49
Escalabilidad lineal• Incrementar capacidad sin sacar la aplicación de servicio• Transparente a la aplicación
![Page 50: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/50.jpg)
50
Escalabilidad lineal• Incrementar capacidad sin sacar la aplicación de servicio• Transparente a la aplicación• Particiones basados en rangos de valores• Particionamiento y balanceo automático
![Page 51: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/51.jpg)
51
Sharding
mongod
Escalabilidad para escribir
Key Range0..100
![Page 52: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/52.jpg)
52
Sharding
Escalabilidad para escribir
mongod mongod
Key Range0..50
Key Range51..100
![Page 53: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/53.jpg)
53
Sharding
mongod mongodmongod mongod
Key Range0..25
Key Range26..50
Key Range51..75
Key Range76.. 100
Escalabilidad para escribir
![Page 54: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/54.jpg)
54
Primary
Secondary
Secondary
Primary
Secondary
Secondary
Primary
Secondary
Secondary
Primary
Secondary
Secondary
Key Range0..25
Key Range26..50
Key Range51..75
Key Range76.. 100
Sharding
![Page 55: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/55.jpg)
55
Primary
Secondary
Secondary
Primary
Secondary
Secondary
Primary
Secondary
Secondary
Primary
Secondary
Secondary
Key Range0..25
Key Range26..50
Key Range51..75
Key Range76.. 100
MongoS
Aplicación
![Page 56: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/56.jpg)
56
Primary
Secondary
Secondary
Primary
Secondary
Secondary
Primary
Secondary
Secondary
Primary
Secondary
Secondary
Key Range0..25
Key Range26..50
Key Range51..75
Key Range76.. 100
MongoS MongoS MongoS
Aplicación
![Page 57: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/57.jpg)
57
Primary
Secondary
Secondary
Primary
Secondary
Secondary
Primary
Secondary
Secondary
Primary
Secondary
Secondary
Key Range0..25
Key Range26..50
Key Range51..75
Key Range76.. 100
MongoS MongoS MongoS
Config
Config
Config
Aplicación
![Page 58: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/58.jpg)
58
MongoDB es fácil de administrar• Pocas opciones para configurar• La configuración estándar funciona bien• Fácil de instalar y administrar
![Page 59: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/59.jpg)
59
MongoDB es fácil de usar
MySQLSTART TRANSACTION;INSERT INTO contacts VALUES (NULL, ‘joeblow’);INSERT INTO contact_emails VALUES ( NULL, ”[email protected]”, LAST_INSERT_ID() ), ( NULL, “[email protected]”, LAST_INSERT_ID() );COMMIT;
MongoDBdb.contacts.save( { userName: “joeblow”, emailAddresses: [ “[email protected]”, “[email protected]” ] } );
![Page 60: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/60.jpg)
60
MongoDB es fácil de usar
MySQLSTART TRANSACTION;INSERT INTO contacts VALUES (NULL, ‘joeblow’);INSERT INTO contact_emails VALUES ( NULL, ”[email protected]”, LAST_INSERT_ID() ), ( NULL, “[email protected]”, LAST_INSERT_ID() );COMMIT;
MongoDBdb.contacts.save( { userName: “joeblow”, emailAddresses: [ “[email protected]”, “[email protected]” ] } );
• Existen interfaces (drivers) para docenas de lenguajes de programación
• Una relación natural entre objetos (OO) y documentos
![Page 61: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/61.jpg)
61
MongoDB ejemplos de uso
![Page 62: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/62.jpg)
62
MongoDB puede ser usado para muchas aplicaciones
Manejo de datos de usuarios Procesamiento de datos de alto volúmen
Manejo de contenido Inteligencia de operaciones E-Commerce
![Page 63: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/63.jpg)
63
Analyze a staggering amount of data for a system build on continuous stream of high-quality text pulled from online sources
Adding too much data too quickly resulted in outages; tables locked for tens of seconds during inserts
Initially launched entirely on MySQL but quickly hit performance road blocks
Problem
Life with MongoDB has been good for Wordnik. Our code is faster, more flexible and dramatically smaller. Since we don’t spend time worrying about the database, we can spend more time writing code for our application. -Tony Tam, Vice President of Engineering and Technical Co-founder
Migrated 5 billion records in a single day with zero downtime
MongoDB powers every website request: 20m API calls per day
Ability to eliminate memcached layer, creating a simplified system that required fewer resources and was less prone to error.
Why MongoDB Reduced code by 75%
compared to MySQL Fetch time cut from 400ms to
60ms Sustained insert speed of 8k
words per second, with frequent bursts of up to 50k per second
Significant cost savings and 15% reduction in servers
Impact
Wordnik uses MongoDB as the foundation for its “live” dictionary that stores its entire text corpus – 3.5T of data in 20 billion records
![Page 64: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/64.jpg)
64
Intuit hosts more than 500,000 websites
wanted to collect and analyze data to recommend conversion and lead generation improvements to customers.
With 10 years worth of user data, it took several days to process the information using a relational database.
Problem
MongoDB's querying and Map/Reduce functionality could server as a simpler, higher-performance solution than a complex Hadoop implementation.
The strength of the MongoDB community.
Why MongoDB In one week Intuit was able to
become proficient in MongoDB development
Developed application features more quickly for MongoDB than for relational databases
MongoDB was 2.5 times faster than MySQL
Impact
Intuit relies on a MongoDB-powered real-time analytics tool for small businesses to derive interesting and actionable patterns from their customers’ website traffic
We did a prototype for one week, and within one week we had made big progress. Very big progress. It was so amazing that we decided, “Let’s go with this.” -Nirmala Ranganathan, Intuit
![Page 65: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/65.jpg)
65
Managing 20TB of data (six billion images for millions of customers) partitioning by function.
Home-grown key value store on top of their Oracle database offered sub-par performance
Codebase for this hybrid store became hard to manage
High licensing, HW costs
Problem
JSON-based data structure Provided Shutterfly with an
agile, high performance, scalable solution at a low cost.
Works seamlessly with Shutterfly’s services-based architecture
Why MongoDB 500% cost reduction and 900%
performance improvement compared to previous Oracle implementation
Accelerated time-to-market for nearly a dozen projects on MongoDB
Improved Performance by reducing average latency for inserts from 400ms to 2ms.
Impact
Shutterfly uses MongoDB to safeguard more than six billion images for millions of customers in the form of photos and videos, and turn everyday pictures into keepsakes
The “really killer reason” for using MongoDB is its rich JSON-based data structure, which offers Shutterfly an agile approach to develop software. With MongoDB, the Shutterfly team can quickly develop and deploy new applications, especially Web 2.0 and social features. -Kenny Gorman, Director of Data Services
![Page 66: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/66.jpg)
66
Miles de organizaciones están usando MongoDB
![Page 67: Introducción a NoSQL y MongoDB Webinar](https://reader036.vdocuments.net/reader036/viewer/2022081413/5474fa03b4af9fbe0a8b59db/html5/thumbnails/67.jpg)
67
Una base de datos de código abierto y de alto rendimiento