'Sorting and Filter Over PII Data

I have a large set of User PII data, currently, we are storing on Relational Data encrypted with AWS KMS. Now I have to paginate data based on UserName. The only we have to do right now is load all decrypted data on memory or cache and then do the sorting and pagination.

Please suggest any approach, Tool, or framework which supports sorting on PII masked data. Services are using Java as language.



Solution 1:[1]

If the data is being updated rarely then as an option - you can use the calculated order(rank function, user_name_order column) and order by that column instead of PII data.

you can create a cron job to update the rank or come up with some event for rank updating. example of event: onCreate/onUpdate a userName - recalculate all ranks(decrypt data, update user_name_order columns), etc..

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eugene Maksymets