I would recommend storing the data in Postgres (advanced open source database). See how searching the table compared to using find.<p>You can optimize further by adding indexes. Postgres supports indexing based on regular expressions so that if there are particular regular expressions that you often search for, you can index on that.