educative.io

Educative

What type of database is used in key generation service, is it SQL or some NoSQL type

What type of database is used in key generation service, is it SQL or some NoSQL type. If NoSQL then which type, as there is no concept of key-value and document in case of KGS service

1 Like

@Design_Gurus Kindly help

KGS design is not much different than the original ‘Encoding URL’. We need the same key-value pairs i.e., URL and its key (or hash). The only difference is that KGS has pre-generated these keys and stores them in a table. When we need to shorten a URL, we take an already generated ‘key’ from KGS and store it in the URL table (similar to the ‘Encoding URL’ approach) We can use the same NoSQL databases like DynamoDB or Cassandra.

1 Like

Since nosql is eventually consistent, will there be a problem that a deleted key can be used again by another client?

hi @Design_Gurus , since aws dynamodb supports acid transactions, is it a good idea during the interview to suggest using dynamodb so that we can avoid KGS altogether with a simpler design and inherit the auto scaling characteristic of managed nosql? Thanks!