Needs advice
on
DjangoDjangoNode.jsNode.js
and
ReactReact

I would like to build a medium to large scale app, that has real-time operations and a good authentication system and a secure and fast API. Should I use Django with React only? Or maybe use Django for the API, Node.js for real-time operations and React for the frontend? Any suggestions? Which database should I use with those technologies? Should I use both MySQL / PostgreSQL and MongoDB together? Should I use only MongoDB or MySQL / PostgreSQL? Or is it better to go with both MySQL and PostgreSQL at the same time? Should I use also GraphQL?

READ LESS
3 upvotes·91.4K views
Replies (2)
Full-stack developer at Asteria·
Recommends
on
Django

Hey, George

TL;DR PostgreSQL + Django + React.js.

A few notes about Django: * Django includes own ORM which is able to work with SQL databases. In this case, you're able to use any SQL storage like a PostgreSQL / MySQL / etc., but you can't use MongoDB. * Django is synchronous web-framework. If you want to use asynchronous operations in the database, you have to choose another tool (aiohttp for Python or fastify.js for Node.js). * Django is stable. You don't need to worry about data consistency, etc. * Django-Rest-Framework is a great library for handling REST API requests. * django-channels is a library for handling WebSocket connections. * GraphQL is a great thing, but it requires additional knowledge for using it. (especially, performance knowledge).

A few notes about Node.js: * You have to choose Node.js web-framework. Node.js includes a lot of web-frameworks like a express.js, hapi.js, fastify.js, etc. * Node.js applications are asynchronous. It can give you additional performance. * You have to know about data consistency inside your own application. * You're able to use MongoDB or any SQL database because npm includes a lot of libraries that can work with databases. * You're able to use GraphQL because Node.js is a better choice for GraphQL. * You don't need to use additional libraries for handling REST and WebSocket connections.

So, my conclusion is using Django + PostgreSQL + React.js. For this stack, you can get more stability. If you need to get more performance, you have to think about some asynchronous languages (like a Node.js).

Take a look at Flask + SQLAlchemy + PostgreSQL + React.js. SQLAlchemy is a better ORM than Django-ORM.

I hope, it's useful for you :)

Best regards, Max

READ MORE
9 upvotes·1 comment·80K views
George Krachtopoulos
George Krachtopoulos
·
March 18th 2020 at 11:03AM

Thank you very much for your help!

·
Reply
Founder & CEO at BaseDash·
Recommends
on
PostgreSQL
at

Node.js is a great option for real-time applications, especially in conjunction with Socket.IO.

In terms of databases, I'd go with PostgreSQL. MongoDB has its benefits (schema-less, sharding, map-reduce), but for most CRUD-based apps, it makes sense to store the bulk of your data in a relational database (of which PostgreSQL is the best IMO). You can throw in MongoDB if you have a specific need for it. There's certainly no need to use both MySQL and PostgreSQL.

As for GraphQL, it can be nice to work with since you don't need to predefine specific data endpoints on your backend, instead shifting the power to your frontend in requesting the data it needs. It's also useful for public APIs, when you don't know what data users want (see Github's API). It can be useful at the early stage when you're prototyping and want to be able to fetch data quickly, but certainly isn't necessary.

At BaseDash we use Node.js, ExpressJS, Socket.IO, PostgreSQL, and Sequelize to fit our use case of database management and real-time operations.

READ MORE
5 upvotes·1 comment·101.2K views
George Krachtopoulos
George Krachtopoulos
·
April 6th 2020 at 4:23PM

Thank you, Max. I appreciate your help and advice. They are really useful.

·
Reply
Avatar of George Krachtopoulos