Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

L'esprit de l'escalier

1,688 views

Published on

L'Esprit de l'escalier
NoSQL:br v2 2011 - Apresentação de Gleicon e John Rowell

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download Full EPUB Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download Full doc Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download PDF EBOOK here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download EPUB Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download doc Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://shorturl.at/krvUW } ......................................................................................................................... Download Full EPUB Ebook here { http://shorturl.at/krvUW } ......................................................................................................................... Download Full doc Ebook here { http://shorturl.at/krvUW } ......................................................................................................................... Download PDF EBOOK here { http://shorturl.at/krvUW } ......................................................................................................................... Download EPUB Ebook here { http://shorturl.at/krvUW } ......................................................................................................................... Download doc Ebook here { http://shorturl.at/krvUW } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

L'esprit de l'escalier

  1. 1. L'esprit de l'escalier NoSQL:br v2 2011
  2. 2. Who ? <ul><li>John D. Rowell </li></ul><ul><li>  </li></ul><ul><ul><li>@jdrowell </li></ul></ul><ul><ul><li>github.com/jdrowell </li></ul></ul><ul><ul><li>jdrowell.posterous.com </li></ul></ul><ul><li>Gleicon Moraes </li></ul><ul><ul><li>@gleicon </li></ul></ul><ul><ul><li>github.com/gleicon </li></ul></ul><ul><ul><li>7co.cc </li></ul></ul><ul><ul><li>restmq.com </li></ul></ul>
  3. 3. Você já deveria estar usando NoSQL <ul><li>NoSQL:br v1 </li></ul><ul><ul><li>Tudo era novidade </li></ul></ul><ul><ul><li>Maioria dos projetos em beta </li></ul></ul><ul><ul><li>Documentação escassa </li></ul></ul><ul><ul><li>&quot;Ninguém nunca foi demitido por usar Oracle&quot; </li></ul></ul><ul><li>NoSQL:br v2 </li></ul><ul><ul><li>Projetos maduros </li></ul></ul><ul><ul><li>Documentação, wikis, Chef recipes, the works </li></ul></ul><ul><ul><li>Use cases bem definidos e battle tested </li></ul></ul><ul><ul><li>MongoDB é o novo MySQL </li></ul></ul>
  4. 4. Você já deveria conhecer NoSQL <ul><li>github repo count </li></ul><ul><li>mysql: 2197 </li></ul><ul><li>mongodb: 1685 </li></ul><ul><li>redis: 1322 </li></ul><ul><li>couchdb: 1279 </li></ul><ul><li>postgres: 759 </li></ul><ul><li>memcached: 665 </li></ul><ul><li>cassandra: 402 </li></ul><ul><li>membase: 40 </li></ul><ul><li>voldemort: 32 </li></ul><ul><li>voltdb: 7 </li></ul>
  5. 5. Você já deveria estar usando NoSQL <ul><ul><li>Toolbox de modelos de armazenamento de dados, além de cache. </li></ul></ul><ul><ul><li>Pensar na estrutura dos dados e na melhor maneira de armazená-los </li></ul></ul>
  6. 6. Você já deveria estar usando NoSQL ? <ul><li>Sistemas legados: </li></ul><ul><li>Dependente de cache ? </li></ul><ul><li>Queries complexas ? </li></ul><ul><li>Tentar reproduzir o que já existe com um SGBD não relacional, sem todos os recursos utilizados pode causar mais problemas. </li></ul><ul><li>Dependente de ORM (ou adaptadores de Objetos -> NoSQL) </li></ul>
  7. 7. Era uma vez ...
  8. 8. Era uma vez ...
  9. 9. Era uma vez ...
  10. 10. Era uma vez ...
  11. 11. Era uma vez ...
  12. 12. Era uma vez ...
  13. 13. Era uma vez ...
  14. 14. Arquitetura <ul><li>Newsflash: Banco de Dados relacionais não é silver tape </li></ul><ul><ul><li>Message Queues </li></ul></ul><ul><ul><li>Job Schedulers </li></ul></ul><ul><ul><li>Distributed Counters </li></ul></ul><ul><ul><li>Distributed Lock </li></ul></ul><ul><ul><li>Document Storage </li></ul></ul><ul><ul><li>Filesystem </li></ul></ul><ul><ul><li>Cache </li></ul></ul><ul><ul><li>Logger  </li></ul></ul><ul><ul><li>Workflow Orchestrator </li></ul></ul>
  15. 15. Estudo de caso - Guia de Cidades <ul><ul><li>Apontador, Terra, Maplink, GuiaMais, etc. </li></ul></ul><ul><ul><li>Em relacional, facinho, cada informação na sua tabela </li></ul></ul><ul><ul><li>Tabela de empresas, tabela de filiais, tabela de endereços, tabela de cidades, tabela de usuários, ad nauseum </li></ul></ul><ul><ul><li>Cada update toca diversas tabelas e índices </li></ul></ul><ul><ul><li>Updates concorrentes geram muitos locks </li></ul></ul><ul><ul><li>Cada melhoria no sistema gera novas tabelas, que necessitam de migrações de schema </li></ul></ul><ul><ul><li>Release do código tem que casar com a versão do schema do db  </li></ul></ul><ul><ul><li>As operações mais complexas (ex: gerar nuvem de tags) são O(N) e o sistema fica lento exponencialmente com o aumento do volume de dados  </li></ul></ul><ul><ul><li>VAMOS MIGRAR PARA NOSQL! </li></ul></ul>
  16. 16. Estudo de caso - Guia de Cidades Usando Redis <ul><li>  </li></ul><ul><ul><li>[+] Ganho automático de performance </li></ul></ul><ul><ul><li>[-] Dados opacos e inexistência de índices batem de frente com a arquitetura do sistema </li></ul></ul><ul><ul><li>[-] Necessidade de denormalizar excessivamente os dados em múltiplas estruturas chave/valor para manter a mesma funcionalidade </li></ul></ul><ul><ul><li>FAIL </li></ul></ul><ul><li>  </li></ul>
  17. 17. Estudo de caso - Guia de Cidades Usando Riak <ul><li>  </li></ul><ul><ul><li>[-] Sem melhoria de performance </li></ul></ul><ul><ul><li>[-] Não utiliza a maior parte dos diferenciais do produto (não é um sistema &quot;Big Data&quot;) </li></ul></ul><ul><ul><li>[-] Mesmas limitações do Redis por ser chave/valor. Mesmo possuindo tratamento interno para JSON, alterações em documentos são &quot;tudo ou nada&quot; </li></ul></ul><ul><ul><li>FAIL </li></ul></ul><ul><li>  </li></ul>
  18. 18. Estudo de caso - Guia de Cidades Usando CouchDB <ul><li>  </li></ul><ul><ul><li>[--] Performance pior </li></ul></ul><ul><ul><li>[-] Não utiliza a maior parte dos diferenciais do produto (sistema nunca trabalha offline) </li></ul></ul><ul><ul><li>[+] Integração fácil com ElasticSearch (via river) possibilita buscas avançadas (FTS) </li></ul></ul><ul><ul><li>[-] Sistema de views por map/reduce necessita de uma mudança de paradigma dentro da equipe de devs </li></ul></ul><ul><ul><li>FAIL </li></ul></ul><ul><li>  </li></ul>
  19. 19. Estudo de caso - Guia de Cidades Usando VoltDB <ul><li>  </li></ul><ul><ul><li>[+] Ganho significativo de performance </li></ul></ul><ul><ul><li>[+] Mantém estrutura de dados (relacional) </li></ul></ul><ul><ul><li>[-] Limita o volume de dados à RAM do server </li></ul></ul><ul><ul><li>[-] Limitações similares à implementação original (relacional), mas sem problemas com locks e melhor escalabilidade </li></ul></ul><ul><ul><li>FAIL (mas pode ser &quot;good enough&quot;) </li></ul></ul><ul><li>  </li></ul>
  20. 20. Estudo de caso - Guia de Cidades Usando MongoDB <ul><li>  </li></ul><ul><ul><li>[+] Melhoria significativa de performance </li></ul></ul><ul><ul><li>[+] Arquitetura de dados centrada em documentos (um por empresa) </li></ul></ul><ul><ul><li>[+] Não há necessidade de locks ou transações pois os updates são atômicos (dentro do documento) </li></ul></ul><ul><ul><li>[+] Capacidade de indexar por múltiplos campos por documento, índices geoespaciais </li></ul></ul><ul><ul><li>[+] Buscas ad-hoc performáticas </li></ul></ul><ul><ul><li>[+] Escalabilidade simplificada com replica sets e sharding </li></ul></ul><ul><ul><li>WIN </li></ul></ul><ul><li>  </li></ul>
  21. 21. Estudo de caso: Email em larga escala <ul><ul><li>Começou pequeno, cada conta com listas de bloqueio e filtros, armazenadas em MySQL </li></ul></ul><ul><ul><li>Grupos de email com filtros e listas </li></ul></ul><ul><ul><li>Em alguns casos + de 700 queries por mensagem recebida </li></ul></ul><ul><ul><li>Redis para contadores e filtros. </li></ul></ul><ul><ul><li>Cache para regras de recebimento </li></ul></ul><ul><ul><li>Estagios de recebimento: cada fase conhece apenas seus dados </li></ul></ul><ul><ul><li>Queries com condições complexas e resultset breves (max 2 linhas) -> K/V </li></ul></ul>
  22. 22. Estudo de caso - BOVESPA real time <ul><ul><li>Em db relacional tradicional explode rapidamente devido à taxa de updates </li></ul></ul><ul><ul><li>Se tirar os índices você grava mais rápido, mas perde a visibilidade nas buscas </li></ul></ul><ul><ul><li>Volume de dados armazenados não é alto, mas as consultas, inserções e updates devem ter latência baixíssima (hint: cabe em memória) </li></ul></ul>
  23. 23. Estudo de caso - BOVESPA real time Usando Riak <ul><ul><li>[-] Explosão de vector clocks, alto consumo de espaço em disco (compactação é eventual), headers inflam </li></ul></ul><ul><ul><li>[-] Menor throughput e menor performance no decorrer do dia (após merge e compactação recupera) </li></ul></ul><ul><ul><li>[-] Buscas limitadas e caras </li></ul></ul><ul><ul><li>[+] Melhorias recentes (secondary indexes, eleveldb) aliviam esses problemas </li></ul></ul><ul><ul><li>FAIL </li></ul></ul>
  24. 24. Estudo de caso - BOVESPA real time Usando CouchDB <ul><ul><li>[-] Performance de writes e atualização de views inviabiliza o uso </li></ul></ul><ul><ul><li>FAIL </li></ul></ul>
  25. 25. Estudo de caso - BOVESPA real time Usando MongoDB <ul><ul><li>[-] Para conseguir a performance de escrita necessária, tem que ser em modo &quot;fire and forget&quot;, abrindo mão de consistência e arriscando perda de dados (i.e. qq falha de write passa desapercebida) </li></ul></ul><ul><ul><li>[-] Mesmo admitindo essas limitações, pode não ser performático o suficiente e os writes são centralizados no master (i.e. para escalar writes tem que implementar sharding mesmo que o volume de dados persistentes não justifique) </li></ul></ul><ul><ul><li>FAIL </li></ul></ul>
  26. 26. Estudo de caso - BOVESPA real time Usando VoltDB ou Redis <ul><ul><li>[+] Gravação em memória - updates não custam quase nada </li></ul></ul><ul><ul><li>[+] Latência insignificante permite serialização de operações (single threaded), que eliminam contenção por locks </li></ul></ul><ul><ul><li>[+] Persistência garantida por replicação e AOF assíncrono </li></ul></ul><ul><ul><li>Bonus para o Redis por ser chave/valor, pois a busca padrão é por chave (ticker) </li></ul></ul><ul><ul><li>Bonus para o Redis pelos seus data type complexos (lists para timelines, sorted sets para rankeamento) </li></ul></ul><ul><ul><li>WIN (Redis++) </li></ul></ul>
  27. 27. Calcanhares de Aquiles <ul><ul><li>Redis: administração em cloud (ainda não tem failover automático nem clustering) </li></ul></ul><ul><ul><li>MongoDB: desaconselhável para Big Data pois a arquitetura do cluster é heterogênea </li></ul></ul><ul><ul><li>Riak: não se comporta bem em ambiente OLTP com muitos updates/deletes, devido à ênfase em sistemas distribuídos (tombstones duram 3s, vector clock explosion) </li></ul></ul><ul><ul><li>CouchDB: não atinge os mesmos níveis de performance de outros NoSQL (foco é em funcionamento offline e conflict resolution) </li></ul></ul><ul><ul><li>VoltDB: necessita de baixa latência intra-cluster para ser performático </li></ul></ul>
  28. 28. FUQ - Frequent Unasked Questions Choose 2 <ul><li>a) como importo dados existentes ? </li></ul><ul><li>b) como exporto meus dados ? </li></ul><ul><li>c) se acabar a energia, como me recupero ? </li></ul><ul><li>d) se é tão rapido, deve gravar na memória. se grava na memória, como coloco um banco maior do que minha memória ? </li></ul><ul><li>e) quem me ajuda se tudo der errado ? </li></ul><ul><li>f) se posso usar mais de um nó, o que eu ganho ? escalabilidade ou disponibilidade ? </li></ul><ul><li>g) e o backup ? e o restore ? </li></ul><ul><li>h) migrando dados e backing stores </li></ul><ul><li>i) deploy no cloud - com relacional? </li></ul><ul><li>j) facilidades através de vendors (hosted solutions) vs. lock-in </li></ul><ul><li>m) dá pra processar big data sem usar NoSQL? </li></ul><ul><li>n) existe processamento assíncrono com locks? (transações assíncronas)(lamport clock?vector clock ? document db (JSON)) </li></ul>
  29. 29. L'Esprit de L'Escalier <ul><li>&quot;The feeling you get after leaving a conversation, when you think of all the things you should have said&quot; </li></ul><ul><li>ou </li></ul><ul><li>&quot;Me zoaram porque meu projeto está cheio de anti-patterns, a performance não está dentro do esperado, e ainda falei que ia escalar e não escala&quot; + assista essa palestra = FUCK YEAH! </li></ul>

×