apache / gravitino

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
https://gravitino.apache.org
Apache License 2.0
1.1k stars 345 forks source link

[Improvement] The REST API of List metalakes should sort by created time as default #2623

Open ch3yne opened 8 months ago

ch3yne commented 8 months ago

What would you like to be improved?

The Rest API of List metalakes should sort by created time as defaultTo achieve this default sorting behavior, the API endpoint for listing metalakes can be designed to automatically sort the results based on the "created time" field in ascending order. This way, users accessing the API will receive a sorted list by default, simplifying their experience and ensuring consistency in how the data is presented. By setting this as the standard behavior, users can rely on the API to consistently deliver results in a predictable and organized manner.

How should we improve?

Modify the return results of the List metalakes API.

mchades commented 8 months ago

Why not sort alphabetically by default?

ch3yne commented 8 months ago

Why not sort alphabetically by default?

Sorting by alphabetical order is also fine, because the current list looks unordered.

ajayl83 commented 8 months ago

@mchades @ch3yne is anyone working on this? can i pick up?

jerryshao commented 8 months ago

Shall we do it on the server side or on the UI side, what is your opinion @mchades @ch3yne ?

mchades commented 8 months ago

Shall we do it on the server side or on the UI side, what is your opinion @mchades @ch3yne ?

Currently, it seems that only the UI side has a sorting requirement, so I suggest doing it only on the UI side.

ch3yne commented 8 months ago

Shall we do it on the server side or on the UI side, what is your opinion @mchades @ch3yne ?

Currently, it seems that only the UI side has a sorting requirement, so I suggest doing it only on the UI side.

When loading with large amounts of data and complex sorting logic, it's generally recommended to have the backend return sorted results. However, since we currently don't have a large volume of data, the frontend can handle sorting when initially loading the list.

I think the REST APIs need to provide flexible sorting parameters to accommodate different use cases.

ajayl83 commented 8 months ago

@ch3yne so can this be picked up? if yes can you point me to the rest api classes ?

jerryshao commented 8 months ago

@ch3yne Currently, it is a heavy work for the backend to do the sorting and paging, we don't consider this in our API design, it requires the API redesign to support this. So I would suggest to do this in the frontend for now if urgent. For the backend, we should rethink the whole API design to see how to well support this.

ch3yne commented 7 months ago

I think we can start improve by the front end.

justinmclean commented 7 months ago

Sorting by ascending order would put new items at the bottom of the list, which would be inconvenient for a user if there's a long list.

ch3yne commented 7 months ago

Sorting by ascending order would put new items at the bottom of the list, which would be inconvenient for a user if there's a long list.

I agree to sort by time in descending order, and if the list is too long, we can filter by name or time range.