What are pros/cons Django vs. Py4web regarding very large scale, many-user, database intensive projects?

523 views
Skip to first unread message

Alex Glaros

unread,
Jun 5, 2022, 1:52:16 PM6/5/22
to py4web
What are pros/cons Django vs. Py4web regarding very large scale, many-user, database intensive projects?

Massimo

unread,
Jun 5, 2022, 7:29:13 PM6/5/22
to py4web
There should be no significant difference.

The main difference is syntax and whether you prefer the Django ORM which maps tables to Python classes and rows to Objects or the pydal which maps records to python dictionaries. I personally prefer the latter which is why pydal was written. It is closed to SQL.

The Django admin is better the py4web dashboard but the py4web Form/Grid logic is probably better for rapid prototyping custom forms and grids part of your app.

Massimo

Alex Glaros

unread,
Jun 5, 2022, 8:58:17 PM6/5/22
to py4web
" It is closed to SQL."  Did you mean it is "closer" to SQL?

Most of my projects heavily use SQL

Jim Steil

unread,
Jun 6, 2022, 10:00:56 AM6/6/22
to py4web
In my opinion, py4web is a great middle ground between django and flask.  django gives you everything (db, auth, admin) and you have to do things their way.  flask, being a micro-framework doesn't have a lot included with it.  You have to add on packages for db access (flask-sqlalchemy), forms (flask-wtf), auth (flask-login), admin (flask-admin), etc.

I think py4web has found the sweet spot in the middle.  It provides auth, templates, pydal, form and grid out of the box which you can use or roll your own.  They are very customizable to mold to your needs.

django and flask both have a lead on py4web in terms of documentation and examples.  But, py4web is getting better...

I really like the flexibility that py4web provides in terms of building CRUD forms.

-Jim

Luca de Alfaro

unread,
Jun 6, 2022, 12:14:53 PM6/6/22
to Jim Steil, py4web
In my opinion, if each web request has only limited amount of db use (only limited amount of read/write), the performance of the db system depends much more on the db engine and db server than on Django vs. py4web/pydal.  This simply because the overhead of pydal and of the Django object model is incurred in the web servers, which are scalable, and in any case it is not a large part of the total compute.

I have run into trouble using pydal in applications where a single request (or a single action) needed massive db interaction (tens of millions of rows read).  Clearly this is not typical of a well-designed web service, as your costs would go through the roof, but we had this into a few "Monitoring" interfaces.  In that case, all we needed was to write that small amount of code on top of (in our case) mysqldb directly.  pydal had overhead in creating rows for each record, and I suspect Django would also have overhead due to object creation for each record.

Luca


--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/cca2106d-5839-4742-b360-de3753f74143n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages