Hello,
I am evaluating tidb as a replacement for AWS RDS (MySQL). Here are high-level requirements.
Let me know if this can be achieved with TiDB.
CREATE TABLE `table_xxx` (
`hash` VARCHAR(48) NOT NULL,
`token` VARCHAR(48) NOT NULL,
`enc_value` VARCHAR(160) NOT NULL,
`csum_token` VARCHAR(32) NOT NULL,
`csum_detoken` VARCHAR(32) NOT NULL,
`status` VARCHAR(1) NOT NULL DEFAULT 'A',
`created_timestamp` DATETIME DEFAULT CURRENT_TIMESTAMP,
`updated_timestamp` DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`id BIGINT AUTO_INCREMENT UNIQUE`,
PRIMARY KEY (`hash`,`token`),
UNIQUE KEY `unique_hash` (`hash`),
UNIQUE KEY `unique_token` (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT: Stored Proc is used to insert 50 records at a time.
SELECT: Stored Proc is used to retrieve 50 records either by token or hash
SELECT: When application starts, it retrieves all the records in memory using id column 5000 records at a time so reads are only done when not found in the cache.
Thanks for your attention and information, we're preparing a detailed answer to your questions.
Sure, thanks.
support for stored-proc is not necessary as long as we can support either batch operations or high throughput for writes.
Regarding SSL/TLS requirement, data must be transferred over network through a secure channel.
hash and token values. If below operation can be performed atomically, we can just use tikv.
Query `token` by `hash` and return `token` if found
else
insert `token` and `hash`
NOTE: token is generated randomly so there is a chance of duplicate token generated by multiple application instances. We need to ensure that we never store two different tokens for same hash value.
If this can be supported in tikv, I would prefer that over tidb as our 95% use-case is read.
tidb or tikv can support 500K+ read per second with low-latency. Today, we are using six shards of redis which is quite expensive.We're still testing in our environment with your scenario, we'll update on this issue when we have a test result.
I can answer you following question at a high level.
+1
Most helpful comment
We're still testing in our environment with your scenario, we'll update on this issue when we have a test result.
I can answer you following question at a high level.