mysqlmongodbmultithreadingkubernetesstatefulset

How to achieve thread safety for applications deployed in Kubernetes clusters?


My databases (mongodb and mysql) are declared as StatefulSet in yaml files. Backend framework is django. If I define functions that perform write operations (edit or delete) as async, it gonna be thread safe, right? Should I use locks or mutexes?


Solution

  • The same way you would do it anywhere else. MySQL offers many flavors and modes of transactional safety, which you use depends on your data structures and needs. Mongo is a little less complex but offers plenty of at least hypothetically transactional options.