1

I wrote a web application using Django to display products information.

My database (MySQL) contains ~200000 records ( fields: brand, name, and img). I want to add a search function to my app (the search is performed on brand and name fields).

I tried haystack with Whoosh, but I found it cost a lot of memory.

Can anyone suggest a way to do it? The application is expected running on a cheap AWS EC2 (small memory).

John Slegers
  • 45,213
  • 22
  • 199
  • 169
cityCoder
  • 65
  • 1
  • 7
  • Thanks for the help. I have figure out a solution. My current approach is using Xapian as haystack's backend. I picked this solution because it is easy to be integrated into a Django project. The memory consumption is very small (less than 100mb in my case), and it is also fast. – cityCoder May 10 '18 at 17:45

1 Answers1

-1

Memory vs speed is ultimately a trade-off. I would recommend Elasticsearch but the baseline memory requirement for that would be atleast 256 MB (mainly for the JVM). You can perhaps try using Typesense which has a much lower baseline memory footprint (probably less than 10 MB).

However, remember that speed vs memory is always a trade-off.

jeffreyveon
  • 13,400
  • 18
  • 79
  • 129