race condition on order table if two instances of my code are running on two kubernetes pods?
There shouldn't be one, as they should be hitting a central RDBMS
server such as Postgres or MariaDB.
Some cloud vendors have offerings with attractive failover properties;
you might consider an AWS Postgres RDS cluster.
So on the one hand you're paying the
ACID tax,
but on the other hand those central locks
make race worries simply disappear.
Your question didn't specify, but let's assume we've chosen to
go the NoSQL route.
Then GUIDs are the way to go.
Alternatively you could assign a unique ID to each pod,
and make each pod responsible for persisting the serials
it has given out, so that even across reboots we'll never
see a duplicate (pod_num, serial) pair.
It's possible to combine those into a 64-bit integer
if you give each pod ID a range of, say, a million
serials it is allowed to hand out before needing
to request a fresh pod_num.
A related design would spin up a SerialService
which hands out blocks of a hundred or more unique serials
to pods which request them.
Run that service on a single pod,
and make it responsible for persisting what it hands out,
so we survive reboots.
Make each block big enough so clients won't block during
typical recovery operations for the service, such as reboot.
Clients will want to request "next block please!"
long before exhausting the one they're currently working through.
Or just stick with GUIDs.