Skip to content

This is an example application of Flask-SQLAlchemy horizontal sharding.

Notifications You must be signed in to change notification settings

oshinko/flask-sqlalchemy-sharding-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask-SQLAlchemy Sharding Example

Python 3

This is an example application of Flask-SQLAlchemy horizontal sharding.

Installing modules

ENV=tmp
python3 -m venv $HOME/.venv/$ENV
$HOME/.venv/$ENV/bin/python -m pip install -U pip -r requirements.txt

Running server

FLASK_APP=app.py FLASK_DEBUG=1 $HOME/.venv/$ENV/bin/flask run

Using APIs

Post your account.

ACCOUNT_ID=me
ACCOUNT_NAME=Me

curl -d id=$ACCOUNT_ID \
     -d name=$ACCOUNT_NAME \
     http://localhost:5000/accounts

Get account.

curl http://localhost:5000/accounts/$ACCOUNT_ID

About

This is an example application of Flask-SQLAlchemy horizontal sharding.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages