Skip to content

Instantly share code, notes, and snippets.

@rponte
Last active September 2, 2024 23:48
Show Gist options
  • Save rponte/dadd7785b00690069bd0f673ddd18fef to your computer and use it in GitHub Desktop.
Save rponte/dadd7785b00690069bd0f673ddd18fef to your computer and use it in GitHub Desktop.
Patitioning: the third pillar of scalability

Interesting articles and content about data partitioning

Slotted Counter Pattern

Some articles and tips about Slotted Counter Pattern:

Shuffling and randomizing rows with SQL

Data partitioning

@rponte
Copy link
Author

rponte commented Sep 2, 2024

Example of using the MOD() function to partition the result set:

    SELECT t.*
       FROM tasks t
     WHERE mod(t.id, :total_machines) = :machine_key
ORDER BY t.created_at

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment