NoSQL stands for “Not Only SQL”.
NoSQL database environment is, simply put, a non
relational, schema-less and largely distributed database.
Developed in late 2000s to deal with limitations of SQL databases.
Graph stores are used to store information about networks of data, such as social connections. Graph stores include Neo4J and Giraph.
There are still keys but they point to multiple columns.
These were created to store and process very large amounts of data distributed over many machines.
Examples of column-oriented databases are Cassandra and HBase.
Sample schema
User.find({
user_id: "123"
})
.then(docs => {
socket.emit("sync success", data);
})
.catch(err => {
console.log("err", err.stack);
});
An embedded document is when one document (often a structured text file, or a binary, or anything else is embedded within another.
{
_id: "123",
name: "Leo Messi",
address: {
street: "123 Fake Street",
city: "Faketon"
}
}
{
_id: "123",
name: "Leo Messi"
}
{
user_id: "123",
street: "123 Fake Street",
city: "Faketon"
}
{
_id: "123",
name: "Leo Messi",
addresses: [
{
street: "123 Fake Street",
city: "Faketon"
},
{
street: "1 Some Other Street",
city: "Boston"
}
]
}