Open adrysn opened 2 years ago
Here is an old article about database schema design options for tags: http://howto.philippkeller.com/2005/04/24/Tags-Database-schemas/
Currently, tags are implemented by simply adding a string. AWS is similarly implemented in the form of writing a string, but the difference is that it is stored in key-value format. It seems to be far from the many-to-many relationship discussed in the issue.
There is a need to discuss how to implement it, either using it in AWS or managing it as a many-to-many relationship.
And since the tag function is currently implemented only in core, the webui must also respond to changes.
Let's implement this as a simple one-level key-value JSON object (using the postgres JSONB
column with a custom TypeDecorator
), following the EC2's tag specification and the more formal ECS tag specification.
Migrate the existing simple-string tags as {"Comment": "..."}
by stripping the values to 256 characters.
To use it as filter from the web UI and control panel, we also need to implement several JSONB operators as the queryfilter minilang operators. Also we need to update the FieldSpec
in the client SDK.
It will be useful for users or admins to add, remove, or filter compute sessions with tags just like we can tag AWS EC2 instances.
This issue depends on #325 to allow making foreign key refs to sessions, as tags will be represented as a many-to-many relation.