moonstream-to / api

Building blocks for your blockchain economy
https://moonstream.to
Apache License 2.0
135 stars 49 forks source link

Database connections managment. #1003

Open Andrei-Dolgolev opened 7 months ago

Andrei-Dolgolev commented 7 months ago

Moonstreamdb module

https://github.com/moonstream-to/api/blob/main/moonstreamdb/moonstreamdb/db.py

Currently we maintaine 2 connections to database with permissions Read/Write.

TODO:

We need create connection pool which can store RDS's connections and return them by customer_id.

Create Resolver.

        backend          |                               db module
`user_token` - > `user_id` -> `customer_id` -> RDS connection from sqlalchemy `customers_connections`