No, though I used to think this as well. The way your data is organized has a profound effect on the shape of the software that manipulates it. Imagine one scenario where user information is stored in a document format, but an important attribute is stored on a separate server that requires per-user authentication. Compare this to a scenario where the data for all users is encrypted and can be stored locally. In one, you are able to download a single block of data and render the entire list of users in milliseconds, with additional details immediately available if you authenticate and get a decryption key. In the other you can only search for users, and potentially not even render them except for the logged in user. All of your calls must be async, because they are all slow, and must be individually designed to accommodate the various ways they can fail. Your UI must constantly deal with partial data, etc.

Fred Brooks said in The Mythical Man-Month: "Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won’t usually need your flowcharts; they’ll be obvious."

Reply to this note

Please Login to reply.

Discussion

yes this is a good point, the most important and frequently accessed data should be closest to the lowest level cpu caches. Unfortunately most devs are so abstracted away from this idea these days.

This is another reason i love nostrdb’s design. All the nostr data is always hot in cache, and is in a compact binary format for cache efficiency, and even lmdb has an optimial cpu cache structure. The effect is very noticeable.

It also completely changes the way I built notedeck compared to damus ios. No async db calls, since its fast enough to do in realtime at 144fps. No need to keep ui in sync with the db. Each frame always has the latest version. Works offline. Greatly simplifies building nostr apps.

So in other words you are correct, but it’s a very subtle point!

Yes, it's a subtle lesson, and usually learned from decades of frustration. You seem to be most of the way there though!