NoSQL Data Modeling
Data modeling for RDBMS has been a well-defined discipline for many years. Techniques like logical to physical mapping and normalization / de-normalization have been widely practiced by professionals, including novice users. However, with
Data modeling for RDBMS has been a well-defined discipline for many years. Techniques like logical to physical mapping and normalization / de-normalization have been widely practiced by professionals, including novice users. However, with the recent emergence of NoSQL databases, data modeling is facing new challenges to its relevance. Generally speaking, NoSQL practitioners focus on physical data model design rather than the traditional conceptual / logical data model process for the following reasons:
- Developer-centric mindset – With flexible schema (or schema-free) support in NoSQL databases, application developers typically assume data model design responsibility. They have been ingrained with the notion that the database schema is an integral part of application logic.
- High-performance queries running in massive scale-out distributed environments – Contrary to traditional, centralized scale-up systems (including the RDBMS tier), modern applications run in distributed, scale-out environments. To accomplish scale-out, application developers are driven to tackle scalability and performance first through focused physical data model design, thus abandoning the traditional conceptual, logical, and physical data model design process.
- Big and unstructured data – With its rigidly fixed schema and limited scale-out capability, the traditional RDBMS has long been criticized for its lack of support for big and unstructured data. By comparison, NoSQL databases were conceived from the beginning with the capability to store big and unstructured data using flexible schemas running in distributed scale-out environments.
In this blog post, we explore other important mindset changes in NoSQL data modeling: development agility through flexible schemas vs. database manageability; the business and data model design process; the role of RDBMS in NoSQL data modeling; NoSQL variations that affect data modeling; and visualization approaches for NoSQL logical and physical data modeling. We end the post with a peak into the NoSQL data modeling future.
Development agility vs. database manageability
One highly touted feature in today’s NoSQL is application development agility. Part of this agility is accomplished through flexible schemas, where developers have full control over how data is stored and organized in their NoSQL databases. Developers can create or modify database objects in application code on the fly without relying on DBA execution. The result is, indeed, increased application development and deployment agility.
However, the flexible schema is not without its challenges. For example, dynamically created database objects can cause unforeseen database management issues due to the lack of DBA oversight. Furthermore, unsupervised schema changes increase DBA challenges in diagnosing associated issues. Frequently, such troubleshooting requires the DBA to review application code written in programming languages (e.g., Java) rather than in RDBMS DDL (Data Definition Language) – a skill that most DBAs do not possess.
NoSQL business and data model design process
In old-school software engineering practice, sound business and (relational) data model designs are key to successful medium- to large-scale software projects. As NoSQL developers assume business / data model design ownership, another dilemma arises: data modeling tools. For example, traditional RDBMS logical and physical data models are governed and published by dedicated professionals using commercial tools, such as PowerDesigner or ER/Studio.
Given the nascent state of NoSQL technology, there isn’t a professional-quality data modeling tool for such tasks. It is not uncommon for stakeholders to review application source code in order to uncover data model information. This is a tall order for non-technical users such as business owners or product managers. Other approaches, like sampling actual data from production databases, can be equally laborious and tedious.
It is obvious that extensive investment in automation and tooling is required. To help alleviate this challenge, we recommend that NoSQL projects use the business and data model design process shown in the following diagram (illustrated with MongoDB’s document-centric model):
Figure 1
- Business Requirements & Domain Model: At the high level, one can continue using database-agnostic methodologies, such as domain-driven design, to capture and define business requirements
- Query Patterns & Application Object Model: After preliminary business requirements and the domain model are produced, one can work iteratively and in parallel to analyze top user access patterns and the application model, using UML class or object diagrams. With RDMS, applications can implement database access using either a declarative query (i.e., using a single SQL table join) or a navigational approach (i.e., walking individual tables embedded in application logic). The latter approach typically requires an object-relational mapping (ORM) layer to facilitate tedious plumbing work. By nature, almost all NoSQL databases belong to the latter category. MongoDB can support both approaches through the JSON Document model, SQL-subset query, and comprehensive secondary indexing capabilities.
- JSON Document Model & MongoDB Collection / Document: This part is where native physical data modeling takes place. One has to understand the specific NoSQL product’s strengths and weaknesses in order to produce efficient schema designs and serve effective, high-performance queries. For example, modeling social network entities like followed and followers is very different from modeling online blogging applications. As such, social networking applications are best implemented using Graph NoSQL databases like Neo4j, while online blogging applications can be implemented using other flavors of NoSQL like MongoDB.
RDBMS data modeling influence on NoSQL
Interestingly enough, old-school RDBMS data modeling techniques still play a meaningful role for those who are new to NoSQL technology. Using document-centric MongoDB as an example, the following diagram illustrates how one can map a relational data model to a comparable MongoDB document-centric data model:
Figure 2
NoSQL data model variation
In the relational world, logical data models are reasonably portable among different RDBMS products. In a physical data model, design specifications such as storage clauses or non-standard SQL extensions might vary from vendor to vendor. Various SQL standards, such as SQL-92 and the latest SQL:2008 as defined by industry bodies like ANSI/ISO, can help application portability across different database platforms.
However, in the NoSQL world, physical data models vary dramatically among different NoSQL databases; there is no industry standard comparable to SQL-92 for RDBMS. Therefore, it helps to understand key differences in the various NoSQL database models:
- Key-value stores – Collections comprised of unique keys having 1-n valid values
- Column families – Distributed data stores in which a column consists of a unique key, values for the key, and a timestamp differentiating current from stale values
- Document databases – Systems that store and manage documents and their metadata (type, title, author, creation/modification/deletion date, etc.)
- Graph databases – Systems that use graph theory to represent and store data as nodes (people, business, accounts, or other entities), node properties, and edges (lines connecting nodes/properties to each other)
The following diagram illustrates the comparison landscape based on model complexity and scalability:
Figure 3
It is worth mentioning that for NoSQL data models, a natural evolutionary path exists from simple key-value stores to the highly complicated graph databases, as shown in the following diagram:
Figure 4
NoSQL data model visualization
For conceptual data models, diagramming techniques such as the Entity Relationship Diagram can continue to be used to model NoSQL applications. However, logical and physical NoSQL data modeling requires new thinking, due to each NoSQL product assuming a different native structure. One can intuitively use any of the following three visualization approaches, using a document-centric data model like MongoDB as an example:
- Native visual representation of MongoDB collections with support for nested sub-documents (see Figure 2 above)
Pros – It naturally conveys a complex document model through an intuitive visual representation.
Cons – Without specialized tools support, visualization results in ad-hoc drawing using non-uniform conventions or notations.
- Reverse engineering selected sample documents using JSON Designer (see Figure 5 below)
Pros – It can easily reverse engineer a hierarchical model into a visual representation from existing JSON documents stored in NoSQL databases like MongoDB.
Cons – As of this writing, JSON Designer is available only on iPhone / iPad. Furthermore, it does not include native DB objects, such as MongoDB indexes.
Figure 5
- Traditional RDBMS data modeling tools like PowerDesigner (see Figure 6 below)
Pros – Commercial tools support is available.
Cons – it requires tedious manual preparation and diagram arrangement to represent complex and deeply nested document structure.
Figure 6
In a future post, we’ll cover specific data model visualization techniques for other NoSQL products such as Cassandra, which is based on the Column Family structure.
New NoSQL data modeling opportunities
Like any emerging technology, NoSQL will mature as it becomes mainstream. We envision the following new data modeling opportunities for NoSQL:
- Reusable data model design patterns (some product-specific and some agnostic) to help reduce application development effort and cost
- Unified NoSQL model repository to support different NoSQL products
- Bi-directional, round-trip engineering support for (data) model-driven design processes and tools
- Automated data model extraction from application source code
- Automated code-model-data consistency validation and consistency conformance metrics
- Strong control for application / data model change management, with proactive tracking and reconciliation between application code, embedded data models, and the actual data in the NoSQL databases
原文地址:NoSQL Data Modeling, 感谢原作者分享。

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

隨著網路的發展,大數據分析和即時資訊處理成為了企業的重要需求。為了滿足這樣的需求,傳統的關係型資料庫已經不再滿足業務和技術發展的需要。相反,使用NoSQL資料庫已經成為了一個重要的選擇。在這篇文章中,我們將討論SpringBoot與NoSQL資料庫的整合使用,以實現現代應用程式的開發和部署。什麼是NoSQL資料庫?NoSQL是notonlySQL

在許多中心化交易所出現問題後,越來越多的幣圈投資者開始將資產轉移到冷錢包中,以減少中心化交易所帶來的風險。本文將介紹全球最早的冷錢包供應商Trezor,自2014年推出首款冷錢包至今,在全球多個國家銷售。 Trezor的產品包括2014年推出的ModelOne和2018年推出的進階版本ModelT。以下將繼續介紹這兩款產品與其他冷錢包的差異。什麼是Trezor冷錢包? 2014年,Trezor推出了第一款冷皮夾ModelOne。除了常見的BTC、ETH、USDT等幣種外,該錢包還支援超過1000種其

在現代的網路應用程式開發中,PHP和NoSQL資料庫已經成為了非常受歡迎的技術選擇。在過去,PHP曾被廣泛應用於開發動態網站和Web應用程序,而NoSQL資料庫則是最近才出現的全新的資料儲存技術,它提供了更靈活和可擴展的解決方案。在這篇文章中,我們將會探討PHP和NoSQL資料庫在實際應用上的情況。 PHP是一種伺服器端程式語言,最初

NoSQL(NotOnlySQL)資料庫是近年來快速發展的一類資料庫,與傳統關係型資料庫相比,具有更好的可擴展性和效能,並支援更多的資料類型和資料儲存方式。其中,MongoDB是一款使用文件資料庫模型的NoSQL資料庫,被廣泛應用於Web應用、行動應用、物聯網設備等領域。本文將介紹如何使用PHP編寫MongoDB資料庫的基本操作,並透過實例示範如何滿足

nosql與mysql的區別是:1、MySQL是一個基於表格設計的關係資料庫,而NoSQL本質上是非關聯式的基於文件的設計;2、MySQL的嚴格模式限制並不容易擴展,而NoSQL可以透過動態模式特性輕鬆擴充等等。

隨著網路的快速發展,數據量也不斷增加。因此,資料管理成為了一個非常重要的課題。 NoSQL(非關聯式資料庫)已成為處理大數據問題的熱門解決方案之一。而Redis又是一款十分流行的NoSQL資料管理軟體。本文將分析比較Redis和其他NoSQL資料庫之間的異同點,幫助理解它們的特徵和優缺點。一、Redis概述Redis是一個基於記憶體的儲存系統,允許使用者使

隨著網路的發展,資料量越來越大,要對這些資料進行有效的儲存和處理變得尤為重要。 NoSQL(NotOnlySQL)資料庫因其高效能、可擴展性和便利性而備受關注,相比傳統的關聯式資料庫,它們更加靈活,適用於各種不同的資料處理場景。 MongoDB是一款非常受歡迎的NoSQL資料庫,在Java開發中也常被使用。本文將介紹在JavaAPI開發中

data資料夾裡面是系統及程式的數據,例如軟體的設定和安裝包等,Data資料夾中各個資料夾則代表的是不同類型的資料存放資料夾,無論Data資料指的是檔案名稱Data還是擴充名data,都是系統或程式自訂的資料文件,Data是資料保存的備份類別文件,一般可以用meidaplayer、記事本或word開啟。
