Needs advice
on
Node.jsNode.js
and
PythonPython

I have an online marketplace and I was wondering which framework will be better Django (Python) or ExpressJS (Node.js). I do plan on using ai, ml and do work on big data from transactions and customer preferences regarding products and such. I do understand that Python is slower than Node.Js and I am wondering if both are able to do microservices but, I am still open to some advice and solutions you have for me. Thank you for your help.

READ LESS
7 upvotes·22.5K views
Replies (3)
Independent Information Technology and Services Professional at DR. YORAM KORNATZKY LTD·

ML immediately tilts your decision towards Python as the ML ecosystem is in Python. Microservices can be programmed in Python. However, as you said, Python is slower than Node.js. This leads to a combination of both languages as the ideal solution. A problem in terms of skills, especially for a limited size team. It also raises the question of how you are going to connect the different microservices. If it is Kafka or MTMQ should not be a problem to connect services in the different languages. If you are limited in terms of size of team, choose Python. As you cannot go very far with Node.js for ML.

READ MORE
7 upvotes·3 comments·21.3K views
araz dev
araz dev
·
October 3rd 2022 at 7:49AM

Yes ML or AI thing is python but web developing then node js bc it is really fast enough

·
Reply
Aayan Rahman
Aayan Rahman
·
October 5th 2022 at 8:08AM

I am confused whether runtime speed or development and maintenance speed is more important? and if I put ml and ai in my site a bit later, will choosing Node.JS be better. what is the performance difference in runtime and development between Express.JS and Django?

·
Reply
Harald Fauland
Harald Fauland
·
October 6th 2022 at 5:44PM

when starting out the development and maintenance speed are way more critical. you can also throw hardware at your service for a long time before getting to a critical mass where you have to look into optimizing your stack.

·
Reply

With the info you have shared so far, here's my recommendation: 1. Python ecosystem is very sophisticated for ML, AI. Build models, and perform most of background work via python. You can expose these models and any business logic needed via python Fastapi. 2. Node and js ecosystem is great for building both server rendered and Single page apps - whichever your preference is. You can easily use something like Next.js and build out the marketplace web/mobile application, interact with ML models via an api or directly read the model from node backend. Hope this helps.

READ MORE
4 upvotes·3 comments·21.4K views
Aayan Rahman
Aayan Rahman
·
October 5th 2022 at 8:08AM

I am confused whether runtime speed or development and maintenance speed is more important? and if I put ml and ai in my site a bit later, will choosing Node.JS be better. what is the performance difference in runtime and development between Express.JS and Django?

·
Reply
Raj Chandrasekaran
Raj Chandrasekaran
·
October 6th 2022 at 7:55PM

Agreed with Yoram's response in this thread.

When you say you want to put ml or ai on to your site, could you elaborate that a bit more?

Since you mentioned online marketplace, my hunch is that you want to use ML or AI for recommendations, search results or even prioritizing the right ads for the shoppers. If that is the only place where you like to use ML / AI, that that part can (or needs to) work with your search infrastructure.

There are two modes of ML application - realtime, and offline

For realtime ML / AI application, there are lot of considerations you have to go through before finalizing the technology. For example, say you are using elasticsearch as your search engine and if you like "personalization" to be a factor in search results, you may want to do offline ML, prepare models, validate which features carry what weights and then apply those weights into your elasticsearch query.

Alternatively if you can also fetch all the results from ES and run through the model to sort them in the order that suits best for a single shopper. It adds more time to respond for search results, but if you can live with that latency that works.

If your usecase is you want to use ML just in offline scenarios, like building a model that satisfies some objective you may want to divide between the work that is needed to analyze, prepare model, test etc AND the work needed to invoke the model at runtime. You can totally use python tech stack for the former and use node js / next js / Blaze js / refine etc for the latter (since node can also invoke a model and return the results).

As a side note, if you are building an entire marketplace, like categories, listings, product page, search, purchase etc AND if the scale is not going to be too high, I would also recommend looking at woocommerce, shopify (paid), magento (open source) etc kind of options to put up a site together. There's a lot to build, not that it is impossible, but it will be more of reinventing the wheel imho.

·
Reply
Yoram Kornatzky
Yoram Kornatzky
·
October 6th 2022 at 7:27AM

If you know both at same level, then Express.js is faster in terms of performance and development and maintenance. And it does not preclude connecting to a ML backend model later. So you can have the bestow both worlds.

·
Reply
View all (3)
Avatar of Aayan Rahman