Addon vs Join

Options

I often have the option of referencing other tables via either Add-on (thur evals) or Joins. Which one should we prefer? Any criteria that can help us decide what fits more?

Answers

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    Addons are often easier to reason about and work with. I've got a quarter-century of working as a data scientist, and I would encourage starting there. I use them for most of my table connection use cases in Xano.

    There are more advanced use cases where joins make sense, but they are fewer in number than one might imagine.

    We work on multidimensional data relationships quite often in our office hours and forums on statechange.ai as part of our focus on the hardest 5%

  • MattLaro
    MattLaro Member ✭✭
    edited May 2023
    Options

    It is a very good question and it is a question I had for quite a while before deciding whether I want addons or joins.


    Addons is a great tool to standardize a subset of data… like a representation of a JSON Object. You can see it as a database view. Ex: If employee groups 3-4 tables together to have the full picture of what an employee is, Addon is great here! Whenever the users fetch or edits an employee, this employee will be represented the same way, every time. You use your addon everywhere it references an employee and it will always display the same way.

    Using joins is more of situational need to link tables for logic purposes. (Ex: Does a table have more than 5 children ? If so, do this. If not, do that).

    If you join tables together 10 times the same way in different parts of your logic, considering Addons will save you time both in future uses and maintenance of that data representation.

  • jakespirek
    jakespirek Member, Administrator

    ADMIN

    edited May 2023
    Options

    Another reason for considering Joins is if you want to sort your results based on that data you'd be getting from the Addon. For example, getting total votes/likes from another table for a specific record and then sorting your response based on that number.

    But Addons are definitely easier when they meet your needs! 😁