NoSQL vs SQL

NoSQL と SQLの違い

f:id:lyrisist-lily:20210226190752p:plain

 

 

SQL and NoSQL represent two of the most common types of databases. SQL stands for Structured Query Language and is used in most modern relational database management systems (RDBMS). NoSQL means either “no SQL” (it does not use any SQL for querying) or “not only SQL” (it uses both SQL and non-SQL querying methods). NoSQL is generally used in a non-relational database (in that it doesn’t support foreign keys and joins across tables). The differences between SQL vs NoSQL databases include how they are built, the structure and types of data they hold, and how the data is stored and queried.

Relational (SQL) databases use a rigid structure of tables with columns and rows. There is one entry per row and each column contains a specific piece of information. The highly organized data requires normalization, which reduces data redundancy and improves reliability. SQL is a highly-controlled standard, supported by the American National Standards Institute (ANSI) and the International Standards Organization (ISO).

Non-relational databases are often implemented as NoSQL systems. There is not one type of NoSQL database. There are many different schemas, from key-value stores, to document stores, graph databases, time series databases and wide-column stores. Some NoSQL systems also support “multi-model” schemas, meaning they can support more than one data schema internally.

Unlike the ANSI/ISO processes for the SQL standard, there is no industry standard around implementing NoSQL systems. The exact manner of supporting various NoSQL schemas is up to the various individual software developers. Implementations of NoSQL databases can be widely divergent and incompatible. For instance, even if two systems are both key-value databases, their APIs, data models, and storage methods may be highly divergent and mutually incompatible.

NoSQL systems don’t rely on, nor can they support, joined tables.

 

ScyllaDB | NoSQL vs SQL

 

AWS が提供する主な NoSQL サービス

Amazon DynamoDB

DynamoDB は Key-Value 型データベース。

どのようなデータアクセスがされるかを設計段階で検討する必要があり、設計後の柔軟な検索要件変更には弱い。

DynamoDB は、パーティションキーによる完全一致、もしくはパーティションキー&ソートキーの組み合わせから検索クエリーを発行し、Item(レコード)を取得します。

この点はRDBMSの複合プライマリーキーと似ていますが、DynamoDB は、パーティションキーによる完全一致と、パーティションキーとソートキーの組み合わせでしか効率良い絞り込みが行えません。( 効率よくデータアクセス可能なキー設計を行えば、プロダクトがスケールしても低レイテンシーを維持可能 )

 

RDB設計者のための DynamoDB の解説!開発経験者が語る DynamoDB 設計入門🤔 | Ragate ブログ

 

  • ElasticSearch は検索用途に主に使用されるサービス