Search code examples
databasefunctionpaginationcrud

What's the difference between CRUD and CRUDL?


I don't understand the difference between read and list. According to Wikipedia:

The acronym may be extended to CRUDL to cover listing of large data sets which bring additional complexity such as pagination when the data sets are too large to hold easily in memory

The way i see this is just a read, and if you decide to support pagination, your result will be paginated. It doesnt fundamentally change the way in which someone interacts with the system. You are fundamentally returning data i.e. read. And what if you want to paginate read results? Does that then make it a list?

Im currently on a project where we are being ask to support both a list and a read, and other than the pagination, I'm struggling to see any implementation differences.

Are there other reasons you should separate read and list into their own functions


Solution

  • I have never seen a definitive definition of what "list" means in a CRUD context, but I have implemented quite a few systems that uses a CRUD approach. Here's some items you might consider for separating "list" operations from "read" operations:

    • Additional searching/filtering parameters (while "read" typically returns one or all items of a kind)
    • List methods may return "shallow" objects for faster access (where objects from "read" methods are large/expensive)
    • Pagination (as you already mention)
    • Some might even consider all methods returning multiple objects "list" operations (where "read" operations return only one item)

    But I have to agree with you. None of these fundamentally change the way you interact with the system. It's basically still reading data, perhaps just a little smarter.