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.
Replica¸˜o e escalabidade do ZODB com        ca                RelStorageRud´ Porto Filgueiras - rudazz@gmail.com - @rudap...
Agenda  Motiva¸˜o        ca  ZODB  RelStorage  Benchmarks  Referˆncias       e  Perguntas
Motiva¸˜o      ca      Sistemas baseados em Plone / Zope      Grandes portais de conteudo: Imagens, Videos, Audio      Des...
ZODB and FileStorage      ACID      Arquivo append-only para armazenar os objetos e transa¸oes                            ...
ZEO: compartilhamento do FileStorage      Criado para permitir o compartilhamento da base de dados      entre multiplos pr...
RelStorage   O projeto RelStorage criado por Shane Hathaway tem como   objetivo permitir que o ZODB seja armazenado em um ...
RelStorage: Instala¸˜o                   ca      Instalar bibliotecas de desenvolvimento e pacotes do backend      SQL: ps...
RelStorage: Configura¸˜o Buildout                    ca 1 [ buildout ] 2 ... 3 4 eggs = 5           RelStorage 6           ...
RelStorage: Configura¸˜o Buildout                    ca 1   [ instance ] 2   recipe = plone . recipe . zope2instance 3   .....
RelStorage zodbconvert: migra¸ao do FileStorage                             c    Para realizar a migra¸˜o de um ZODB tradi...
Benchmarks: concorrencia = 21   ** c o n c u r r e n c y=2 **2                      psql ,   psql mc , mysql ,   mysql mc ...
Benchmarks: concorrencia = 41   ** c o n c u r r e n c y=4 **2                      psql ,   psql mc , mysql ,   mysql mc ...
Referˆncias     e      http://pypi.python.org/pypi/RelStorage      http://pypi.python.org/pypi/zodbshootout      http://sh...
Perguntas?   Contato: Rud´ Porto Filgueiras               a       rudazz@gmail.com       @rudaporto       github.com/rudap...
Upcoming SlideShare
Loading in …5
×

Replicação e escalabidade do ZODB com RelStorage

1,467 views

Published on

O CMS Plone utiliza o ZODB como usa base de dados principal. Em alguns cenários, como grandes portais, é preciso ter muitos servidores ZOPE no frontend processando as requisições dos usuários.

Nessas situações, o ZEO, backend distribuído padrão do ZODB, pode ficar sobrecarregado, principalmente pela quantidade de IO requisitada e em alguns casos de CPU também.

Como alternativa ao ZEO, foi desenvolvido um novo backend para o ZODB que armazena os dados dos objetos (raw) em banco de dados relacionais, com alguns objetivos:

facilitar o uso de múltiplas CPUs no processamento do backend
utilizar ferramentas de backup e replicação já conhecidas dos administradores de banco de dados
fazer backup on-lin dos dados do servidor com a utilização de réplicas escravas
fazer um balanceamento das requisições ao backend utilizando-se de clusters



Além disso, o RelStorage também inovou na integração com memcached para centralizar o cache do objetos e aliviar ainda mais o IO do backend ZODB.

O objetivo desta apresentação é falar sobre o projeto RelStorage, utilizando-se de exemplos de práticos de utilização dele em aplicação Zope/Plone e sua integração com memcached e realizando um espelhamento da base de dados.

  • 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 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
  • If you want to download or read this book, Copy link or url below in the New tab ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • If you want to download or read this book, Copy link or url below in the New tab ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • If you want to download or read this book, Copy link or url below in the New tab ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Replicação e escalabidade do ZODB com RelStorage

  1. 1. Replica¸˜o e escalabidade do ZODB com ca RelStorageRud´ Porto Filgueiras - rudazz@gmail.com - @rudaporto a October 1, 2011
  2. 2. Agenda Motiva¸˜o ca ZODB RelStorage Benchmarks Referˆncias e Perguntas
  3. 3. Motiva¸˜o ca Sistemas baseados em Plone / Zope Grandes portais de conteudo: Imagens, Videos, Audio Desempenho, escalabilidade e disponibilidade Facilidade de utilizar infra-estrutura existente
  4. 4. ZODB and FileStorage ACID Arquivo append-only para armazenar os objetos e transa¸oes c NoSQL Transparencia para armazenamento de objetos Python (tipo Persistent) FileStorage: Permite que apenas um processo acesse a base de dados
  5. 5. ZEO: compartilhamento do FileStorage Criado para permitir o compartilhamento da base de dados entre multiplos processos ZRPC: protocolo de rede para comunica¸ao entre o cliente c (Zope) e o servidor (ZEO) Normalmente o ZEO e um processo IO bound Nao possui (ate a versao 3.10) threads para concorrencia de acesso de forma que cada cliente fica na sua propria thread
  6. 6. RelStorage O projeto RelStorage criado por Shane Hathaway tem como objetivo permitir que o ZODB seja armazenado em um backend relacional: Desenvolvido com objetivo de melhorar a escalabilidade do ZODB quando existem muitos Zope clients conectados a uma mesma base de dados ZODB Implementa um novo StorageLayer para o ZODB Os dados sao armazenados de forma opaca no banco de dados SQL (nao ha como consultar os dados e extrair informacoes diretamente do banco de dados SQL) Suporta diferentes bancos de dados: Oracle, MySQL, PostgreSQL Suporta ambientes clusterizados e tambem uso de Memcached para minimizar o overhead no backend e aumentar o desempenho
  7. 7. RelStorage: Instala¸˜o ca Instalar bibliotecas de desenvolvimento e pacotes do backend SQL: psycopg2, MySQL-python, etc Instalar bibliotecas de desenvolvimento do memcached: libmemcached-dev Configurar buildout para instalar pacotes python: pylibmc ou python-memcached e RelStorage Alterar configura¸ao da instancia Zope2 para utilizar c rel-storage
  8. 8. RelStorage: Configura¸˜o Buildout ca 1 [ buildout ] 2 ... 3 4 eggs = 5 RelStorage 6 psycopg2 7 pylibmc 8 ... 910 [ z o p e p y ]11 # i n s t a l l s a z o p e p y p y t h o n i n t e r p r e t e r t h a t r u n s12 # w i t h y o u r f u l l Zope e n v i r o n m e n t13 r e c i p e = z c . r e c i p e . egg14 e g g s = $ { b u i l d o u t : e g g s }15 i n t e r p r e t e r = z o p e p y16 s c r i p t s = z o p e p y z o d b c o n v e r t z o d b p a c k
  9. 9. RelStorage: Configura¸˜o Buildout ca 1 [ instance ] 2 recipe = plone . recipe . zope2instance 3 ... 4 r e l −s t o r a g e = 5 type p o s t g r e s q l 6 dsn dbname=zodb u s e r=r u d a h o s t=l o c a l h o s t 7 b l o b −d i r $ { b u i l d o u t : d i r e c t o r y } / v a r / b l o b s t o r a g e 8 s h a r e d −b l o b −d i r y e s 9 p o l l − i n t e r v a l 6010 cache −s e r v e r s 127 . 0 . 0 . 1 : 1121111 r e p l i c a −c o n f dsn dbname=zodb u s e r=r u d a h o s t=o u t r o h o s t
  10. 10. RelStorage zodbconvert: migra¸ao do FileStorage c Para realizar a migra¸˜o de um ZODB tradicional em FileStorage e ca vice-versa, foi criado um utilit´rio chamado zodbconvert. Esse a utilit´rio espera como estrada um arquivo de configura¸˜o que a ca defina a origem e o destino dos dados, como segue (zodbconvert.cfg):1 < f i l e s t o r a g e s o u r c e>2 p a t h / meu caminho / v a r / f i l e s t o r a g e / Data . f s3 </ f i l e s t o r a g e>45 < r e l s t o r a g e d e s t i n a t i o n>6 < p o s t g r e s q l>7 dsn dbname=zodb u s e r=r u d a h o s t=l o c a l h o s t8 </ p o s t g r e s q l>9 </ r e l s t o r a g e> Executando a migra¸ao: ./bin/zodbconvert zodbconvert.cfg c
  11. 11. Benchmarks: concorrencia = 21 ** c o n c u r r e n c y=2 **2 psql , psql mc , mysql , mysql mc , z e o f s3 Add 4662 , 3976 , 6100 , 5615 , 39304 Update 4673 , 4196 , 5865 , 5102 , 32045 Warn 3580 , 18462 , 4142 , 16525 , 34056 Cold 3505 , 2504 , 9164 , 3042 , 34417 Hot 36200 , 35989 , 36256 , 35941 , 352638 S t e a m i n 3643260 , 2538156 , 3179912 , 2710374 , 3530558
  12. 12. Benchmarks: concorrencia = 41 ** c o n c u r r e n c y=4 **2 psql , psql mc , mysql , mysql mc , z e o f s3 Add 5456 , 4405 , 6807 , 7084 , 41884 Update 5109 , 4738 , 6442 , 6404 , 32155 Warm 3735 , 16860 , 3538 , 16830 , 28846 Cold 3490 , 2457 , 7892 , 3162 , 28337 Hot 37322 , 39988 , 36288 , 36447 , 353068 S t e a m i n 5840123 , 4748044 , 6680157 , 3631432 , 6962945
  13. 13. Referˆncias e http://pypi.python.org/pypi/RelStorage http://pypi.python.org/pypi/zodbshootout http://shane.willowrise.com/archives/how-to-install-plone- with-relstorage-and-mysql
  14. 14. Perguntas? Contato: Rud´ Porto Filgueiras a rudazz@gmail.com @rudaporto github.com/rudaporto

×