Your SlideShare is downloading. ×
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware

696

Published on

Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware, …

Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware,

Palestra apresentada no TDC2013 (The Developers' Conference) em Porto Alegre

Published in: Technology, Business
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
696
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Multitenancy: Da teoria à realidade, Do DB ao Middleware Bruno Borges Principal Product Manager
  • 2. Bruno Borges Principal Product Manager - Middleware Desenvolvedor, Gamer Entusiasta em Java Embedded e JavaFX Twitter: @brunoborges 3 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 3. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 4 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 4. Multi-tenancy 5 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 5. Multiple Apps e Single App Uma aplicação e um banco de dados Cliente 1 Cliente 2 APP DB Cliente 3 Cliente 4 6 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. … where client_id = ?
  • 6. Multiple Apps e Single App Uma aplicação e um banco de dados  Um único banco de dados (schema) e uma única instância da aplicação – Todos os dados de todos os clientes na mesma base – Recursos de banco compartilhados com todos  Clientes que possuem mais dados podem prejudicar clientes menores – Dificuldade em realizar backups por clientes  Backup de todo o banco pode ser custoso, demorado – Lógica específica para separação dos dados dos clientes 7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 7. Multiple Apps e Single App Uma aplicação, múltiplos bancos de dados Cliente 1 Cliente 2 múltiplos DS: ...lookup(“jdbc/db1”); DB 1 APP DB 2 Cliente 3 DB 3 8 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 8. Multiple Apps e Single App Como trabalhamos hoje?  Múltiplos bancos de dados/schemas e uma única aplicação – Maior complexidade em administrar N bases/schemas – Separação dos dados de forma lógica/física – Dificuldade em customizar 9 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 9. Multiple Apps e Single App Múltiplas aplicações e múltiplos bancos de dados SSO com redirect Cliente 1 DB 1 Cliente 2 APP 2 DB 2 Cliente 3 10 APP 1 APP 3 DB 3 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 10. Multiple Apps e Single App Como trabalhamos hoje?  Múltiplas bases/schemas e múltiplas instâncias de app – Maior custo em infraestrutura – Dificuldade em manutenção/customização – Escalabilidade complexa 11 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 11. Multi-tenancy: do jeito certo 12 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 12. Uma instância, múltiplos tenants de dados Como devemos fazer? getConnection(“pdb1”); Cliente 1 PDB 1 Cliente 2 PDB 2 APP CDB PDB 3 Cliente 3 1 único DS Cliente 4 13 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. PDB 4
  • 13. Oracle Database 12c 14 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 14. Private Database Cloud Architectures Using Oracle Database 11g Virtual Machines Dedicated Databases share servers share servers and OS Increasing Consolidation 15 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Schema Consolidation share servers, OS and database
  • 15. Private Database Cloud Architectures Using Oracle Database 12c Virtual Machines Dedicated Databases Pluggable Databases share servers share servers and OS share servers, OS and database Increasing Consolidation 16 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 16. Oracle Database Architecture Requires memory, processes and database files System Resources 17 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 17. New Multitenant Architecture Memory and processes required at container level only System Resources 18 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 18. New Multitenant Architecture Memory and processes required at container level only System Resources 19 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 19. Pluggable vs Separate Databases Highly Efficient: 6x Less H/W Resource, 5x more Scalable OLTP benchmark comparison Only 3GB of memory vs. 20GB memory used for 50 databases Pluggable databases scaled to over 250 while separate database instances maxed at 50 20 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 20. Managing Shared Resources Resource management for consolidated databases Low Priority Medium Priority High Priority 21 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 21. Improved Agility With Changing Workloads Expand Cluster to Support Flexible Consolidation Model Services CDB Instance 1 CDB Instance 2 Single SGA per CDB Instance Node1 Multitenant Container Database (CDB) 22 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Node2
  • 22. Improved Agility With Changing Workloads Expand Cluster to Support Flexible Consolidation Model Services CDB Instance 1 CDB Instance 3 CDB Instance 2 Single SGA per CDB Instance Node1 Node3 Multitenant Container Database (CDB) 23 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Node2
  • 23. Managing Database Service Level Tiers Change tiers as databases become more mission critical GOLD SILVER BRONZE 24 RAC, Data Guard, Daily Incrementals Data Guard, Daily Incrementals Weekly Full Backups Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 24. Fast Provisioning Pluggable databases can be quickly provisioned from seed Time Taken to Provision New Database 25 20 15 10 5 0 Non CDB 25 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. PDB Clone PDB using Copy-on-Write File System
  • 25. Creating Databases for Test and Development Fast, flexible copy and snapshot of pluggable databases 26 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 26. Nova Arquitetura Multitenant Ideal para consolidar Cloud Databases No application changes Isolation and multitenancy Fast provisioning and cloning Secure and highly available Lower IT costs Manage many as one Greater resource utilization Performant and scalable 27 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 27. Integração DB 12c com Oracle WebLogic Server 28 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 28. Integração WebLogic com Pluggable Databases Maior densidade e escalabilidad, Multi-Tenancy • Integrando WebLogic Server com Pluggable Databases • Integração suave e coerente • Suporte a MultiTenancy com conexão automática ao PDB (tenant) usando Set Container WebLogic Cluster App 1 Get Connection Tenant1 App 1 App 2 App 2 Mgd Svr 1 Mgd Svr 2 Data Source Set Container PDB1 PDB1 Tenant 1 Set Container PDB2 PDB2 Tenant 2 Container Database 29 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. … Get Connection Tenant2
  • 29. Integração WebLogic com PDB: 1 Datasource por PDB/Tenant Maior Densidade e Escalabilidade na Camada de Dados  Pluggable databases aparecem como bancos normais no WebLogic WebLogic Domain 1 DS1 DS2 WebLogic Domain 2 DS3 DS4 DS5 DS6  No WebLogic, configure um datasource por PDB/Tenant PDB 1 PDB 2 PDB 3 PDB 4 PDB 5 Container Database 30 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. PDB 6
  • 30. Integração WebLogic com PDB: Troca de Conexão entre PDBs Maior Densidade e Escalabilidade, Suporte a Multi-tenancy  No WebLogic, configure um único datasource com conexões a todos os tenants no banco de dados  Crie um callback handler com o label da conexão para chamar setContainer nas conexões WebLogic Domain 1 Application 1: getConnection(Tenant5) Connection Label Callback Handler setContainer()  Habilita multi-tenancy nas camadas de Datasource 1 1 1 2 2 2 5 4 4 dados e aplicação  Permite maior densidade e escalabilidade nas camadas de dados e aplicação – 31 Melhor uso de recursos Copyright © 2013, Oracle and/or its affiliates. All rights reserved. PDB 1 PDB 2 PDB 3 PDB 4 PDB 5 Container Database PDB 6
  • 31. Application Continuity – JDBC Replay Improved Resiliency for Better User Experience  Leverage feature supported in DB 12c – Generic and GridLink datasources WebLogic Cluster Managed Server 1 Managed Server 2 Machine 1 Machine 2  DB exceptions captured at datasource layer GridLink Data Source – Examples: RAC node failure, transient DB problem  Automatically replay requests 2. Create Connection to Surviving Node; Replay if safe 1. FAN Down Event: “Node 3 Down” – Transparent to application – Read and write requests supported – No XA Transaction support  Benefit: Better end user experience Listener Listener Listener ONS ONS ONS Machine 1 Machine 2 RAC RAC Node 1 Node 2 RAC Node 3 Machine 3 Down RAC Cluster 32 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 32. Application Continuity Notes How it Works in WebLogic  Active Gridlink and Generic datasources, 12c driver only  Leverages JDBC replay, re-implemented in 12c DB  Enabled with use of oracle.jdbc.replay.OracleDataSourceImpl driver class – When connection is taken from pool, “begin” is called – JDBC calls are “remembered” through commit – When connection is put back in the pool, “end” is called  On failure, new connection is automatically created – Transparent to application! – Replay is already complete when connection is given to app Limitations :cannot use with XA, PLSQL, proxy authentication, DRCP 33 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 33. WLS 10.3.6/12.1.1/12.1.2 WLS 10.3.6/12.1.1 WLS 12.1.2 WLS 10.3.6/12.1.1 WLS 12.1.2 with 12c drivers with 11gR2 DB with 12c drivers with 11gR2 DB with 12c drivers with 12c DB with 12c drivers with 12c DB Feature with 11g drivers with 11gR2 DB with 11g drivers with 12c DB Yes Yes (Read&Write w (Read&Write w Active GridLink and Active GridLink only, Generic DataSource, no XA transactions) no XA transactions ) JDBC replay (read/write) No No No No Pluggable Database (PDB) Dynamic switching between PDBs No Yes (Except Set Container) No No Yes Yes No No No No No Yes Database Resident Connection pooling (DRCP) No No No Yes No Oracle Notification Service (ONS) auto configuration No No No No No Yes Yes (Active GridLink only) No Yes (Active GridLink only) No No No No Yes Yes Global Database Services (GDS) JDBC 4.1 (using ojdbc7.jar files & JDK 7) 34 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Yes Yes (Active GridLink only) (Active GridLink only) Yes Yes
  • 34. Elasticidade com Dynamic Clusters 35 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 35. Dynamic Clusters Configuração simplificada Configuração inicial do Cluster Operações para aumentar o cluster Dynamic Cluster 1 Dynamic Cluster 1 Server Template Server Template Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Server 4 Server 6 Server 7 36 Server 2 Server 5 Server 2 Server 1 Server 3 Server 1 Server 8
  • 36. Dynamic Clusters Wizard  Processo interativo passo-a-passo  Criação simples de Cluster Dinâmico  Resultados: – – Template de Servidor – Mapeamento de máquinas – 37 Cluster com Servidores Dinâmicos Mapeamento de portas e endereços Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 37. Server Template  Uso primário para Dynamic Clusters – Também pode ser usado com Managed Servers configurados  Servidores herdam mudanças dinamicamente  Variáveis: – ${id} instance id – ${serverName} – ${clusterName} – ${domainName} – ${system-property-name} 38 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 38. What’s Next for Dynamic Clusters  Novo MBean ClusterLifecycleRuntime – getNextServerName() – getNumberRunningServers() – getNumberShutdownServers() – startNextServer() – startServers(int numberToStart) – shutdownLastServer() – shutdownServers(int numberToShutdown) – shutdownServers(int numberToShutdown, int timeout, boolean ignoreSessions) 39 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.  Comandos de WLST para Dynamic Clusters – shrink (clusterName, numServers=1, block=true, updateConfiguration=false) – expand (clusterName, numServers=1, block=true, updateConfiguration=false)  Comandos de notificações WLDF WLST – Permite auto-scaling  Integração para OVM
  • 39. Mais “What’s Next” para Dynamic Clusters  Machine Mappings – Max servers per machine – Machine weight – Machine-based cluster size increase  Listen Addresses – IP address ranges – List of available IP addresses 40 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 40. Elasticidade com Configuração Simplificada de JMS 41 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 41. Administração Cloud Nativa Simplicidade e Escalabilidade de JMS JMS  WebLogic JMS para clouds on-premise JMS JMS JMS JMS JMS JMS JMS – Cluster-targeted JMS Servers and Stores Expand  Benefícios – Flexible scaling of messaging services JMS – Much simpler config/subdeployments JMS JMS JMS Elastic JMS Cluster – JMS enabled on Dynamic Clusters Contract  Expand to meet capacity demand  Contract to increase efficiency JMS 42 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Presented under Non-Disclosure Agreement – Do not Redistribute JMS JMS JMS
  • 42. Configuração JMS…12.1.1 e Antes JMS Server 1 JMS Server 2 JMS Store 1 JMS Server 1 JMS Store 1 Server 1 Cluster 43 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. JMS Store 2 JMS Server 2 JMS Store 2 Server 2 JMS Server 3 JMS Store 3 JMS Server 3 JMS Store 3 Server 3 Config.xml <JMS Server 1> <target=managed server 1> </JMS Server 1> <JMS Server 2> <target=managed server 2> </JMS Server 2> <JMS Server 3> <target=managed server 3> </JMS Server 3> … JMS Module Target=cluster Subdeployment = JMS Server 1, JMS Server 2, JMS Server 3, …
  • 43. Configuração JMS…WebLogic 12.1.2 Simplicidade e Escalabilidade Config.xml <JMS Server 1> <target=cluster> </JMS Server 1> JMS Server 1 JMS Store 1 JMS Module JMS Server 1 JMS Server 1 JMS Store 1 JMS Store 1 Server 2 Server 1 JMS Server 1 JMS Store 1 Server 3 Target=cluster Subdeployment = JMS Server 1 Cluster Limitations 44 No UOO, UOW, no SAF agents/Bridges on Dynamic/mixed Clusters Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 44. PERGUNTAS? 45 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 45. OBRIGADO! @brunoborges blogs.oracle.com/brunoborges 46 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  • 46. 47 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

×