Hacker News new | ask | show | jobs
by gilgamesh327 1573 days ago
I'm learning data analysis/science and Anki's database has been something I'm playing with, it was an insightful read since I was thinking in a similar way about the `id` column and how things can get messy with a time-related value.

I've seen the author reply here, if you don't mind me asking, are there other ways to represent this database? Is there a useful exercise I can perform to do so? e.g. NoSQL version or similar, thank you.

1 comments

[Author here.]

There are definitely other ways to represent this data! I think a useful exercise is:

(1) Sit down and think of a very basic representation of this data (in whatever language you prefer). (2) Figure out where in the current SQLite database the relevant information lives. (3) Write a function that is given some relevant set of rows from this database and returns an item in the representation you determined in (1). (4) Test it. (5) Think about how to persist it.

You can do some subset or superset of these as you see fit, but I do think it's valuable to think about how to represent the relevant objects before you worry about persistence details.

Thanks for your comment!