GithubHelp home page GithubHelp logo

JobId should be Int64 about odd-jobs HOT 10 OPEN

TomMD avatar TomMD commented on May 26, 2024
JobId should be Int64

from odd-jobs.

Comments (10)

mrputty avatar mrputty commented on May 26, 2024 1

FWIW, I don't think there's any value in making this configurable. The representation of the job id is an internal library concern, at least the way the library is structured today. I think just using Int64 seems the most reasonable to me.

from odd-jobs.

saurabhnanda avatar saurabhnanda commented on May 26, 2024

If my calculation is right, even at one job / sec, it would take 17+ years to reach this limit.

Are you planning to use this instead of a message queue, by any chance?

from odd-jobs.

TomMD avatar TomMD commented on May 26, 2024

Are you planning to use this instead of a message queue, by any chance?

Ding ding!

from odd-jobs.

saurabhnanda avatar saurabhnanda commented on May 26, 2024

Seriously? Are you planning to use odd-jobs instead of a message-queue? How many messages / sec are you expecting?

from odd-jobs.

TomMD avatar TomMD commented on May 26, 2024

Yes, seriously. I'd rather have my jobs persist and not be an in-memory store that could be lost in the event of an outage. I see perhaps 20 message per user per day. If I am super successful and see 10M users then thats 700 message / second spread over the 8 hour work day uniformly.

from odd-jobs.

jkachmar avatar jkachmar commented on May 26, 2024

+1 for making JobId an Int64.

Is Int being used to address a particular problem with performance or overhead, or just because it's not an expected use-case for the queue to grow beyond 2^29 entries?

from odd-jobs.

saurabhnanda avatar saurabhnanda commented on May 26, 2024

Is Int being used to address a particular problem with performance or overhead, or just because it's not an expected use-case for the queue to grow beyond 2^29 entries?

I didn't think through this deeply. What is the natural choice for mapping a Postgres integer to a Haskell data-type? How many bits does a Postgres integer use?

from odd-jobs.

TomMD avatar TomMD commented on May 26, 2024

How many bits does a Postgres integer use?

Postgres integer is 32 bits: https://www.postgresql.org/docs/10/datatype-numeric.html

bigint is 64 bits

from odd-jobs.

saurabhnanda avatar saurabhnanda commented on May 26, 2024

So, ideally, if we make this change it should be int <=> Int and bigint <=> Int64, right?

Is there value in making this configurable? Or will it end-up being unnecessary complexity for library users for little gain?

from odd-jobs.

TomMD avatar TomMD commented on May 26, 2024

That makes sense to me, yes. There could be an argument for type JobId = Int64 too.

from odd-jobs.

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.