Sorted key lambda x. Key-value базы данных. sort(key=lambda x: x[0]). sort(key=func). alternative dynamodb.