top | item 36777908

(no title)

mulander | 2 years ago

Schemas are groupings of tables and other entities that can be defined within a database. You can think of them like of a namespace in programming languages. You can have the same table definition, within the same database, defined multiple times (each in a different schema) and each holding different data.

By large and small we are referring to the amount of data each schema holds currently. They can grow over time and some of them may become very big while others will remain small (storage wise).

discuss

order

pickledish|2 years ago

Ah, interesting ok

> You can have the same table definition, within the same database, defined multiple times (each in a different schema) and each holding different data.

So in this respect, each table within a schema indeed already acts like a "shard" of the overall table

Is this enforced? Like, if I create a table "messages" in schema A and a table "messages" in table B, must they have the same columns/column types, or is that just convention

mulander|2 years ago

They can be different, as long as your application can handle them being different (which makes sense for microservices as an example).