MongoDB

MongoDB

Application and Data / Data Stores / Databases
Senior Software Developer at IT Minds·
Shared insights
at
()

At IT Minds we create customized internal or #B2B web and mobile apps. I have a go to stack that I pitch to our customers consisting of 3 core areas. 1) A data core #backend . 2) A micro #serverless #backend. 3) A user client #frontend.

For the Data Core I create a backend using TypeScript Node.js and with TypeORM connecting to a PostgreSQL Exposing an action based api with Apollo GraphQL

For the micro serverless backend, which purpose is verification for authentication, autorization, logins and the likes. It is created with Next.js api pages. Using MongoDB to store essential information, caching etc.

Finally the frontend is built with React using Next.js , TypeScript and @Apollo. We create the frontend as a PWA and have a AMP landing page by default.

READ MORE
The Leading Web stack of an IT Minds Senior Developer. - DEV Community 👩‍💻👨‍💻 (dev.to)
14 upvotes·2.8M views
Shared insights
at

I'm working as one of the engineering leads in RunaHR. As our platform is a Saas, we thought It'd be good to have an API (We chose Ruby and Rails for this) and a SPA (built with React and Redux ) connected. We started the SPA with Create React App since It's pretty easy to start.

We use Jest as the testing framework and react-testing-library to test React components. In Rails we make tests using RSpec.

Our main database is PostgreSQL, but we also use MongoDB to store some type of data. We started to use Redis  for cache and other time sensitive operations.

We have a couple of extra projects: One is an Employee app built with React Native and the other is an internal back office dashboard built with Next.js for the client and Python in the backend side.

Since we have different frontend apps we have found useful to have Bit to document visual components and utils in JavaScript.

READ MORE
22 upvotes·2.9M views
Needs advice
on
MongoDBMongoDB
and
PostgreSQLPostgreSQL

Hi everybody, I'm developing an application to be used in a gym setting where athletes fill out a health survey, and coaches can analyze the results. However, due to the dynamic nature of some aspects of the app and more static aspects of the other, I am wondering if/how I would integrate MongoDB with my existing PostgreSQL database. I would like to store things like registrations, license information, and club information in Postgres, while I am thinking about moving things like user surveys, logging, and user settings information over to MongoDB. Some fields on the survey are integers, some large blocks of text, and some are arrays. My thought is, if I moved that data to MongoDB, it would give us greater flexibility in terms of adding and removing fields and data to them, and it would scale a lot easier than Postgres. Not to mention it will be easier to organize that kind of data. Is that overkill or am I approaching this issue the right way? Thank you!

READ MORE
8 upvotes·542.7K views
Replies (4)
CTO at Merryfield·
Recommends
on
PostgreSQL

You can have your cake and eat it too. If you really need the flexibility of a document store, Postgresql's JSONB support allows you to mix and match relational data and document data within the same database/table. You can just as easily run analytical queries against JSONB data in Postgresql as you can against "normal" relational data. MongoDB comes with a significant operational overhead and cost (hello replica sets), so unless you really need MongoDB's sharding capabilities (which you shouldn't until you get to extreme scaling numbers), then just stick with Postgresql and use JSONB where you need it.

READ MORE
7 upvotes·389.1K views
Recommends
on
MongoDB

With PostgreSQL you could easily integrate JSON or array type columns and develope a simple interface to add columns on your application. Anyway handling all the data this way will require some intermediate skill with PostgreSQL dialect and a mix and match of syntaxes for your analitical queryes. Also you will need to have a good design for you backend to handle all this. MongoDB will handle all this in a more natural way and I believe will be more easily integrated with a Node.js backend.

READ MORE
6 upvotes·1 comment·389.2K views
BrockHerion
BrockHerion
·
May 7th 2020 at 3:52AM

Thanks for the response. Analytics is definitely a big part of this project and I would agree that Mongo would probably handle it more naturally than Postgres. My backend is a 3-tier Java Spring REST API, but I'm toying with the idea of using GraphQL for managing the more dynamic data coming from Mongo.

·
Reply
View all (4)
Needs advice
on
MinioMinio
and
MongoDBMongoDB
in

I need to decide between Minio and MongoDB . The main features that I want to evaluate are :

  1. speed of save and retrieve documents;
  2. simply to develope of software for they use;
  3. costs;
READ MORE
2 upvotes·337.6K views
Replies (2)
Recommends
on
MongoDB

MongoDB is a NoSQL database to be more specific a document DB, meanwhile Minio is object storage like S3, but you can save unstructured files inside Minio like JSON. If you pick Minio as storage I will be faster then MongoDB to read and write due the fact that Minio do not build indexes, so you will be unable to query the files like a database (nevertheless it supports kind of lambda functions). In the other way MongoDB can do powerful queries over the data, like Geo queries, full-text searches, etc. So, better developer experience.

READ MORE
6 upvotes·903 views
Senior developer ·
Recommends
on
MongoDB

Comparing MongoDB and Minio S3 is like comparing apple and oranges, but your question lead me to believe you are looking for a primary document storage. As others have pointed out, there is no convinient way of doing a search across multiple S3 stored documents. Thst is not the main use case of Minio S3. S3 is an object storage which is good for storing and retreiving large files. You can query data within a large json file, but if you want to change the data you need to upload a new file/object.

When it comes to cost, Minio S3 will be cheaper as it is basicly free. MongoDB is also free, but the capacity to search for data combined with ACID capabilities cost system resources like memory and data nodes, which can be expensive. A 9 node HA cluster from MongoDB inc will quickly cost you 300.000 euro in setup and licensing costs, but you can ofcourse set it up and support MongoDB yourself, which is free. Minio will not consume that much memory, but you will be maintaining the minimum of 6 data nodes which does have a cost. Both MongoDB and Minio comes with libraries which are easy to use and quick to develop against.

READ MORE
3 upvotes·935 views
Needs advice
on
MongoDBMongoDB
and
MySQLMySQL

Hello, I am developing a new project with an internal chat between users. Also, there are complex relationships between the other project entities but I wolud like to build something scalable and fast and right now I am designing the data model. What kind of database would you recommend me to manage all application data? relational like MySQL, no relational like MongoDB or a mixed one? Thank you

READ MORE
6 upvotes·832.7K views
Replies (6)
Recommends
on
PostgreSQL
in

In MongoDB, a write operation is atomic on the level of a single document, so it's harder to deal with consistency without transactions.

READ MORE
5 upvotes·598.4K views
Recommends
on
MongoDB

MongoDB supports horizontal scaling through Sharding , distributing data across several machines and facilitating high throughput operations with large sets of data. ... Sharding allows you to add additional instances to increase capacity when required

READ MORE
4 upvotes·597.1K views
View all (6)
Needs advice
on
NestJSNestJS
and
SpringSpring

Hi, I have a project with a friend, and I'm hesitating between those two stacks. I want to make a simple application, with authentification (JWT) and MongoDB as a database. In the front-end part, we will use AngularJS. What should I choose?

READ MORE
2 upvotes·196.4K views
Replies (2)
Recommends
on
NestJS

I also recommend NestJS based on your description. Same language as the front end which is good as there are only two of you, and the structure of NestJS apps is inspired by Angular so it will feel very familiar. JWT and MongoDB also well supported (obviously that's the same for Spring too though).

We use it for all web applications, it's a great framework.

READ MORE
3 upvotes·1 comment·1.1K views
Daniel Glazer
Daniel Glazer
·
September 16th 2020 at 8:27AM

Support this answer... Even if you use angularJs still typescript and JavaScript are very similar

·
Reply
Recommends
on
NestJS

I would recommend to use NestJs as you have mentioned to make a simple application. As NestJs is easy to use and it uses Typescript. Additionally you can use mongoose with NestJs for MongoDB. Spring is awesome in case you need to develop a very complex and large application.

READ MORE
2 upvotes·1K views
Needs advice
on
MongoDBMongoDB
and
MySQLMySQL

I'm starting to work on a Jira-like bug tracker web app. This is a hobby project that is mostly a way for me to learn about different technologies and development processes(CI/CD, etc..) so I could be more ready when I start applying for programming jobs.

I'm debating between MySQL, which I'm less familiar with, and MongoDB which I have used in the past.

My two points of consideration are the following:

1) Which one is more likely to be relevant for web dev jobs? While I want to learn new technologies, I prefer learning ones that will make me more hireable in the future.

2) Which one is more flexible when it comes to changing the shape of the stored data? I expect to need to make some changes as the project goes on.

Thanks, everyone!

READ MORE
8 upvotes·146.4K views
Replies (2)
Recommends
on
MySQL

MySQL is still more popular than MongoDB if you look at Google Trends. I've also added MariaDB, which is pretty much a copy from MySQL and its features, and PostgreSQL, which is also a popular relational database.

This is a very good article for comparing MySQL to MongoDB and which one you should use: MongoDB vs MySQL: A Comparative Study on Databases.

If you just want to learn and you have the time, I would opt for using both MySQL and MongoDB. For example using MySQL for most of the site content and MongoDB for saving log messages. As you get more and more logs you start to see the benefits from MongoDB's faster document fetching.

READ MORE
7 upvotes·1 comment·69.1K views
Tyler Jordan
Tyler Jordan
·
February 19th 2022 at 9:57PM

Hi! Thanks for the answer.

I really like the idea of opting to use both for different scenarios, and I think that this is the one I will go for.

Thanks again :)

·
Reply
Freelance Developer at DGTEpro·
Recommends
on
Clickhouse
InfluxDB

There's really not an awful lot of difference between the two, they have wildly different storage mechanisms but they each have their fairly similar benefits. If you want to learn something that might be a requisite skill for a job, I would also look at alternatives such as time based and column based systems like InfluxDB and the unbelievably fast and flexible ClickHouse. While they may seem like an unlikely fit for a personal bug tracker app, there's no reason not to use them. Since I got into InfluxDB people have been requesting it a lot and I'll be using ClickHouse for all large databases, probably forever. Expand your horizons beyond your competition's.

READ MORE
4 upvotes·66.8K views
Needs advice
on
MongoDBMongoDB
and
PostgreSQLPostgreSQL

I need urgent advice from you all! I am making a web-based food ordering platform which includes 3 different ordering methods (Dine-in using QR code scanning + Take away + Home Delivery) and a table reservation system. We are using React for the front-end, and I need your advice if I should use NestJS or ExpressJS for the backend. And regarding the database, which database should I use, MongoDB or PostgreSQL? Which combination will be better? PS. We want to follow the microservice architecture as scalability, reliability, and usability are the most important Non Functional requirements. Expert advice is needed, please. A load of thanks in advance. Kind Regards, Miqdad

READ MORE
7 upvotes·337.5K views
Replies (3)
Senior DevOps Engineer at Vital Beats·

I can't speak for the NestJS vs ExpressJS discussion, but I can given a viewpoint on databases.

The main thing to consider around database choice, is what "shape" the data will be in, and the kind of read/write patterns you expect of that data. The blog example shows up so much for DBMS like MongoDB, because it showcases what NoSQL / document storage is very scalable and performant in: mostly isolated documents with a few views / ways to order them and filter them. In your case, I can imagine a number of "relations" already, which suggest a more traditional SQL solution would work well: You have restaurants, they have maybe a few menus (regular, gluten-free etc), with menu items in, which have different prices over time (25% discount on christmas food just after christmas, 50% off pizzas on wednesdays). Then there's a whole different set of "relations" for people ordering, like showing them past orders, which need to refer to the restaurant etc, and credit card transaction information for refunds etc. That to me suggests PostgreSQL, which will scale quite well if you database design is okay.

PostgreSQL also offers you some extensions, which are just amazing for your use-case. https://postgis.net/ for example will let you query for restaurants based on location, without the big cost that comes from constantly using something like Google Maps API to work out which restaurants are near to someone ordering. Partitioning and window functions will be great for your own use internally too, like answering questions of "What types of takeways perform the best for us, Italian, Mexican?" or in combination with PostGIS, answering questions like "What kind of takeways do we need to market to, to improve our selection?".

While these things can all be implemented in MongoDB, you tend to lose some of the convenience of ACID or have to deal with things like eventual consistency, which requires more thinking on the part of your engineers. PostgreSQL offers decent (if more complex) scalablity and redundancy solutions, and is honestly very well proven and plenty of documentation exists on optimising queries.

READ MORE
9 upvotes·248.7K views
Founder at Odix·
Recommends
on
MongoDB

Hello, i build microservice systems using Angular And Spring (Java) so i can't help with with ur back end choice, BUT, i definitely advice you to use a Nosql database, thus MongoDB of course or even Cassandra if your looking for extreme scalability with zero point of failure. Anyway, Nosql if much more faster then Sql (in your case Postresql DB). All you wanna do with sql can also be done by nosql (not the opposite of course).I also advice you to use docker containers + kubernetes to orchestrate them, if you need scalability and replication, that way your app can support auto scalability (in case ur users number goes high). Best of luck

READ MORE
3 upvotes·241.1K views
View all (3)
Needs advice
on
ElasticsearchElasticsearchFaunaFauna
and
MongoDBMongoDB

I would like to assess search functionality along with some analytical use cases like aggregating, faceting etc.,. I would like to know which is the best database to go with among Elasticsearch, MongoDB and FaunaDB.

READ MORE
3 upvotes·103.8K views
Shared insights
at
()

Repost

Overview: To put it simply, we plan to use the MERN stack to build our web application. MongoDB will be used as our primary database. We will use ExpressJS alongside Node.js to set up our API endpoints. Additionally, we plan to use React to build our SPA on the client side and use Redis on the server side as our primary caching solution. Initially, while working on the project, we plan to deploy our server and client both on Heroku . However, Heroku is very limited and we will need the benefits of an Infrastructure as a Service so we will use Amazon EC2 to later deploy our final version of the application.

Serverside: nodemon will allow us to automatically restart a running instance of our node app when files changes take place. We decided to use MongoDB because it is a non relational database which uses the Document Object Model. This allows a lot of flexibility as compared to a RDMS like SQL which requires a very structural model of data that does not change too much. Another strength of MongoDB is its ease in scalability. We will use Mongoose along side MongoDB to model our application data. Additionally, we will host our MongoDB cluster remotely on MongoDB Atlas. Bcrypt will be used to encrypt user passwords that will be stored in the DB. This is to avoid the risks of storing plain text passwords. Moreover, we will use Cloudinary to store images uploaded by the user. We will also use the Twilio SendGrid API to enable automated emails sent by our application. To protect private API endpoints, we will use JSON Web Token and Passport. Also, PayPal will be used as a payment gateway to accept payments from users.

Client Side: As mentioned earlier, we will use React to build our SPA. React uses a virtual DOM which is very efficient in rendering a page. Also React will allow us to reuse components. Furthermore, it is very popular and there is a large community that uses React so it can be helpful if we run into issues. We also plan to make a cross platform mobile application later and using React will allow us to reuse a lot of our code with React Native. Redux will be used to manage state. Redux works great with React and will help us manage a global state in the app and avoid the complications of each component having its own state. Additionally, we will use Bootstrap components and custom CSS to style our app.

Other: Git will be used for version control. During the later stages of our project, we will use Google Analytics to collect useful data regarding user interactions. Moreover, Slack will be our primary communication tool. Also, we will use Visual Studio Code as our primary code editor because it is very light weight and has a wide variety of extensions that will boost productivity. Postman will be used to interact with and debug our API endpoints.

READ MORE
19 upvotes·2 comments·2M views
John Akhilomen
John Akhilomen
·
April 1st 2020 at 3:00PM

I like the tech stack you guys have selected. You guys seem to have it all figured out, and well planned. Good luck!

·
Reply
Ne Labs
Ne Labs
·
March 9th 2020 at 12:34PM

RDBMS like Postgres can also store, index and query schemaless data as JSON fields, while also supporting relations where it makes sense. A document model is actually a downside, since usually data will still have relations, and it makes modeling them inconvenient.

·
Reply