If you want sequential numbers, you can't trust distributed counters from Cassandra. However, you could use Redis for this.

Additionally, you can also use a random UUID and only show the customer first 6 characters -- it is unique enough...

Oleg

On 2013-12-16 09:33:39 +0000, Jacob Rhoden said:

Hi Guys,

As per the subject, is there any way at all to easily associate small numbers in systems where users traditionally associate “bug/request” tickets with short numbers?

In this use case I imagine the requirements would be as follows:
• The numbers don’t necessary need to be sequential, just need to be short enough for a user to read out loud.
        •       The numbers must be unique.
• It doesn’t need to scale, i.e. a typical “request” system is not getting hundreds of requests per second.
In an ideal world, we could do away with associating “requests” with numbers, but its so ubiquitous I’m not sure you can sell doing away with short number codes.

I am toying with the idea of a Cassandra table that makes available short “blocks” of numbers that an app server can hold “reservations” on. i.e.

create table request_id_block(
    start int,
    end int,
    uuid uuid,
    reserved_by int,
    reserved_until bigint,
    primary key(start,end));

Will having an app server mark a block as reserved (QUOROM) and then reading it back (QUOROM) be enough to for an app server to know it owns that block of numbers?

Best regards,
Jacob


--
Regards,
Oleg Dulin
http://www.olegdulin.com


Reply via email to