Giter Site home page Giter Site logo

ID spoofing about cuid HOT 3 CLOSED

paralleldrive avatar paralleldrive commented on July 25, 2024
ID spoofing

from cuid.

Comments (3)

ericelliott avatar ericelliott commented on July 25, 2024

Hi Rob,

I don't see a problem with enforcing sequential IDs if you have a need for them in the context of your application. Ensuring that IDs are sequential is not the same thing as decoding the groupings to extract any semantic meaning from the ids.

For example, I would consider it unwise to extract the datestamp and use it as the entity creation time in your application, or to extract the client sequence and use it for some semantic purpose in your application. I think that enforcing sequence is in a different class.

That said, clients that are not under your control could spit any random timestamp at you. It's up to you to determine how you'll handle those cases. I'd be careful not to be too strict. There are other ways to optimize database performance. For instance, you could insert a memory cache such as Redis or Memcached in front of your permanent storage. I'm a strong believer that these sorts of performance optimizations shouldn't be too coupled to your application logic.

from cuid.

RobertButera avatar RobertButera commented on July 25, 2024

Thanks for the feedback.

I will probably just settle on doing some basic format (sanity) checking on the id and leave it that.

Rob

from cuid.

ericelliott avatar ericelliott commented on July 25, 2024

👍

from cuid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.