Unique identifier implementation in a distributed system
As long as your application fits on one server in one data center, you can always get a unique identifier for any type of event by simply insert something into the database and receive the last added ID. But along with the increase in load, the number of servers and services, the need arises for scaling the ID generator. As a solution, you can shard the database, generate a random string, UUID (v1, v4), create a separate Ticket Service, use Twitter Snowflake or its equivalent. In the report, I will focus on the pros and cons of each solution, and also tell you how we generate unique IDs in PropellerAds.
Lead Developer, BI, PropellerAds. We implement ETL processes (Vertica, Airflow), write Go services for data processing and ad rotation, improve our DWH. In my free time I enjoy sports, raising children and sleeping.