Data relations

  • one to one
  • one to many
  • many to many

NoSQL

#multiple_documents_in_same_collection

A row is a document and collection is a column. #NoSQL_document #NoSQL_collection

SQL vsNoSQL

The performance of SQL (Structured Query Language) and NoSQL (Not Only SQL) databases can vary depending on the specific use case and requirements of your application. Here are some general considerations:

  1. SQL Database Performance:
    • SQL databases are known for their ACID (Atomicity, Consistency, Isolation, Durability) compliance, which ensures data integrity.
    • They are well-suited for complex queries and transactions, making them a good choice for applications that require strong data consistency, such as financial systems.

Note for above point it can be considered that if datatype restrictions are important for for SQL

  • SQL databases are typically vertically scalable, meaning you can increase their performance by adding more resources (CPU, RAM, etc.) to a single server.

Note #Horizontal_vs_Vertical_Scaling

  1. NoSQL Database Performance:
    • NoSQL databases offer high scalability and flexibility, making them a good fit for applications with rapidly changing data and high read/write loads, like social media or IoT.
    • They often provide betterhorizontal_scalability, allowing you to distribute data across multiple servers or nodes to handle high traffic.
    • NoSQL databases may sacrifice some ACID properties in favor of performance and scalability, which might be acceptable for applications where eventual consistency is sufficient.

In summary, the choice between SQL and NoSQL databases should be based on your specific application’s needs. SQL databases excel in scenarios requiring strong data consistency, while NoSQL databases are preferred for applications with high scalability and flexibility demands. Performance comparisons will depend on how well each database aligns with your use case and how you optimize them for your specific workload.

SQL vsNoSQL performance

The performance of Azure Cosmos DB and Azure SQL Database can vary depending on several factors, including your specific use case, configuration, and workload. Both databases are designed to serve different purposes, so the “faster” option depends on your application’s requirements:

  1. Azure Cosmos DB:

    • Azure Cosmos DB is a globally distributed, multi-model NoSQL database service. It is designed for high availability, low-latency access, and global scalability.
    • It excels in scenarios where you need to distribute data across multiple regions or globally, such as for globally distributed applications or IoT solutions.
    • Azure Cosmos DB offers tunable consistency levels, allowing you to balance between strong consistency and low latency, depending on your needs.
  2. Azure SQL Database:

    • Azure SQL Database is a managed relational database service based on SQL Server. It’s ideal for traditional relational database workloads.
    • It provides strong ACID compliance, which ensures data consistency and reliability.
    • Azure SQL Database is well-suited for applications that require complex querying, transactions, and relational data modeling.

The choice between Azure Cosmos DB and Azure SQL Database depends on your application’s requirements. If you need global distribution, high availability, and low-latency access to unstructured or semi-structured data, Azure Cosmos DB might be the better choice for performance. If you have a traditional relational database workload with strong consistency and complex queries, Azure SQL Database may be faster for your needs.

Ultimately, to determine which is “faster” for your specific use case, you should conduct performance testing and consider other factors like scalability, data modeling, and cost efficiency in your decision.