Add the status field to the database to record the email verification status. The default is inactive
Send a verification email address to the user's email address, and the user can activate the email address only after clicking it
If the user is not activated within a certain period of time, the user data will be deleted
Do you want to violently delete it after it has been inactive for a period of time? Will that be okay? (Is the way of doing this inappropriate?)
[Key]How to delete data
My idea is to add a user creation time, and then delete the data based on the user creation time and activation status.
But I don’t know what the specific idea is.
Also, I don’t know whether to use a programming language to write logical deletions or use a MySQL database to write logical automatic deletions.
I know a lot about NoSQL, but I am curious whether this function can be implemented using NoSQL such as redis and memcache. Which one is better than mysql?
The email verification field should be added to the user table. If you want to keep application records, you can create a new table
You can create a field for email activation or not. There is no need to delete it if it is not activated
You can use php to write the deletion logic, and then start a scheduled task to execute it. Go and operate mysql regularly.
You will eventually need to implement mysql to modify the data. In fact, it doesn’t matter which one you use!
I don’t recommend deleting records directly. But it can be deleted
With redis, you can set the expiration time, so you don’t need to maintain the deletion operation yourself