Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8197483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:45:01+00:00 2026-06-07T05:45:01+00:00

I have a good resource hierarchy set up in my REST server, but I

  • 0

I have a good resource hierarchy set up in my REST server, but I have one use case that is confusing me.

We have a fairly typical project/group setup, and referencing all of the groups in a project is easy enough. Sometimes, though, I want all groups with a given status (across all projects). This is clearly not possible in a standard subresource hierarchy.

The only clean solution I see is to have groups as a resource and a subresource (as they are addressable with a unique key) at the same time. I’ve thought about this notion of “aliasing” a resource before (addressing the same resource in two different ways), but I’m not sure of the best way to express that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:45:02+00:00Added an answer on June 7, 2026 at 5:45 am

    If you want your application to be scale-agnostic, it’s best to think of your fundamental resources as uniquely-identified entities (see Helland) but allow for indices on them to be exposed. The most common form of index is a collection that contains its items, using the hierarchical nature of HTTP URI’s:

    GET /groups/
        200 OK
        {"entities": [
            "/groups/1/",
            ...
            "/groups/212/",
            ],
         }
    

    We might call that the “primary index”. But there are many other possibilities:

    GET /projects/foo/groups/
        200 OK
        {"entities": [
            "/groups/7/",
            "/groups/182/",
            ],
         }
    
    GET /groups/by_status/ACTIVE/
        200 OK
        {"entities": [
            "/groups/13/",
            "/groups/64/",
            ],
         }
    

    Be careful with these alternate indices, however, as they tend to get out of sync with reality, especially when you throw multiple servers and caches into the mix (read Helland’s paper). This is why the example output above consists of links, not copies of the atomic entities themselves. For the same reason, you do not want to have two URI’s which identify the same atomic entity. That will lead to stale data and lost updates as multiple clients obtain multiple copies of the same data.

    If an entity is truly identifiable by two distinct identifiers, such as a numeric id and a unique name, then pick one to be canonical and have the other redirect to it:

    GET /groups/by_name/bar/
        303 See Other
        Location: /groups/44/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anybody have a good analogy (or, failing that, a good resource) for describing
I have yet to find a good resource that doesn't include GLUT as it's
I have problem with Activities navigation, searching works good. Activities hierarchy looks like that:
I'm wondering if anyone have a good resource for working with Corba in Python?
Googling this does little good, as you can imagine. Does anyone have resources that
Can I have good example or code about how to use Ajax Datepicker in
I have a certain project that has a resource directory with a .resx for
In my search for a good, freely available resource that will teach me C++
I realize that the phrase good practices is a bit dubious and overused, but
Does anyone have a good resource/pack for royalty free icons to be used in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.