Create thing vs add to list with WU in mind

Now that we have to think about Work Units, what approach would be best for adding a list of items that a user has to a record? I understand it was best practice to not go over 100 items in a list, but my users can store up to 1000 items per record. Its simply a count of items that im looking for at the end of the day, does it still make sense (WU wise) to save this as 1000 data entries or 1000 items to a list?

The items being stored to the list is a reference to another item in the database, to indicate the user has that item.

If all you need is the count, then it makes no difference.

But for general performance reasons, don’t store large lists (I’d say no more than 20 things) directly on a datatype…

Although it does depend on what you’re planning to do with that datatype and where and how it will be loaded. In some cases there is no harm in storing hundreds or even thousands of items on a list.

In some cases, it can make a lot of sense (both for performance AND WU) to store a list on a satellite datatype.

But again it really depends on what you’re doing.

Thank you for the reply.

What I am wanting to create is a list of catalog items that belong to a user (each item is a record in its “item” datatype). I have a check box element that will write to the database that the user has that item, If a catalog has 100 items, I just want to show that a user has a certain % of the overall catalog items in their list.

When you say it makes no difference, does it take the same amount of WU to write to a list than it does to create individual records?

Well I definitely wouldn’t advise storing a list of 100 items or more on the User datatype…

A satellite datatype with a list is the best way (in terms of WU) to store lists of up to a few hundred things, so I’d probably do that.

When you say it makes no difference, does it take the same amount of WU to write to a list than it does to create individual records?

I meant it makes no difference in terms of getting the count.

There is a difference in terms of creating the list… creating a list (of things) will cost more than just creating the thing.

1 Like

I do have a data type called “Users Catalog” that has a reference to the catalog datatype as well as a reference to the user. Im wanting to know if I should create a Users Item datatype and reference the Users Catalog record, or create a list field in Users Catalog record with each Item reference. In either case, the user could create up to 1000 items. Average being around 300

It really does depend on how you’re intending to use that data and where…

Remember, whenever you load a thing from the database, ALL fields are loaded.

So if you have a thing with a list field of 100 things, that field alone will load 100 unique IDs (3300 characters of data).

Now, that’s no big deal at all…

But if you’re loading a list of those things (in a RG for example), maybe 50 or 100 things, each of which has 100 things on a list field, well now that’s 10,000 unique IDs (330,000 characters of data) being loaded to the page (just from that field), which is going to be costly in WU and performance.

So, you see, it’s really not a simple question, and there’s no one-size-fits-all answer.

As I said, the best way (in both WU and Performance) depends entirely on the many intricate specifics of your app, the amount of data involved, the size of the data involved, and how often it’s being loaded.

In my own testing, storing lists on a satellite datatype is by far the best way to handle lists of several hundred things.

By 2000 things, that’s no longer true.

I haven’t yet established at what point between a few hundred and 2000 the change occurs (but that’s in my own testing - a different app might get different results, for all the reasons mentioned above).

So, aside from gaining as much understanding of performance and WU as you can, I’d recommend doing your own testing in your own apps to see what works best in your specific circumstance.

1 Like

Thank you very much I appreciate the time and explanation! I did not consider the repeating group also loading the list which might not be ideal since I just have a page showing the users catalog lists (no need to load the users items if its not shown). Im working on showing the users item once they click into a users catalog.

I appreciate the help I got some thinking to do.

1 Like