1

What is the best way to handle 20,000 simple records? The records need to be searchable and linked to categories. What is the best way to handle so many records when each records or entry would be a simple phrase 5-10 words max.

I thought of categories but thinking 20k anything has to be thought out. Since categories may or may not be most efficient, any ideas or way that you have done this in the past before with success?

  • Can you expand on what you mean by "handle 20,000 simple records"? Do you mean you have 20,000 entries that need to be organised into categories and be searchable? If that's the case then that's pretty much a case of creating 20,000 entries assigned to categories. – foamcow Apr 7 '18 at 11:00
  • I have 20,000+ short phrase records. To simplify it, the records are airplane parts. There will be no other info but the fact of the name of the part. So from what you are saying, entries and categories, there is no difference on performance? – Vin Apr 7 '18 at 19:03
2

In sake of performance it would be better to create a custom field type and one or two record(s).

You can store your information/records in a separate table and link them with their ID to a category. Craft CMS will create a record in at least 4 tables for every elements and it has to join those tables to populate it. So an additional amount of 20k will decrease your performance for sure.

It's better to create a separate table rather than using categories for this task. You can combine your records with other elements with an normal Query like Craft does it with it's ElementCriteriaModel.

It's going to be much more work if you are not used to Craft but it will help you in the future as a good practice

  • Thanks Robin that is a good idea. So taking those records and putting them into a table outside of the normal Craft environment and using a Query to intersect the info with the native Craft environment like categories or entries? – Vin Apr 7 '18 at 19:07
  • 1
    Yes - I wouldn't call if outside of Craft environment since it's the idea and philosophy behind Craft to customize things and enable you to do it... But yes – Robin Schambach Apr 7 '18 at 20:45
  • Doing it that way would change things a bit but make the data more raw which would speed up the site in comparison to having it within categories or entires. Thanks for helping me hash that out. – Vin Apr 7 '18 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.