

Show HN: Building a JavaScript Recommendation Engine with Graph Theory - keithwhor
https://medium.com/@keithwhor/using-graph-theory-to-build-a-simple-recommendation-engine-in-javascript-ec43394b35a3

======
tayo42
Any reason you why you wouldn't store edges in a database? Seems like they
don't ever change and your constantly recalculating them?

~~~
keithwhor
In our case, they're already in a database. You can generate them from a
simple query. (But there are a ton of rows in some tables. You don't want to
query from a SQL database for every graph transaction.) You can save your
graph to hard drive, which will save all nodes and edges, but it just
represents a cached version of your live data.

Process goes SQL -> Graph (RAM) <-> Cache (Storage).

Cache is for if / when the server reboots, so you can load the Graph quickly
without hitting your DB again, SQL -> Graph happens on timed intervals.

