TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Sequences in DB cluster
  • This is not kohana-specific but perhaps there is a way that some of the Db stuff wraps this functionality (using KO3.3x + Database + Jelly module)

    I'm trying to move to a multi-master MySQL (aka MariaDb Galera Cluster). Everything is fairly simple except for an "exposed" auto-increment primary key I have on my main orders table. All other tables don't need a "known" (aka sequential) primary key but since this code has been running since 2004, I have to implement some fake sequence (like in Oracle) so that the Galera cluster doesn't start creating with what looks like a "skipping" number.

    Is there something in kohana that wraps this? I would prefer it to be done at the database level but it seems like a non-colliding primary key is necessary for the multi-master to work without too many changes.

    Even if I just maintain a table called sequence or something (with 1 column and 1 row?), I don't think that will be enough to guarantee that I am getting the next sequential number.

    Any suggestions?