DEV Community

Bret
Bret

Posted on

Is R-M-Dj a stack? (React, MongoDB, Django)

What “stack” uses Django for backend? I know there’s “MERN”, but as far as a backend, I’ve gotten to know Django well.
Is that ok to use with React?

Latest comments (11)

Collapse
 
danim47c profile image
Daniel Mateos

I am an experienced developer with Django and for sure it's ORM is not optimized for a NoSQL database, it's true that there are some ways to connect them but you won't be able to take advantage of MongoDB's design.

Another point is that in my opinion, you shouldn't decide the stack you'll use in a project by the number of people that use it. The community is also important, but the main reason that should make you decide what stack to use depends on what application should do. Let me give you an example, for a realtime statistics app, you could use a MERN stack and you would not have any problem but it would be better if you use technology specially designed for it, in this case, I would have used Vue with DynamoDB and streams.

I don't know if I have explained myself but I hope you have understood what I tried to say.

Collapse
 
yobretyo profile image
Bret

Thank you! Well, with express, I haven’t really gotten the full picture of how to mainly use it, one way seems similar to how jinja templates is (kinda), but, I like the flow of react, so..... is MongoDB good to use with React and Django? I’ve been told that exspress is quicker to setup? But it seems like allot more

Collapse
 
danim47c profile image
Daniel Mateos

First, if you want to use Django or either Express, you should develop an API which you will connect through with React.

Django offers you a big system pre-designed for you to only add another things, I'm talking about authentication.
By the other hand, express, is only a web server framework, you can use middlewares but you would have to make everything by yourself.

As I told you before, you have to consider your use case because it's the main reason that should make you decide between them.

Thread Thread
 
yobretyo profile image
Bret

Ok, I know how to connect React to Django. is MongoDB better than sqlite3?

Thread Thread
 
danim47c profile image
Daniel Mateos

As I told you before, you won't take advantage of most of MongoDB's features because Django's ORM is designed for relational databases. Sqlite is not a production-ready database, is normally used for local dbs.

Thread Thread
 
yobretyo profile image
Bret

Ok, what would you recommend to use together for a retail site, e-commerce or social/blog websites? THANK YOU

Thread Thread
 
danim47c profile image
Daniel Mateos

A relational database such us MySQL or PostgreSQL with express

Thread Thread
 
yobretyo profile image
Bret

Ok, how about with a Django backend? What would you use for middle and FrontEnd? As far as “familiar”, I’m familiar with react and Django. Then I’ve used sqlite3

Thread Thread
 
danim47c profile image
Daniel Mateos

If you want a Django backend you should make an API to interact with, but for sure you can't use Sqlite in production

Thread Thread
 
yobretyo profile image
Bret

Ok, so MySQL? Not MongoDB??

Collapse
 
andy profile image
Andy Zhao (he/him)

I have no experience with Django, but I think any stack is a stack as long as it fits your needs. I think the terms MERN, MEAN, etc. have come about because they were popular options and people needed to make names for them.

IMO the stack you use is based on questions of familiarity, scalability, and how future-proof it is. Some examples of questions to ask yourself are:

  • how comfortable am I with Django, React, and MongoDB?
  • if I want to include others in the project, how difficult will it be to find people who know Django, React, and MongoDB?
  • is this a stack that can scale well? What are some technical limitations that I might foresee?
  • Are these technologies going to be harder to work with in the future, or harder to find people that know them? (for your case probably not)

And of course, sometimes if you just want to build something, you just build it! Go with whatever stack you like. If you need to change it in the future, that's another question you answer down the road. :)