You don’t have to use a database to store those details. Imagine each folder/note/file having a small file which denotes the current details; example below. This method has been used by many apps. The only downfall is startup time. That being said, I am not currently having an issue with the lack of custom sorting. I use Notes to list out the items in a custom/filtered order with internal links to the actual Note.
<node>
<version>6</version>
<dict>
<key>expanded</key><true/>
<key>title</key><string>Games</string>
<key>nodeid</key><string>40e1e79d-e47c-43a7-8a23-358f481a5f67</string>
<key>modified_time</key><integer>1444501376</integer>
<key>version</key><integer>6</integer>
<key>content_type</key><string>application/x-notebook-dir</string>
<key>created_time</key><integer>1444501376</integer>
<key>info_sort_dir</key><integer>1</integer>
<key>order</key><integer>6</integer>
<key>info_sort</key><string>order</string>
</dict>
</node>
ce