educative.io

Educative

Key generation service

why do we need a used keys table? why can’t we just delete the used key from the available keys table? how do we make sure that keys to get used multiple times due to database consistency issues?

Hi @Dewey_Munoz!

What you are saying is correct. We can go with this approach, but the method that is mentioned in the lesson has some pros. e.g., the used keys table can be referenced to data points. E.g., if we only have a key to work with, we can use it to get the data point it is referencing.

Both the approaches are essentially correct, depending upon the finer details of our system.

I hope this helps!

What do you mean when you say that the used keys table can be referenced to data points? What are these data points?