The Python SQL Toolkit and Object Relational Mapper

What is SQLAlchemy?

SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.

SQLAlchemy is a tool in the Object Relational Mapper (ORM) category of a tech stack.

SQLAlchemy is an open source tool with 3.31K Github Stars and 883 Github Forks. Here鈥檚 a link to SQLAlchemy's open source repository on Github

Who Uses SQLAlchemy?

30 companies use SQLAlchemy including WakaTime, YOU-app, and MonkeyLearn Stack.

SQLAlchemy integrates with

Why people like SQLAlchemy

Here鈥檚 a list of reasons why companies and developers use SQLAlchemy.



Add a one-liner

Here are some stack decisions and reviews by companies and developers who chose SQLAlchemy in their tech stack.

Jeyabalaji Subramanian
Jeyabalaji Subramanian
CTO at FundsCorner | 23 upvotes 23998 views
atFundsCorner
Zappa
AWS Lambda
SQLAlchemy
Python
Amazon SQS
Node.js
MongoDB Stitch
PostgreSQL
MongoDB

Recently we were looking at a few robust and cost-effective ways of replicating the data that resides in our production MongoDB to a PostgreSQL database for data warehousing and business intelligence.

We set ourselves the following criteria for the optimal tool that would do this job: - The data replication must be near real-time, yet it should NOT impact the production database - The data replication must be horizontally scalable (based on the load), asynchronous & crash-resilient

Based on the above criteria, we selected the following tools to perform the end to end data replication:

We chose MongoDB Stitch for picking up the changes in the source database. It is the serverless platform from MongoDB. One of the services offered by MongoDB Stitch is Stitch Triggers. Using stitch triggers, you can execute a serverless function (in Node.js) in real time in response to changes in the database. When there are a lot of database changes, Stitch automatically "feeds forward" these changes through an asynchronous queue.

We chose Amazon SQS as the pipe / message backbone for communicating the changes from MongoDB to our own replication service. Interestingly enough, MongoDB stitch offers integration with AWS services.

In the Node.js function, we wrote minimal functionality to communicate the database changes (insert / update / delete / replace) to Amazon SQS.

Next we wrote a minimal micro-service in Python to listen to the message events on SQS, pickup the data payload & mirror the DB changes on to the target Data warehouse. We implemented source data to target data translation by modelling target table structures through SQLAlchemy . We deployed this micro-service as AWS Lambda with Zappa. With Zappa, deploying your services as event-driven & horizontally scalable Lambda service is dumb-easy.

In the end, we got to implement a highly scalable near realtime Change Data Replication service that "works" and deployed to production in a matter of few days!

See more
Pierre Chapuis
Pierre Chapuis
at Pierre Chapuis | 5 upvotes 1318 views
atChilli
Python
SQLAlchemy
Hug
Flask

Unlike our frontend, we chose Flask, a microframework, for our backend. We use it with Python 3.

One of the reasons was that I have significant experience with this framework. However, it also was a rather straightforward choice given that our backend almost only serves REST APIs, and that most of the work is talking to the database with SQLAlchemy .

We could have gone with something like Hug but it is kind of early. We might revisit that decision for new services later on.

See more

SQLAlchemy's alternatives

  • Hibernate - Idiomatic persistence for Java and relational databases.
  • Sequelize - Easy-to-use multi sql dialect ORM for Node.js & io.js
  • Doctrine 2 - An object-relational mapper (ORM) for PHP 5.3.2+ that provides transparent persistence for PHP objects
  • peewee - A small, expressive ORM -- supports postgresql, mysql and sqlite
  • Jugglingdb - Multi-database ORM: redis, mongodb, mysql, sqlite, postgres, neo4j, memory

See all alternatives to SQLAlchemy

Explore other Data Stores tools that are known for: