Example of a JSON Document
A JSON document for a customer profile in an online store is like a digital form where you fill in all the details about a customer. It includes things like their name, address, email, and phone number, organized neatly so that computers can understand and use the information easily.
JSON
{
"customer_id": 12345,
"name": "John Doe",
"email": "john.doe@example.com",
"address": {
"street": "123 Main Street",
"city": "Anytown",
"state": "CA",
"zip": "12345"
},
"purchase_history": [
{
"order_id": 1000,
"items": [
{
"product_id": 1,
"name": "T-Shirt",
"price": 25.00
},
{
"product_id": 2,
"name": "Hat",
"price": 15.00
}
]
},
{
"order_id": 2000,
"items": [
{
"product_id": 3,
"name": "Jeans",
"price": 50.00
}
]
}
]
}
The customer document has all sorts of info about a person, such as their ID, name, email, and where they live. Inside, there’s even more detail about their address. Plus, it keeps track of what they’ve bought before, listing out their past orders and what products they got.
Why NoSQL JSON Databases Are So Useful
NoSQL JSON databases are replacing traditional relational databases for scalability and flexibility. With schema-free design, they excel in handling unstructured and large datasets, making them ideal for agile development and diverse applications with evolving requirements.
It stores data in a human-readable format in JavaScript Object Notation(JSON). In this article, we will learn the reasons why the NoSQL JSON databases are useful.