用Java開發VoltDB程式
Editor's Note: This post was originally authored by Andrew Wilson from the VoltDB blog.
NewSQL and NoSQL databases present developers with a new and interesting programming model where there are fewer connections to the database, query parallelism, partitions and an easy model for supporting new clusters. Last month I presented a webinar introducing the basics of application development using VoltDB. We had a lot of great questions and I thought it would be handy to write them up and share the answers with everyone.
Q: Can you address how you would handle joining tables that have different partition keys? Would you not partition the tables in that case?
A: For multi-partition queries you join replicated tables and partitioned tables, and you can join two or more partitioned tables but they have to be joined on all table’s partition key.
If the query has a where clause that limits the query to a single partition, it can be executed as a single partition query. For single partition queries, you can join any combination of replicated and partitioned tables.
In all cases, consider joining on columns supported by indices (so that they are fast).
There are a number of factors to consider when joining tables in general sense. Should the table be a replicated table, thus local to every partition, or is it too large? For example, I may have a “users” table that contains thousands of users. I may need to map those users to a role and there may be only seven or eight roles within this “roles” table. In this case, it is safe to partition the “users” table and to replicate the “roles” table.
Consider though if your “users” table was joining with an “orders” table. This “orders” table may have thousands or millions of rows, making it a poor candidate for replication. Further, because of business rules it may be necessary to partition the orders on something other than the user but instead on the order ID. A join in this circumstance would result in a multi-partition query.
NewSQL and NoSQL databases present developers with a new and interesting programming model where there are fewer connections to the database, query parallelism, partitions and an easy model for supporting new clusters. Last month I presented a webinar introducing the basics of application development using VoltDB. We had a lot of great questions and I thought it would be handy to write them up and share the answers with everyone.
Q: Can you address how you would handle joining tables that have different partition keys? Would you not partition the tables in that case?
A: For multi-partition queries you join replicated tables and partitioned tables, and you can join two or more partitioned tables but they have to be joined on all table’s partition key.
If the query has a where clause that limits the query to a single partition, it can be executed as a single partition query. For single partition queries, you can join any combination of replicated and partitioned tables.
In all cases, consider joining on columns supported by indices (so that they are fast).
There are a number of factors to consider when joining tables in general sense. Should the table be a replicated table, thus local to every partition, or is it too large? For example, I may have a “users” table that contains thousands of users. I may need to map those users to a role and there may be only seven or eight roles within this “roles” table. In this case, it is safe to partition the “users” table and to replicate the “roles” table.
Consider though if your “users” table was joining with an “orders” table. This “orders” table may have thousands or millions of rows, making it a poor candidate for replication. Further, because of business rules it may be necessary to partition the orders on something other than the user but instead on the order ID. A join in this circumstance would result in a multi-partition query.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-746276/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- VoltDB - NewSQL DatabaseSQLDatabase
- 用java開發的有聲圍棋解說程式Java
- java開發系統核心:使用C語言開發系統應用程式JavaC語言
- Java 程式設計開發Java程式設計
- 開發 SOA 應用程式
- 用低程式碼開發平臺開發應用可靠嗎
- Java實用系統開發指南Java
- 急聘JAVA Web應用開發高手JavaWeb
- 應用開發:Java依然強勢Java
- 使用JAVA開發CORBA應用 (轉)JavaORB
- 用Ruby來開發GUI程式GUI
- 應用程式通用開發框架框架
- java-微信小程式開發工具Java微信小程式
- (一)使用Eclipse開發Java程式EclipseJava
- 上海應聘JAVA程式開發工作Java
- 使用MyEclipse開發Java EE應用:企業級應用程式專案(下)EclipseJava
- 使用MyEclipse開發Java EE應用:企業級應用程式專案(上)EclipseJava
- 用Spring Boot顛覆Java應用開發Spring BootJava
- 在零程式碼開發平臺上如何開發應用程式
- 低程式碼應用程式開發開始興起
- 急,ERP原來用DELPHI開發,現在要轉用JAVA開發,開發過程要用到哪些技術,用JAVA開發ERP會有那些困難Java
- to《Java實用系統開發指南》作者Java
- 急需……《JAVA實用系統開發指南》Java
- 用於微服務開發的 Java 框架微服務Java框架
- 用Spring的Converter API生成VoltDB的資料物件SpringAPI物件
- 《Java實用系統開發指南》和《JAVA與模式》?Java模式
- 用 TypeScript 開發 Node.js 程式TypeScriptNode.js
- VC開發應用程式答疑 (轉)
- Java Web程式開發參考手冊JavaWeb
- 好程式設計師Java教程分享Java開發工具程式設計師Java
- 你知道無程式碼開發平臺可以開發哪些應用程式嗎
- 用Python開發實用程式 – 計算器Python
- 基於PostgreSQL進行Java應用開發SQLJava
- java開發一個應用的總結Java
- Java的企業應用開發死期已到Java
- Java EE 6之企業應用開發Java
- 《Java實用系統開發指南》初感Java
- 用JAVA開發網站,需要學哪些呢?Java網站