Question

I've got a text file of words and word frequencies. It's very large - theoretically we're talking millions of rows.

I just want to retrieve values from the file, and do it as quickly and efficiently as possible (for a web app, in Django).

My question is: what is the best way to store and retrieve the values? Should import them into SQL? Or keep the file and use grep? Or put them into a JSON dictionary...? Or some other way?

Would be very grateful for advice!

Was it helpful?

Solution

putting them in a json dictionary would be a bad idea unless you want to load the entire thing into memory when you search through it.

sql is basically built for this kind of thing, so i would use that. a file and grep would also work fine, but you wouldn't gain any benefits from indexing etc that sql would give you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top