- WordPress Web Application Development
- Rakhitha Nimesh Ratnayake
- 261字
- 2021-07-23 15:22:52
Extending a database with custom tables
Default WordPress databases can be extended by any number of custom tables to suit our project requirements. The only thing we have to consider is the creation of custom tables over existing ones. We can think of two major reasons for creating custom tables:
- Difficulty of matching data with existing tables: In the previous section, we considered real application requirements and matched the data with the existing tables. Unfortunately, it's not practical in all scenarios. Consider a system where the user purchases books from a shopping cart. We need to keep all the payment and order details for tracking purposes, and these records act as the transactions in the system. There is no way that we can find a compatible table for these kinds of requirements. Such requirements will be implemented using a collection of custom tables.
- Increased data volume: As I mentioned earlier, the posts table plays a major role in web applications. When it comes to large scale applications with a sizeable amount of data, it's not recommended to keep all the data types in the posts table. Assume that we are building a product catalog that has over a hundred different products. Creating a hundred custom post types to cater this scenario is almost impossible. On the other hand, the posts table would go out of control due to the large dataset. The same theory applies for the existing metatables as well. In such cases, it's wise to separate different datasets into their own tables to improve performance and keep things manageable.
推薦閱讀
- Cisco OSPF命令與配置手冊
- 物聯網智慧安監技術
- 智能網聯汽車V2X與智能網聯設施I2X
- Truffle Quick Start Guide
- 5G承載網網絡規劃與組網設計
- Hands-On Chatbots and Conversational UI Development
- 物聯網關鍵技術及應用
- 面向物聯網的嵌入式系統開發:基于CC2530和STM32微處理器
- Yii Application Development Cookbook(Second Edition)
- The Kubernetes Workshop
- 工業互聯網創新實踐
- 物聯網頂層設計與關鍵技術
- 商業的本質和互聯網
- RestKit for iOS
- 無線傳感器網絡定位方法及應用