Enhancing paging in monasca components

Registered by Tomasz Trębski on 2015-10-15

Currently paging is handled by sorting UUID.
The concept is based on offset (uuid of the entity) and the limit, however that does not allow to implement previous button functionality due to following problems:

- offset (UUID) allows to go forward only because it is used as where condition - it is not a page but a slice of the data
- offset is a condition, should be a number of the page

Observed problems:
- no way to go back to previous page
- it is possible that some alarms cannot be seen
-- sorting (to perform paging) is based on UUID, it may happen that newer alarms will have "lower" UUID, therefore would be visible on previous pages instead of next pages

Expected results of the implementation:
- paging based on offset (i.e. page number, numeric value), limit (how many rows, numeric value)
- order of data in the tables always deterministic, based on order_key (i.e. sequence like value) and created_at timestamp

Affected components:
- monasca-schema
-- adding column -> order_key, fixed and deterministic value

- monasca-api (REST resources, services, repositories)
-- sorting with order_key and created_at
-- using page_number, page_size to get required amount of data
-- relying on underlying database capabilities for paging

- monasca-ui
--working with page_number and limit (instead of remembering the offset)

Tips:
- Most databases natively supports paging with pageNumber and limit (as numbers)

Blueprint information

Status:
Not started
Approver:
Monasca
Priority:
Undefined
Drafter:
Tomasz Trębski
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.