Auto-increment columns do not ensure uniqueness for sharded tables. Instead you will need to use Vitess sequences to achieve the same functionality.
Sequences are based on a MySQL table and use a single value in that table to describe which values the
...morePlease see "SQL Syntax" under MySQL Compatibility.
...moreWe list out the special functions that Vitess handles without delegating to MySQL here.
There's a workaround if you want to use a JPA like Hibernate/Eclipselink to talk to Vitess.
Rather than using GenerationType.IDENTITY you can use Eclipselink
...more