The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [mongodb]

MongoDB is a scalable, high-performance, open source, document-oriented database. It supports a large number of languages and application development platforms. Questions about administrating it can be asked on dba.stackexchange.com

Filter by
Sorted by
Tagged with
55
votes
4answers
12k views

Why is using MySQL for a dictionary website a bad idea?

I'm planning to design and set up a database to store dictionary entries (usually single words) and their meaning in another language. So, for example, the table Glossary must have entry and ...
54
votes
8answers
18k views

Storing a re-orderable list in a database

I'm working on a wishlist system, where users can add items to their various wishlists, and I plan to allow users to re-order the items later on. I am not really sure about the best way to go about ...
47
votes
2answers
10k views

Strategy for generating unique and secure identifiers for use in a “sometimes offline” web app

I have a web based project that allows users to work both online and offline and I'm looking for a way to generate unique ids for records on the client side. I'd like an approach that works while a ...
14
votes
5answers
9k views

When should we use MongoDB?

MongoDB is a NoSQL database which I've found quite easy to use. Recently I had to develop a simple application which needed to collect some data using HTTP requests and store some results after ...
11
votes
3answers
10k views

Should backend IDs be public or not on a REST API?

Based on what this guy says: http://toddfredrich.com/ids-in-rest-api.html Let assume he is right about using UUID to identify the api resources. Then I run into troubles trying to implementing it ...
11
votes
2answers
5k views

Inserting JSON document with `.` in key to MongoDB

Firstly, this is more of a design question than a programming question. I am creating an application where I have to fetch existing JSON data and insert it into MongoDB. I found that some of the the ...
9
votes
6answers
11k views

Is MongoDB the right choice in my case? [closed]

I'm going to build my first real project in Rails that consist in a web app made of 3 main parts: The static part where no database is used The User registration part which will require a database ...
9
votes
1answer
11k views

How do I represent a schema diagram of my MongoDB database?

I have a MongoDB database that I want to properly document its schema design. I know that MongoDB is a NoSQL database and is schemaless by nature, but I do enforce a schema through my application and ...
8
votes
4answers
5k views

I want a trivial example of where MongoDB can scale but a relational database will have trouble [closed]

I'm just learning to use MongoDB, and when discussing with other programmers would like a quick example of why NoSQL can be a good choice compared to a traditional RDBMS - however the scenarios I come ...
7
votes
1answer
10k views

Architecture for a mobile (Android) chat application

I want to develop a chat application that reminds a bit whatsapp, I am doing it as a learning project. I am currently doing it on Android just because I am doing an Android course. The requirements ...
7
votes
2answers
8k views

How to model hashtags with nodejs and mongodb

Existing architecture: nodejs server with mongodb backend. I have strings coming in describing images that can have #hashtags in them. I wish to extract the hashtags from the strings, store the ...
6
votes
3answers
4k views

DDD - Aggregate Roots - Dealing with Efficiency and Concurrency

First off, I'll admit that I'm a newbie to DDD and need to read the "blue book". I'm building a system that has an AggregateRoot of type "Match". Each Match can have a collection of "Votes" and also ...
6
votes
2answers
12k views

How to represent a tree structure in NoSQL

I'm new to NoSQL and have been playing around with a personal project on the MEAN stack (Mongo ExpressJs AngularJs NodeJs). I'm building a document editor of sorts that manages nodes of data. Each ...
6
votes
3answers
856 views

Slow throughput - still worth using a dedicated message queue?

Here are some requirements for a queue: Every few days add ~100k tasks with various priorities Workers will pull tasks at typically less than 10 / second Tasks need to be completed by ~2 unique ...
6
votes
1answer
2k views

Why does MongoDB check for order of keys when matching embedded documents?

The db.collection.find() documentation includes this explanation of Query Exact Matches on Embedded Documents: The following operation returns documents in the bios collection where the embedded ...
6
votes
2answers
6k views

What is a good pattern for multi language in MongoDb?

Say I want to build a website that support multiple language and use MongoDB datastore. I wonder what is a good approach to have multiple versions of the body and title of an article, one for each ...
5
votes
2answers
9k views

What is a reasonable way to structure relationships in MongoDB

I am also using Node - which I am not the most familiar with - if the articles/books/tutorials pertained to this also - that would help even more. I come from a mostly MySQL background - but in this ...
5
votes
1answer
564 views

Storing OAuth2 data in Mongo?

Our system has users but we want to perhaps allow some users to be able to use our API service. I'm looking at using OAuth2 for authorization. As it's going to be (trusted) machine-to-machine access I ...
4
votes
1answer
680 views

what is sharding in MongoDB

i have just reading MongoDB.came across sharding but not getting what exactly is it .watever i understood is its better to have more small servers than a huge one for data storage and when data ...
4
votes
3answers
881 views

Is MongoDB appropriate for systems that will be likely to change?

I've been using MongoDb (mainly with Meteor) and for me, it has been a great way to mock up prototypes and proof of concepts quickly. I'm just wondering, after building the initial product, if your ...
4
votes
2answers
221 views

Does the use of mongodb enhance extending/changing database driven applications?

When an application is created which need to store data, an SQL database is used very often. So did I in a lot of asp.net applications. The resulting applications have often an ORM like the entity ...
4
votes
1answer
2k views

Should I / can I bundle node.js and mongod together with my application?

I'm working on a web application that runs on node.js and uses MongoDB. It's important to mention that I plan to release the application as commercial software. The way I wrote the installer, it asks ...
4
votes
2answers
75 views

Is it a good idea not to embed certain one-to-one relationships in a Mongo database?

I'm designing a NoSQL database schema - MongoDB in particular - and I'm wondering if it's a good idea not to embed certain one-to-one relationships. For one example, I have an accounts collection, ...
4
votes
2answers
3k views

Rails and Mongoid best way to implement sharing system

I have to model User and Board in rails using mongoid as ODM. Each board is referenced to an user through a foreign key user_id and now I want to add the ability to share a board with other users. ...
4
votes
1answer
773 views

Do serialization functions belong in a model or a controller?

I'm developing an application where: Models keep data as a multi-dimensional array, which are saved as-is to a MongoDB database. The model is used to provide methods to manipulate the data, and ...
4
votes
3answers
308 views

How would you represent an object that can be of multiple types, when storing it as a document in MongoDB?

Somewhat related to this question, say that I have an object category which, depending on which type of object I have, has different restrictions on what it contains. (if you can reword the previous ...
4
votes
2answers
195 views

Algorithm that generates a group of men and women who are each interested in everyone from the other gender

In my dating app, I need to compile lists of men and women where all of the men in the list are potentially interested in all of the women in the list, and vice versa. That is, in a list of 10 men ...
4
votes
3answers
2k views

Designing a Feed and Notification system in MongoDB

I'm developing a NodeJS API that will be consumed, for now, by an Android app. I need 2 important things here: a News Feed and a Notification system. And I need it to be scalable. I'm using ...
3
votes
4answers
1k views

Are NoSQL databases the best choice for more efficiently querying large amounts of data?

We are planning to build a travel website in which we will be integrating multiple APIs (eg. DOTW, GTA, Expedia) for Hotels. I have initially tried to use MySQL but since there are huge amounts of ...
3
votes
2answers
1k views

MongoDB: Is this a good schema design?

I'm working on a Meteor app which lets users create events and assign them crew members. I've played around with MongoDB before and made some experiences along the way, where for instance my first ...
3
votes
2answers
494 views

Advice on application architecture using MongoDB for intense multiplayer game

I am working on a multiplayer collectible card game. Server side is node.js + websocket.io. I am now considering which database to implement. I got really intrigued by MongoDB, mostly due to the fact ...
3
votes
3answers
2k views

generate unique sequential IDs in microservices architecture

I'm working in the context of a (kind of) microservices architecture where services can have multiple instances that can create new documents in the same collection of a Mongo DB. There is a ...
3
votes
2answers
114 views

Find incline of 50% within 30 minutes in a steadily increasing timeseries

I have a list of steadily growing values like 19:57(12.259), 19:58(13.101) stored in mongodb. Now I want to find out if the value grew 50% within 30 minutes within the last 3 hours. My first naive ...
3
votes
3answers
181 views

How to properly store messages in a webservice?

We are building a multitenant webservice with PHP and MongoDB. There is a need for communication between service employees and clients, communication can be established in many different ways. Some of ...
3
votes
2answers
616 views

Is it bad practice to generate ids for an object that does not yet exist in the database?

Here is the situation: There is a Mongo database A and there is Mongo database B. There is a business concept/Mongo object that is called someModel which exists on one of database B's collections. ...
3
votes
1answer
3k views

What is the recommended MongoDB schema for this quiz-engine scenario?

I'm working on a quiz engine for learning a foreign language. The engine shows users four images simultaneously and then plays an audio file. The user has to match the audio to the correct image. ...
3
votes
1answer
460 views

Best-matching comparative values using all items in array

I have two arrays of objects (items) in the exact same format. Each item represents a wager, and each array represents one of two outcomes for that wager (ex: Team A vs Team B). Both arrays look ...
3
votes
1answer
7k views

Storing data in elasticsearch vs mongodb

We are trying to create an online-shopping like application in which we have to store a huge amount of data,since the data that will be stored are mostly document like data, the suggestion was to ...
3
votes
0answers
919 views

NoSQL data modelling for multi level nested documents

What kind of NoSql data modelling is best suitable for the following requirement? This can be visualised (NoSQL-Document) as a Collection of Records where each Record contains nested Documents.The ...
3
votes
1answer
160 views

What is the canonical pattern for database design with MongoDB?

When it comes to laying out tables in transact SQL databases, like SQL-Server and Sybase, the classic approach to relational modelling is well established. (The authority being Halpin's book) ...
3
votes
0answers
198 views

How to model access rights in MongoDB versus SQL

I've started to implement a full MEAN-stack application (MongoDB, Express, Angular2, node) and I am struggling with the data design for the access management in the MongoDB. In my old thinking tracks, ...
3
votes
0answers
1k views

How to link the data of MongoDB and Neo4j?

I want to implement a system which store the profiles of employee and the resources that they have. There are many types of resources, such as the documents they produced, the techniques they have......
3
votes
2answers
2k views

Why is MongoDb popular with Node.js? [closed]

I've been looking att different web stacks, mainly rails and node.js. One thing that strikes me is that while rails is often used with a relational database Node.js seem to go hand in hand with ...
2
votes
1answer
2k views

Why is elastic search popular? [closed]

Elastic search is basically about indexing of data. In database world, Multiple indexes can be created on a MongoDB collection Collection in MongoDB can be schema-less. In MongoDB, BSON encoding ...
2
votes
3answers
516 views

Using MongoDB for not scalable application?

I have mainly worked on RDBMS databases. Recently studied MongoDB and liked where we don't have to define schemas upfront. So application developers straightaway can start writing the code. Major ...
2
votes
4answers
915 views

Using a relational and a non-relational database in the same project?

I ran into a problem on the project I'm working on right now. It is basically an app that stores a path based on GPS coordinates. The app runs on android an saves the GPS location every second and ...
2
votes
1answer
744 views

How to handle UI updates dependent on slow API responses

A side project I'm working on with some friends currently deals with an API interface that, for many reasons, is slow and cannot be changed to improve speed. I'm talking API responses that take ...
2
votes
1answer
190 views

How to make a basic database application, previously developed for 500 records, ready for 1 million records?

I have written a basic web app in PHP, using MongoDB as database engine. The app basically inserts records into database as they become available, and queries the database and displays the data as on ...
2
votes
2answers
440 views

creating nodejs apps in php/mysql framework with later on full step by step migration to nodejs in mind

I'm looking for the most efficient path to convert over time my own made php framework for nodejs and I believe that nodejs experts and specific developers who had their years working with apache/php/...
2
votes
1answer
2k views

Implementing tags in object

In my app, I'm implementing a questionnaire system and I'd like to implement tags for questions -- very similar to tags in questions here or Stack Overflow. I wanted to get some advices on how to ...