Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Avalon Mongo Connection split #136

Closed
iLLiCiTiT opened this issue May 11, 2020 · 3 comments
Closed

Avalon Mongo Connection split #136

iLLiCiTiT opened this issue May 11, 2020 · 3 comments
Labels
type: enhancement Enhancements to existing functionality

Comments

@iLLiCiTiT
Copy link
Member

iLLiCiTiT commented May 11, 2020

It is required to split avalon's mongo connection out of avalon's Session! This is just practical issue, now we have io_nonsingleton but each time new object is created, new connection to mongo is created so one running pype may have 16 connections to mongo. This is too much for single application accessing the same data but from different table (collection).

Idea of implemetation:
1.) Singleton object caring only about connecting to Mongo DB. Let's call it AvalonMongoDB
2.) Class AvalonMongoConnection which can hold context. Let's call the context atttribute Session for backwards comaptibility.
3.) AvalonMongoDB should be used as current avalon.io so by default has one stored object of AvalonMongoConnection it's Session is filled with environments and is stored to avalon.api.
4.) At the same time AvalonMongoDB should have method like get_mongo_connection which returns new AvalonMongoConnection object with unfilled Session.
5.) This connection has it's own context but is using the same connection. Methods like install and uninstall remains but for AvalonMongoConnection the install method just mean to trigger creating of connection to mongo in AvalonMongoDB at the same time AvalonMongoDB should store booleans about each instance if the instance is marked as "installed". If all instances are not "installed" then connection to mongo is lost.

Let me know what you think, what names for AvalonMongoDB and AvalonMongoConnection would be best and what would you change. With this approach avalon is backwards compatible just adds new feature.

@iLLiCiTiT iLLiCiTiT added the type: enhancement Enhancements to existing functionality label May 11, 2020
@mkolar
Copy link
Member

mkolar commented May 12, 2020

Let's describe in more detail why we think this is needed and create an issue in avalon-core, as this would heavily affect it.

@iLLiCiTiT
Copy link
Member Author

This is currently required only because we want use Avalon's mongo connection in pype (in many places all with different context) so it's more our issue which may not be accepted.

But if we'll speak about using avalon tools in premiere, photoshop or other hosts without python, and have ability to have multiple opened those hosts at the same time, with one running listening server(rest api, websockets, etc.), then having this feature is one of first steps. I'll think about it.

@mkolar mkolar added the LOW label May 21, 2020
@iLLiCiTiT
Copy link
Member Author

Implemented with ynput/avalon-core#187

Tilix4 pushed a commit to Tilix4/OpenPype that referenced this issue Jul 11, 2023
Tilix4 pushed a commit to Tilix4/OpenPype that referenced this issue Aug 4, 2023
Tilix4 pushed a commit to Tilix4/OpenPype that referenced this issue Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Enhancements to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants