MongoDB,	
  RabbitMQ	
  y	
  	
  
 aplicaciones	
  en	
  nube	
  
           Gustavo	
  Arjones	
  
 garjones@socialmetrix.com	
  |	
  @arjones	
  
Arquitectura	
  orientada	
  a	
  msjs	
  
h8p://railsdog.com/blog/2009/12/generaAng-­‐pdfs-­‐on-­‐ec2-­‐with-­‐ruby/	
  
MongoDB, RabbitMQ y Applicaciones en Nube
RabbitMQ	
  
•    Message	
  Queue	
  (AMQP	
  compliance)	
  
•    Arquitectura	
  orientada	
  a	
  mensajes	
  
•    Desacoplado,	
  Aislado	
  
•    Facil	
  escalabilidad	
  horizontal	
  



•  “AlternaAva”:	
  Kestrel	
  /	
  Twi8er	
  (NO	
  AMQP!)	
  
MongoDB, RabbitMQ y Applicaciones en Nube
Direct	
  Message	
  
Matching	
  exact	
  key	
  




        Cerveza	
  




                               Cerveza	
  
                                   Cerveza	
     Vino	
  
Fanout	
  Exchange	
  
Copy	
  to	
  all	
  




            Cerveza	
  




                          Cerveza	
         Cerveza	
  
                               Bebida	
       Bebida	
  
Topic	
  Exchange	
  
Route	
  by	
  Key	
  with	
  Key	
  Globbing	
  




       Bebida.Vino	
  



                      Bebida.Vino	
                                 Bebida.Vino	
  

                                      Bebida.#	
     Comida.*	
     #.Vino	
  
Nanite	
  
•  Nanite	
  is	
  a	
  new	
  way	
  of	
  thinking	
  about	
  building	
  
   cloud	
  ready	
  web	
  applicaAons.	
  Having	
  a	
  
   scalable	
  message	
  queueing	
  back-­‐end	
  with	
  all	
  
   the	
  discovery	
  and	
  dynamic	
  load	
  based	
  
   dispatch	
  that	
  Nanite	
  has	
  is	
  a	
  very	
  scalable	
  way	
  
   to	
  construct	
  web	
  applicaAon	
  back-­‐ends.	
  	
  
MongoDB, RabbitMQ y Applicaciones en Nube
MongoDB	
  es	
  …	
  
•  DB	
  Orientado	
  a	
  documentos	
  (schemaless)	
  
•  “Facil”	
  escalar	
  horizontal	
  (shard)	
  
•  Para	
  mantener	
  estructuras	
  complejas	
  
   (jerarquicas)	
  
•  Para	
  estadísAcas	
  “simples”	
  
•  Para	
  mantener	
  archivos	
  (GridFS)	
  
MongoDB	
  NO	
  es	
  …	
  
•  Para	
  transaciones	
  
•  Para	
  OLAP	
  
•  RDBMS	
  (AcAveRecord?)	
  
Select	
  
SELECT	
  first_name,	
  last_name	
  	
  
FROM	
  authors	
  
WHERE	
  zipcode	
  =	
  1234	
  
ORDER	
  BY	
  last_name	
  DESC	
  
LIMIT	
  2,	
  1;	
  

>	
  db.authors.find({"zipcode"	
  :	
  1234},	
  	
  
     	
  {"first_name"	
  :	
  1,	
  "last_name"	
  :	
  1	
  }).sort({"last_name"	
  :	
  -­‐1	
  })	
  
     	
  .skip(2).limit(1);	
  
Select	
  
SELECT	
  *	
  
FROM	
  authors	
  
WHERE	
  dob	
  BETWEEN	
  ‘1970-­‐1-­‐1’	
  AND	
  ‘1990-­‐1-­‐1’	
  
AND	
  address	
  IS	
  NULL;	
  

>	
  db.authors.find({"dbo"	
  :	
  {	
  $gte	
  :	
  new	
  Date(“1970-­‐1-­‐1”),	
  $lte	
  :	
  
      new	
  Date(“1990-­‐1-­‐1”)},	
  “address”	
  :	
  {	
  $exists	
  :	
  false	
  }	
  }	
  );	
  
Upsert	
  (Update	
  +	
  Insert)	
  

>	
  db.tweets.update(	
  query,	
  modify,	
  upsert?,	
  mul2ple?	
  );	
  

>	
  db.setup.update({},	
  {	
  $set	
  :	
  {	
  "in_progress"	
  :	
  false	
  }	
  },	
  false,	
  
      true);	
  

>	
  db.setup.update({},	
  {	
  "opAons.last_status"	
  :	
  -­‐1},	
  false,	
  true);	
  
Indexes	
  
>	
  db.	
  tweets.ensureIndex(	
  
     	
  {"user.Ame_zone"	
  :	
  1},	
  {background:true});	
  

>	
  db.tweets.ensureIndex(	
  
     	
  {"created_at"	
  :	
  1,	
  "user.Ame_zone"	
  :	
  1,	
  "tokens"	
  :	
  1},	
  
         	
  {background:true});	
  

background:true	
  	
  no	
  lock	
  para	
  crear	
  indices	
  

>	
  db.tweets.getIndexes()	
  
Prós	
                         Contras	
  
•  Schemaless	
                •  Map-­‐Reduce	
  MUY	
  lento	
  
•  Rápida	
  instalación	
     •  Sharding	
  es	
  BETA	
  
•  Muchos	
  Drivers	
         •  Nuevo	
  set	
  de	
  
   disponibles	
                  commandos	
  
Tips	
  
•    Pensar	
  BIEN	
  el	
  schema	
  antes	
  de	
  empezar	
  
•    Guardar	
  calculaAon	
  
•    Evitar	
  map-­‐reduce	
  (unAl	
  r.	
  1.8)	
  
•    Indexes	
  TIENEN	
  que	
  entrar	
  en	
  RAM	
  
      >	
  db.	
  tweets.totalIndexSize();	
  
      1187423168	
  (~1.1Gb)	
  

      >	
  db.	
  tweets.storageSize();	
  
      16670199040	
  (~15.5	
  Gb)	
  
Referencias	
  
•  h8p://www.rabbitmq.com/	
  
•  h8p://www.mongodb.org/	
  
•  h8p://github.com/ezmobius/nanite	
  
•  h8p://github.com/robey/kestrel	
  
•  h8p://www.slideshare.net/somic/introducAon-­‐
   to-­‐amqp-­‐messaging-­‐with-­‐rabbitmq	
  
•  h8p://www.slideshare.net/ma8ma8/rabbitmq-­‐
   and-­‐nanite	
  
Muchas	
  gracias	
  

          Gustavo	
  Arjones	
  
garjones@socialmetrix.com	
  |	
  @arjones	
  

More Related Content

PDF
StripeEu Twistedbytes Presentation
PDF
MyRocks in MariaDB
PDF
Garage RDBMS
ODP
Developing apps and_integrating_with_gluster_fs_-_libgfapi
PDF
Work WIth Redis and Perl
PDF
Say Hello to MyRocks
ODP
Scale out backups-with_bareos_and_gluster
PDF
Byte code engineering 21st May Saturday 2016
StripeEu Twistedbytes Presentation
MyRocks in MariaDB
Garage RDBMS
Developing apps and_integrating_with_gluster_fs_-_libgfapi
Work WIth Redis and Perl
Say Hello to MyRocks
Scale out backups-with_bareos_and_gluster
Byte code engineering 21st May Saturday 2016

What's hot (19)

PPTX
Home Automation with perl
ODP
Random tips that will save your project's life
PDF
Go frugal with web services
PDF
Scala at foursquare
ODP
Gluster d thread_synchronization_using_urcu_lca2016
PDF
Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)
PDF
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...
PDF
[POSS 2019] OVirt and Ceph: Perfect Combination.?
ODP
Logging for OpenStack - Elasticsearch, Fluentd, Logstash, Kibana
PPTX
Introduction to Napa.js
PDF
Ceph Block Devices: A Deep Dive
PDF
Realtime Search Infrastructure at Craigslist (OpenWest 2014)
PDF
Symfony e grandi numeri: si può fare!
ODP
20160130 Gluster-roadmap
PDF
Cimagraphi8
PDF
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
PDF
Couchbase live 2016
ODP
Join the super_colony_-_feb2013
ODP
YDAL Barcelona
Home Automation with perl
Random tips that will save your project's life
Go frugal with web services
Scala at foursquare
Gluster d thread_synchronization_using_urcu_lca2016
Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)
Practical CephFS with nfs today using OpenStack Manila - Ceph Day Berlin - 12...
[POSS 2019] OVirt and Ceph: Perfect Combination.?
Logging for OpenStack - Elasticsearch, Fluentd, Logstash, Kibana
Introduction to Napa.js
Ceph Block Devices: A Deep Dive
Realtime Search Infrastructure at Craigslist (OpenWest 2014)
Symfony e grandi numeri: si può fare!
20160130 Gluster-roadmap
Cimagraphi8
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
Couchbase live 2016
Join the super_colony_-_feb2013
YDAL Barcelona

Similar to MongoDB, RabbitMQ y Applicaciones en Nube (20)

PPTX
Drop acid
PDF
MongoDB: a gentle, friendly overview
PDF
Using Spring with NoSQL databases (SpringOne China 2012)
PDF
Mongo db transcript
PDF
MongoDB at FrozenRails
PPTX
MongoDB
PDF
Learn Learn how to build your mobile back-end with MongoDB
PDF
Introduction to MongoDB
KEY
Discover MongoDB - Israel
KEY
MongoDB London PHP
PPT
Introduction to MongoDB
KEY
MongoDB SF Ruby
PDF
Mongodb my
PDF
MongoDB
PDF
MongoDB Versatility: Scaling the MapMyFitness Platform
PDF
NoSQL solutions
PPT
9. Document Oriented Databases
PDF
An Elastic Metadata Store for eBay’s Media Platform
PPTX
Einführung in MongoDB
Drop acid
MongoDB: a gentle, friendly overview
Using Spring with NoSQL databases (SpringOne China 2012)
Mongo db transcript
MongoDB at FrozenRails
MongoDB
Learn Learn how to build your mobile back-end with MongoDB
Introduction to MongoDB
Discover MongoDB - Israel
MongoDB London PHP
Introduction to MongoDB
MongoDB SF Ruby
Mongodb my
MongoDB
MongoDB Versatility: Scaling the MapMyFitness Platform
NoSQL solutions
9. Document Oriented Databases
An Elastic Metadata Store for eBay’s Media Platform
Einführung in MongoDB

More from Socialmetrix (17)

PDF
7 Disparadores de Engagement para o mercado de consumo massivo
PDF
The Ultimate Guide to using Social Media Media Analytics
PDF
Social Media is no longer something relevant just for the area of Marketing. ...
PDF
How to Create a Successful Social Media Campaign
PDF
¿Por que cambiar de Apache Hadoop a Apache Spark?
PDF
AWS re:Invent 2014 | (ARC202) Real-World Real-Time Analytics
PDF
Tutorial en Apache Spark - Clasificando tweets en realtime
PPT
Introducción a Apache Spark a través de un caso de uso cotidiano
PPTX
Conferencia MySQL, NoSQL & Cloud: Construyendo una infraestructura de big dat...
PPTX
Construyendo una Infraestructura de Big Data rentable y escalable (la evoluci...
PPTX
Introducción a Apache Spark
PDF
Social media brasil 2014 - O Marketing e as Redes Sociais em tempos de conver...
PDF
14º Encontro Locaweb - Evolução das Plataformas para Métricas Sociais
PPTX
Call2Social
PDF
PPTX
Jugar Introduccion a Scala
PPTX
Endeavor – métricas em mídias sociais
7 Disparadores de Engagement para o mercado de consumo massivo
The Ultimate Guide to using Social Media Media Analytics
Social Media is no longer something relevant just for the area of Marketing. ...
How to Create a Successful Social Media Campaign
¿Por que cambiar de Apache Hadoop a Apache Spark?
AWS re:Invent 2014 | (ARC202) Real-World Real-Time Analytics
Tutorial en Apache Spark - Clasificando tweets en realtime
Introducción a Apache Spark a través de un caso de uso cotidiano
Conferencia MySQL, NoSQL & Cloud: Construyendo una infraestructura de big dat...
Construyendo una Infraestructura de Big Data rentable y escalable (la evoluci...
Introducción a Apache Spark
Social media brasil 2014 - O Marketing e as Redes Sociais em tempos de conver...
14º Encontro Locaweb - Evolução das Plataformas para Métricas Sociais
Call2Social
Jugar Introduccion a Scala
Endeavor – métricas em mídias sociais

Recently uploaded (20)

PPTX
How to Convert Tickets Into Sales Opportunity in Odoo 18
PDF
CEH Module 2 Footprinting CEH V13, concepts
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
SaaS reusability assessment using machine learning techniques
PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PDF
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PDF
Streamline Vulnerability Management From Minimal Images to SBOMs
PPTX
Presentation - Principles of Instructional Design.pptx
PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
PDF
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
PDF
Altius execution marketplace concept.pdf
PDF
Decision Optimization - From Theory to Practice
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
PDF
Human Computer Interaction Miterm Lesson
PDF
Examining Bias in AI Generated News Content.pdf
PDF
A symptom-driven medical diagnosis support model based on machine learning te...
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PPTX
How to use fields_get method in Odoo 18
How to Convert Tickets Into Sales Opportunity in Odoo 18
CEH Module 2 Footprinting CEH V13, concepts
Data Virtualization in Action: Scaling APIs and Apps with FME
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
SaaS reusability assessment using machine learning techniques
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
EIS-Webinar-Regulated-Industries-2025-08.pdf
Streamline Vulnerability Management From Minimal Images to SBOMs
Presentation - Principles of Instructional Design.pptx
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
Altius execution marketplace concept.pdf
Decision Optimization - From Theory to Practice
NewMind AI Weekly Chronicles – August ’25 Week IV
Human Computer Interaction Miterm Lesson
Examining Bias in AI Generated News Content.pdf
A symptom-driven medical diagnosis support model based on machine learning te...
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
How to use fields_get method in Odoo 18

MongoDB, RabbitMQ y Applicaciones en Nube

  • 1. MongoDB,  RabbitMQ  y     aplicaciones  en  nube   Gustavo  Arjones   [email protected]  |  @arjones  
  • 5. RabbitMQ   •  Message  Queue  (AMQP  compliance)   •  Arquitectura  orientada  a  mensajes   •  Desacoplado,  Aislado   •  Facil  escalabilidad  horizontal   •  “AlternaAva”:  Kestrel  /  Twi8er  (NO  AMQP!)  
  • 7. Direct  Message   Matching  exact  key   Cerveza   Cerveza   Cerveza   Vino  
  • 8. Fanout  Exchange   Copy  to  all   Cerveza   Cerveza   Cerveza   Bebida   Bebida  
  • 9. Topic  Exchange   Route  by  Key  with  Key  Globbing   Bebida.Vino   Bebida.Vino   Bebida.Vino   Bebida.#   Comida.*   #.Vino  
  • 10. Nanite   •  Nanite  is  a  new  way  of  thinking  about  building   cloud  ready  web  applicaAons.  Having  a   scalable  message  queueing  back-­‐end  with  all   the  discovery  and  dynamic  load  based   dispatch  that  Nanite  has  is  a  very  scalable  way   to  construct  web  applicaAon  back-­‐ends.    
  • 12. MongoDB  es  …   •  DB  Orientado  a  documentos  (schemaless)   •  “Facil”  escalar  horizontal  (shard)   •  Para  mantener  estructuras  complejas   (jerarquicas)   •  Para  estadísAcas  “simples”   •  Para  mantener  archivos  (GridFS)  
  • 13. MongoDB  NO  es  …   •  Para  transaciones   •  Para  OLAP   •  RDBMS  (AcAveRecord?)  
  • 14. Select   SELECT  first_name,  last_name     FROM  authors   WHERE  zipcode  =  1234   ORDER  BY  last_name  DESC   LIMIT  2,  1;   >  db.authors.find({"zipcode"  :  1234},      {"first_name"  :  1,  "last_name"  :  1  }).sort({"last_name"  :  -­‐1  })    .skip(2).limit(1);  
  • 15. Select   SELECT  *   FROM  authors   WHERE  dob  BETWEEN  ‘1970-­‐1-­‐1’  AND  ‘1990-­‐1-­‐1’   AND  address  IS  NULL;   >  db.authors.find({"dbo"  :  {  $gte  :  new  Date(“1970-­‐1-­‐1”),  $lte  :   new  Date(“1990-­‐1-­‐1”)},  “address”  :  {  $exists  :  false  }  }  );  
  • 16. Upsert  (Update  +  Insert)   >  db.tweets.update(  query,  modify,  upsert?,  mul2ple?  );   >  db.setup.update({},  {  $set  :  {  "in_progress"  :  false  }  },  false,   true);   >  db.setup.update({},  {  "opAons.last_status"  :  -­‐1},  false,  true);  
  • 17. Indexes   >  db.  tweets.ensureIndex(    {"user.Ame_zone"  :  1},  {background:true});   >  db.tweets.ensureIndex(    {"created_at"  :  1,  "user.Ame_zone"  :  1,  "tokens"  :  1},    {background:true});   background:true    no  lock  para  crear  indices   >  db.tweets.getIndexes()  
  • 18. Prós   Contras   •  Schemaless   •  Map-­‐Reduce  MUY  lento   •  Rápida  instalación   •  Sharding  es  BETA   •  Muchos  Drivers   •  Nuevo  set  de   disponibles   commandos  
  • 19. Tips   •  Pensar  BIEN  el  schema  antes  de  empezar   •  Guardar  calculaAon   •  Evitar  map-­‐reduce  (unAl  r.  1.8)   •  Indexes  TIENEN  que  entrar  en  RAM   >  db.  tweets.totalIndexSize();   1187423168  (~1.1Gb)   >  db.  tweets.storageSize();   16670199040  (~15.5  Gb)  
  • 20. Referencias   •  h8p://www.rabbitmq.com/   •  h8p://www.mongodb.org/   •  h8p://github.com/ezmobius/nanite   •  h8p://github.com/robey/kestrel   •  h8p://www.slideshare.net/somic/introducAon-­‐ to-­‐amqp-­‐messaging-­‐with-­‐rabbitmq   •  h8p://www.slideshare.net/ma8ma8/rabbitmq-­‐ and-­‐nanite  
  • 21. Muchas  gracias   Gustavo  Arjones   [email protected]  |  @arjones