GithubHelp home page GithubHelp logo

arnulfojr / sanic-persistance-patterns Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 26 KB

Sanic Persistance patterns

License: MIT License

Python 93.42% Dockerfile 6.58%
sanic aiomysql aiobotocore boto3 python3

sanic-persistance-patterns's Introduction

Sanic using Persistence layer

Spoiler alert!

NoSQL usage with PynamoDB (an ORM-like for DynamoDB) is only supported with sync (i.e. Flask, Sanic is async) code.

There's no migrations for DynamoDB but making simple migrations can be easily done.

Peewee offers more async support than SQLAlchemy's ORM.

DynamoDB

Use of aiobotocore and aioboto3.

Migrations in NoSQL

Migrations in NoSQL are kind of missleading, but the requirements are pretty much basic when talking DynamoDB.

To ensure tables are present, as DynamoDB requires it, a simple ensure_table method is required to create a table and avoiding to recreate and fail. In the same sense, downgrading would be deleting the table delete_table method is therefore present.

Updating indexes can be done in that sense, first ensuring the base table exists then updating the table indexes using botocore's API.

Therefore a simple upgrade and downgrade method is required.

For the full research, please refer to:

ORM

Usage of ORM through peewee.

Schema Validation

sanic-persistance-patterns's People

Contributors

arnulfojr avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.