6.0 Review
This week we are learning about NoSQL and we are working with MongoDB which is a non relational database. I'm learning a lot about how this dbms stores its information and the way that it is able to query information in a faster and more efficient way and the way that it is more flexible and scalable than its counterpart.
6.1 When would you use a relational database such as MySQL or Oracle versus some other NoSQL database?
I think you would use a relational database when your data is fairly small because once your database gets quite large, storing them in a relational database might not be as efficient as storing it in a NoSQL database since the NoSQL database like MongoDB are more flexible and can handle a lot more data. But overall, you would use one of these databases depending on what type of data you want to store. SQL is a relational based and organized database system while NoSQL has more flexibility which has better speed and scalability in managing large volumes of data.
When to use SQL:
- You’re working with complex queries and reports. With SQL you can build one script that retrieves and presents your data. NoSQL doesn’t support relations between data types. Running queries in NoSQL is doable, but much slower.
- You have a high transaction application. SQL databases are a better fit for heavy duty or complex transactions because it’s more stable and ensure data integrity.
- You need to ensure ACID compliance (Atomicity, Consistency, Isolation, Durability) or defining exactly how transactions interact with a database.
- You don’t anticipate a lot of changes or growth. If you’re not working with a large volume of data or many data types, NoSQL would be overkill.
When to use NoSQL:
- You are constantly adding new features, functions, data types, and it’s difficult to predict how the application will grow over time.
- Changing a data model is SQL is clunky and requires code changes. A lot of time is invested designing the data model because changes will impact all or most of the layers in the application.
- In NoSQL, we are working with a highly flexible schema design or no predefined schema. The data modeling process is iterative and adaptive. Changing the structure or schema will not impact development cycles or create any downtime for the application.
- You are not concerned about data consistency and 100% data integrity is not your top goal. This is related to the above SQL requirement for ACID compliance. For example, with social media platforms, it isn’t important if everyone sees your new post at the exact same time, which means data consistency is not a priority.
- You have a lot of data, many different data types, and your data needs will only grow over time. NoSQL makes it easy to store all different types of data together and without having to invest time into defining what type of data you’re storing in advance.
- Your data needs scale up, out, and down. As discussed above, NoSQL provides much greater flexibility and the ability to control costs as your data needs change.
6.2 How would you decide whether to use a document database like MongoDB versus a wide column database like Cassandra
Wide Column Databases, or Column Family Databases, refers to a category of NoSQL databases that works well for storing enormous amounts of data that can be collected. Its architecture uses persistent, sparse matrix, multi-dimensional mapping (row-value, column-value, and timestamp) in a tabular format meant for massive scalability (over and above the petabyte scale). Column Family stores do not follow the relational model, and they aren’t optimized for joins. Wide Column Databases are not the preferred choice for applications with ad-hoc query patterns, high level aggregations and changing database requirements.
Businesses Use Wide Column Databases to Handle:
- High volume of data
- Extreme write speeds with relatively less velocity reads
- Data extraction by columns using row keys
No comments:
Post a Comment