![]() The resulting models and relationships will tend to be simpler, faster, and more durable (of course, at the expense of normalization and data integrity). Maybe the reviews are modeled into the products altogether. In the NoSQL camp, you’d ask, what’s the most common way that user data will be queried? Maybe instead of relationships between reviews, products, and customers (reviewer), we could just store the customer data on the Review itself. When modelling out a product review system (e-commerce) in a relational db environment, you’ll probably end up relating at least 3 tables (normalized). When you start the mongo image, you can adjust the initialization of the MongoDB instance by passing one or more environment variables on the docker run command line. There’s a saying in the Mongo ecosystem about modelling your data the way you’d want to query it. ![]() It shifts the way developers thinks about modelling. Also, due of the lack of coupling, there are unlikely to be a plethora of existing relationships that need to be honored or are brittle. Nothing breaks, you just end up fetching no data. Lets say you drop an entire collection and existing live code is still querying for that data. MongoDB container runtime logs Figure 3.9 MongoDB Compass download page. ![]() In a relational database you got to worry about whether a new column exists, before your code attempts to query for that column. It downloads the image from DockerHub and creates an instance (container) from. Additionally, this command changes the name of the container to mongodb: sudo docker run -it -v mongodata:/data/db -name mongodb -d mongo. The /data/db directory in the container is mounted as /mongodata on the host. There’s nothing to deploy to the database itself. Start the Docker container with the run command using the mongo image. Simply save out your model differently, lets say we end up adding a new key to a collection (table). ![]() There’s no need to commit a plethora of sql alter / drop scripts. Example: you’ve developed an interface + model for a client, and they’re changing their minds about stuff or adding features every other week. It allows for faster iterative development in an environment where specifications are shifting, or have not quite been defined yet. There are many answers to this question if you do some research.įor me, the impact is felt in 2 major ways. We are using Mongo to power non-transactional CRUD stuff. ![]()
0 Comments
Leave a Reply. |