Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB

  1. Home
  2. General Discussion
  3. They also are ActivityPub objects that expand to the full id ✨

They also are ActivityPub objects that expand to the full id ✨

Scheduled Pinned Locked Moved General Discussion
activitypub
6 Posts 3 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • dansup@mastodon.socialD This user is from outside of this forum
    dansup@mastodon.socialD This user is from outside of this forum
    dansup@mastodon.social
    wrote on last edited by
    #1

    RE: https://mastodon.social/@dansup/115876278291815667

    They also are ActivityPub objects that expand to the full id ✨

    We use snowflake ids, then hashids in permalinks that expand. It's beautifully simple, yet clever.

    d9VqOD2_gu => 236972985113375774

    https://browser.pub/https://loops.video/v/d86zgftFT9?rid=d9VqOD2_gu

    #ActivityPub

    bojanlandekic@mastodon.socialB 1 Reply Last reply
    1
    0
    • tag-activitypub@relay.fedi.buzzT tag-activitypub@relay.fedi.buzz shared this topic on
    • dansup@mastodon.socialD dansup@mastodon.social

      RE: https://mastodon.social/@dansup/115876278291815667

      They also are ActivityPub objects that expand to the full id ✨

      We use snowflake ids, then hashids in permalinks that expand. It's beautifully simple, yet clever.

      d9VqOD2_gu => 236972985113375774

      https://browser.pub/https://loops.video/v/d86zgftFT9?rid=d9VqOD2_gu

      #ActivityPub

      bojanlandekic@mastodon.socialB This user is from outside of this forum
      bojanlandekic@mastodon.socialB This user is from outside of this forum
      bojanlandekic@mastodon.social
      wrote on last edited by
      #2

      @dansup I don't understand why do you have to convert the alphanumeric string to just numbers though?

      dansup@mastodon.socialD 1 Reply Last reply
      0
      • bojanlandekic@mastodon.socialB bojanlandekic@mastodon.social

        @dansup I don't understand why do you have to convert the alphanumeric string to just numbers though?

        dansup@mastodon.socialD This user is from outside of this forum
        dansup@mastodon.socialD This user is from outside of this forum
        dansup@mastodon.social
        wrote on last edited by
        #3

        @bojanlandekic the long numbers are the keys to each video, but are long, so we convert them to a shorter alphanumeric string by leveraging a longer "alphabet" to represent the numbers more efficiently.

        bojanlandekic@mastodon.socialB 1 Reply Last reply
        0
        • dansup@mastodon.socialD dansup@mastodon.social

          @bojanlandekic the long numbers are the keys to each video, but are long, so we convert them to a shorter alphanumeric string by leveraging a longer "alphabet" to represent the numbers more efficiently.

          bojanlandekic@mastodon.socialB This user is from outside of this forum
          bojanlandekic@mastodon.socialB This user is from outside of this forum
          bojanlandekic@mastodon.social
          wrote on last edited by
          #4

          @dansup hmmm I sort of understand, but why is the conversion even required? Why can't the alphanumeric things be the database keys themselves? Why must they be just numbers?

          thisismissem@activitypub.spaceT 1 Reply Last reply
          0
          • bojanlandekic@mastodon.socialB bojanlandekic@mastodon.social

            @dansup hmmm I sort of understand, but why is the conversion even required? Why can't the alphanumeric things be the database keys themselves? Why must they be just numbers?

            thisismissem@activitypub.spaceT This user is from outside of this forum
            thisismissem@activitypub.spaceT This user is from outside of this forum
            thisismissem@activitypub.space
            wrote on last edited by thisismissem@activitypub.space
            #5

            @bojanlandekic@mastodon.social short answer is: snowflake IDs have a time-component to them, making them friendly for sharding and indexing. If you compress that into an alphanumeric string, you most likely loose the efficiency benefits. It's kinda like why you might see UUID primary keys not being recommended, when the standard UUID was UUIDv4 which had poor index & sharding efficiency, but with the newer UUIDv7, which are time sortable, you gain back that efficiency.

            Basically randomness is the enemy of database performance, having stuff ordered by time in the primary key makes it easy for the database to know which pages of the database to look at, and which to ignore, as page files are created over time.

            1 Reply Last reply
            0
            • bojanlandekic@mastodon.socialB This user is from outside of this forum
              bojanlandekic@mastodon.socialB This user is from outside of this forum
              bojanlandekic@mastodon.social
              wrote on last edited by
              #6

              @thisismissem It will take some reading for me to understand what you replied. I do speak English I assure you, I just don't understand a single thing you wrote lol 🙂

              1 Reply Last reply
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              Powered by NodeBB Contributors
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups