0

[Question posted by a user on YugabyteDB Community Slack]

I want to someone remove my confusion, please correct me If I am wrong: I have 3 nodes (3 tables) Table structure:

ID (Hash of Account/Site/TS)
Account
Site
Timestamp

I have pattern of accounts inside multiple sites. Should I partition by account is it better by site? (Small partition size is better / Large partition size is better).

Read happens by all three columns. Which is a better choice of partition?

dh YB
  • 965
  • 3
  • 10

1 Answers1

0

YugabyteDB doesn't need declarative partitioning to distributed data (this is done by sharding on the key). Partitioning is used to isolate data (like cold data to archive later, or like geo-distribution placement).

If you define PRIMARY KEY( ( Account, Site, Timestamp ) HASH ) you will have the distribution (YugabyteDB uses a hash function on the columns to distribute to tablets) and no skew (because the timestamp is in it). Sharding is automatic. You don't have to define an additional column for that https://docs.yugabyte.com/preview/architecture/docdb-sharding/sharding/

dh YB
  • 965
  • 3
  • 10