1 Bases de Datos NoSQL
Introduction to NoSQL Databases
What are NoSQL Databases?
- NoSQL databases are defined as those that do not conform to the relational data model, which is structured around tables with rows and columns.
- The term "NoSQL" stands for "not only SQL," indicating that these databases can utilize various data models beyond traditional SQL structures.
Characteristics of NoSQL Databases
- Unlike relational databases, NoSQL databases do not use the entity-relationship model and do not rely on SQL for data access.
- They feature a distributed architecture composed of interconnected nodes, allowing for horizontal scalability.
Data Structure in NoSQL vs. Relational Databases
- In contrast to relational databases that organize data in tables, NoSQL databases use collections where each row corresponds to a document.
- Indexing exists within NoSQL systems but operates differently; operations similar to joins in relational databases are replaced by lookup operations.
Document-Based Storage
JSON Format in Document Stores
- Document-based NoSQL databases store information using JSON (JavaScript Object Notation), which follows a key-value schema.
- Keys act as attributes akin to columns in relational models, while values can include nested documents or arrays.
Advantages of Document-Based Models
- This structure allows for more natural representation of complex data relationships compared to traditional row-column formats.
- A JSON document encapsulates various types of data including strings, nested objects, arrays, integers, and geospatial coordinates.
Popular NoSQL Database Systems
Leading Technologies
- Some widely used NoSQL database systems include Apache Cassandra (developed by Google), CouchDB, Neo4j, Firebase, and MongoDB.
Use Cases and Applications
- These technologies cater to diverse applications ranging from cloud solutions to mobile apps and web services.
When to Choose NoSQL Over Traditional Databases
Key Considerations for Choosing NoSQL
- Organizations may opt for NoSQL when dealing with rapidly growing datasets (terabytes), requiring scalable solutions for increased user loads or distributed architectures.
- Flexibility is another advantage; documents can have varying attributes without strict schema requirements.
Real-world Applications of NoSQL
Advantages and Disadvantages of NoSQL Databases
Advantages of NoSQL Databases
- High Performance and Low Resource Requirements: NoSQL databases can operate efficiently on systems with modest resources, eliminating the need for large servers.
- Horizontal Scalability: These databases allow for horizontal scaling by adding nodes, which enhances performance without significant infrastructure changes.
- Handling Large Volumes of Data: They can store vast amounts of information without creating bottlenecks in system performance.
- Flexibility in Data Storage: NoSQL databases offer greater flexibility regarding the types of data that can be stored compared to relational models.
Disadvantages of NoSQL Databases
- Lack of Reliability Functions: Unlike relational databases, NoSQL lacks constraints such as referential integrity, which may lead to data inconsistency.
- Increased Complexity in Security Schemes: The absence of built-in reliability functions necessitates additional programming for security measures within applications using these databases.
- Compatibility Issues with Query Languages: Searching through collections may require more processing power and time, especially when dealing with large datasets.
Introduction to MongoDB
Getting Started with MongoDB
- Popular Choice Among NoSQL Databases: MongoDB is highlighted as one of the most widely used NoSQL databases today.
- Installation Options: Users can choose between Enterprise or Atlas versions; however, the Community Edition is recommended for practice due to its free availability despite some limitations.
- Downloading Community Edition: Instructions are provided for downloading the Community Edition from the official MongoDB website, ensuring a straightforward installation process similar to other Windows applications.
Documentation and Resources
- Accessing Documentation: The documentation URL (docs.google.com) provides essential guides on installation and initial console operations.