yesodweb / yesodweb/persistent

Is there shareded DB support?

Open
#1,130 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
486
Forks
306
PR merge metrics
No merged PRs in 30d

Description

Hi,

It seems Persistent doesn't support sharded tables.
The situation when a single DB has lots of tables with same structure.
All these tables share a data type representing the tables,
which instantiates PersistEntity class.

PersistEntity has entitfyDef function. It already returns meta data including table name, but
there is not way to make it dynamic. entityDef is pure function so it is not possible to benefit from ReaderT.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the PersistEntity and entityDef interfaces described in the issue, then examine how the current pure entityDef API handles table metadata. Determine the requirements for dynamic table names and ReaderT-based sharding, and define what API behavior and tests would demonstrate shared-table support.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.