Re: SQLAlchemy integration in Flask

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2021-12-06 at 18:36 +0100, Aurelien Bompard wrote:
<snip>
> Anyway, this long email is about finding a common ground for
> SQLAlchemy integration in Flask, while taking into account our
> difficult experiences with webframewoks in the past, but not being
> locked in them. Is there something that I misrepresented here? Do you
> have opinions? Preferences?

So, full disclosure, I'm normally just lurking on this list and am not
currently writing or maintaining code for the infrastructure team, so
my 2¢ probably isn't worth much more than that.

Having said that, in my day job, I've been writing a Flask API to
correspond with a massive database restructure using SQLAlchemy.  When
I started writing the API, I originally used Flask-SQLAlchemy for all
the reasons you listed above.  However, a couple of months ago I
stripped it out for a couple of reasons.

1. We're using a clustered database (CockroachDB, for those who care)
that uses optimistic concurrency, so automatic transaction retries are
a must, and we need control over how those retries are done.
2. We are using the same models for a couple of different projects (the
API itself and a script that is synchronizing between the old database
and the new), and not all the projects are built on Flask.  Initially,
I was able to get the sync script working with Flask-SQLAlchemy, but
things got ugly quickly when I started doing multithreading, so I
abandoned it and am now using Flask and SQLAlchemy separately.

In short, Flask-SQLAlchemy does a great job of tying together Flask and
SQLAlchemy if you're 100% sure that your project models will never be
required outside of Flask.  The minute you step outside of the Flask-
SQLAlchemy way of doing things, things start to go very wrong very
quickly.

Jonathan
_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux