SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
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/	
  
RabbitMQ	
  
•    Message	
  Queue	
  (AMQP	
  compliance)	
  
•    Arquitectura	
  orientada	
  a	
  mensajes	
  
•    Desacoplado,	
  Aislado	
  
•    Facil	
  escalabilidad	
  horizontal	
  



•  “AlternaAva”:	
  Kestrel	
  /	
  Twi8er	
  (NO	
  AMQP!)	
  
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	
  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	
  

Mais conteúdo relacionado

Mais procurados

Random tips that will save your project's life
Random tips that will save your project's lifeRandom tips that will save your project's life
Random tips that will save your project's life
Mariano Iglesias
 
Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)
Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)
Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)
Wei Shan Ang
 
Symfony e grandi numeri: si può fare!
Symfony e grandi numeri: si può fare!Symfony e grandi numeri: si può fare!
Symfony e grandi numeri: si può fare!
Daniel Londero
 

Mais procurados (19)

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

Semelhante a MongoDB, RabbitMQ y Applicaciones en Nube

001 hbase introduction
001 hbase introduction001 hbase introduction
001 hbase introduction
Scott Miao
 
Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS Applications
Steven Francia
 

Semelhante a MongoDB, RabbitMQ y Applicaciones en Nube (20)

Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
001 hbase introduction
001 hbase introduction001 hbase introduction
001 hbase introduction
 
MyRocks introduction and production deployment
MyRocks introduction and production deploymentMyRocks introduction and production deployment
MyRocks introduction and production deployment
 
Set Up & Operate Real-Time Data Loading into Hadoop
Set Up & Operate Real-Time Data Loading into HadoopSet Up & Operate Real-Time Data Loading into Hadoop
Set Up & Operate Real-Time Data Loading into Hadoop
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...
MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...
MongoDB vs Scylla: Production Experience from Both Dev & Ops Standpoint at Nu...
 
HPTS 2011: The NoSQL Ecosystem
HPTS 2011: The NoSQL EcosystemHPTS 2011: The NoSQL Ecosystem
HPTS 2011: The NoSQL Ecosystem
 
The NoSQL Ecosystem
The NoSQL Ecosystem The NoSQL Ecosystem
The NoSQL Ecosystem
 
Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS Applications
 
Vote NO for MySQL
Vote NO for MySQLVote NO for MySQL
Vote NO for MySQL
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Java
 
MariaDB Server Compatibility with MySQL
MariaDB Server Compatibility with MySQLMariaDB Server Compatibility with MySQL
MariaDB Server Compatibility with MySQL
 
Drop acid
Drop acidDrop acid
Drop acid
 
Speed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisSpeed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with Redis
 
AWS (Hadoop) Meetup 30.04.09
AWS (Hadoop) Meetup 30.04.09AWS (Hadoop) Meetup 30.04.09
AWS (Hadoop) Meetup 30.04.09
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRails
 
RavenDB in the wild
RavenDB in the wildRavenDB in the wild
RavenDB in the wild
 
M|18 How Facebook Migrated to MyRocks
M|18 How Facebook Migrated to MyRocksM|18 How Facebook Migrated to MyRocks
M|18 How Facebook Migrated to MyRocks
 
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
 
MongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewMongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overview
 

Mais de Socialmetrix

Conferencia MySQL, NoSQL & Cloud: Construyendo una infraestructura de big dat...
Conferencia MySQL, NoSQL & Cloud: Construyendo una infraestructura de big dat...Conferencia MySQL, NoSQL & Cloud: Construyendo una infraestructura de big dat...
Conferencia MySQL, NoSQL & Cloud: Construyendo una infraestructura de big dat...
Socialmetrix
 

Mais de Socialmetrix (17)

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

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

MongoDB, RabbitMQ y Applicaciones en Nube

  • 1. MongoDB,  RabbitMQ  y     aplicaciones  en  nube   Gustavo  Arjones   garjones@socialmetrix.com  |  @arjones  
  • 4.
  • 5. RabbitMQ   •  Message  Queue  (AMQP  compliance)   •  Arquitectura  orientada  a  mensajes   •  Desacoplado,  Aislado   •  Facil  escalabilidad  horizontal   •  “AlternaAva”:  Kestrel  /  Twi8er  (NO  AMQP!)  
  • 6.
  • 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.    
  • 11.
  • 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   garjones@socialmetrix.com  |  @arjones