Sunday, 12 February 2023

MySql Database

1. Database In General

Relation database, Document database. 

Database Table Relationships

One to one:

mainly used for optimize a big table into two, one table contains often-visited columns, and another one contains rarely-visited columns. By this way, min. IO operations, i.e. reducing the amount data set that need to be loaded from persistences to memory.   

One to many: 

one entry ref. to many entries in another table

Many to many:

mutually ref. to many entries.

Self-reference:

entries ref. to anther entry located at the same table. 


Appendix 1. 

When we use SQL database, and when we select NoSQL database

SQL (Structured Query Language) databases and NoSQL databases are both types of databases that can be used to store and manage data. The choice between the two depends on several factors, including:

SQL databases are best suited for structured data, meaning data that can be organized into tables with defined relationships between the tables. This type of data is well suited for tasks such as financial reporting, where data is typically highly organized and predictable. SQL databases are also well suited for applications that require complex transactions, such as banking or e-commerce, where data consistency and integrity is critical.

NoSQL databases, on the other hand, are best suited for unstructured or semi-structured data, meaning data that doesn't fit neatly into a fixed table structure. NoSQL databases are often used for big data and real-time web applications, where data is generated at high volumes and speeds and needs to be processed and analyzed quickly. They are also well suited for cloud-based applications and distributed systems, where horizontal scalability is important.

In summary, the choice between SQL and NoSQL databases depends on the type of data you need to store and the demands of your application. If you have structured data and need to support complex transactions, an SQL database may be the best choice. If you have large amounts of unstructured data and need to handle real-time data processing, a NoSQL database may be a better fit.

 
 




No comments:

Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...