Filter
Exclude
Time range
-
Near
Replying to @OfficialSamkayz
Overflow as how? 100 trillion is well within integer limits for numbers stored as 64 bits signed. In Javascript, you wouldn't even lose precision in calculations. In the database, store as BIGINT. There is literally nothing to worry about
14
Replying to @SahilExec
The mistake is treating this as a UUID vs BIGINT debate. The question is: Do you need globally unique distributed IDs? If not, BIGINT is usually the simplest and fastest choice.
Replying to @OfficialSamkayz
1 trillion naira is 100 trillion kobos, which is 10^14. A signed 64-bit BIGINT in Postgres maxes around 9.2 quintillion (9.2 × 10^18), roughly 92,000x above that. You'd need one account holding more than the world's entire money supply to overflow it.
79
Most engineers think generating IDs is easy. Just use UUIDs. Problem solved. Until your database hits billions of rows. Then your IDs start affecting: • insert performance • index size • query latency • storage costs • database fragmentation At scale, IDs become a system design problem. The surprising part? A random UUID can make your database dramatically slower. Why? Because databases store indexes as B-trees. Random UUIDs scatter writes across the entire tree. Every insert lands somewhere different. More page splits. More fragmentation. Bigger indexes. Time-ordered IDs do the opposite. New records are appended near the end of the index. Less fragmentation. Smaller indexes. Faster inserts. That's why companies like: • Twitter • Discord • Instagram built custom ID generators. Twitter created Snowflake. A clever 64-bit ID that packs: → Timestamp → Machine ID → Sequence Number into a single integer. The result: • globally unique IDs • no database coordination • naturally sortable • millions of IDs per second all while fitting inside a BIGINT. The architecture is surprisingly elegant: Timestamp Worker ID Sequence Number = Globally Unique ID No central database. No distributed lock. No consensus on every request. Just local generation. But the real challenge is time. What happens if a server clock moves backwards? What happens if two servers accidentally use the same worker ID? What happens when one machine generates thousands of IDs in a single millisecond? These edge cases are where most implementations fail. The chapter dives deep into: • Snowflake internals • UUIDv7 vs UUIDv4 • ULID and TSID • Clock skew handling • Worker ID allocation • Multi-region deployments • B-tree performance • Real Twitter, Discord, and Instagram architectures One of the most underrated system design topics. Because every distributed system eventually needs IDs. Read the full deep dive: hld.handbook.academy/curricu… #SystemDesign #DistributedSystems #BackendEngineering #SoftwareEngineering #Database
9
Replying to @VJain47
Fuzzing is a code testing approach that is mostly used by security researchers to find vulnerabilities in code, but it can also be used to detect non-security flaws. At the most basic level, it consists of throwing a bunch of arbitrary inputs at a function and seeing where it breaks. Imagine you have a simple function for adding two integers, what happens when instead of receiving a float integer the function instead receives BigInt? What happens when it gets a string instead of a number? This is useful in agentic dev because agents really struggle at writing tests that test behavior rather than implementation, so agent-written tests end up being primarily useful to guard against regressions. Fuzzing that grounds itself in the given codebase, and generates contextually appropriate challenges for the functions being tested, can simulate the results of “bad” user behavior and show agents where their tests and code are lacking.
2
21
1,457
What are you saying? Was BigInt discovered yesterday?
They were storing balances in kobos. 😆 I asked, "If a customer has 1 trillion, how will you represent it in the database?" That becomes 100 trillion kobos. Then comes the real question: How are you handling overflow?
1
114
Replying to @yashmp2004
Engineer C: Use UUIDs externally, BIGINT internally. Ship it.😂
124
Replying to @yashmp2004
bigint unless you hate RAM 💀
61
Replying to @eeyitemi
Even the 100 trillion he speaks of is simply 17 digits in most lower units. Besides, even when you go past the limits (size) for BIGINT, you will always have STRING (VARCHAR), which can hold a solid representation of money values, with proper validation help anyways.
2
4
1,797
If you’re still using ethers.js in production in 2025, you’re leaving TypeScript safety, bundle performance, and dev experience on the table. viem wagmi isn’t just “better” — it’s a fundamentally different philosophy. typed ABIs. tree-shaking. native bigint. TanStack Query caching. ethers was great. viem is built for how we build now.
1
25
100 trillion kobo = 100,000,000,000,000 kobo (10¹⁴) A standard SQL BIGINT = 9,223,372,036,854,775,807 (~9.2 × 10¹⁸) So 100 trillion kobo is nowhere near the BIGINT limit.
They were storing balances in kobos. 😆 I asked, "If a customer has 1 trillion, how will you represent it in the database?" That becomes 100 trillion kobos. Then comes the real question: How are you handling overflow?
3
335
I was stuck for two days on the biggest lie that still haunts Aver - my Int is i64 but proofs are ℤ… huge soundness issue I couldn’t decide on. 90% of programs won’t ever even be near that, but it bothers you as a language builder. All the options are bad: you may either try to model i64 in proofs (which makes them much harder) or implement BigInt (which makes runtime slower). Or some mix of those: two types to choose from, or one semantic type with two runtime representations. So I finally picked one of the choices… guess which and why the last one.
49
This is not accurate. The overflow caveat doesn't apply when a 64 bit type is in use. 1 trillion -> 100 trillion kobo -> 10^14, BIGINT holds ~9.22 * 10^18, a lot of headroom. Overflow becomes a concern in 32 bit INT, and in this case the max kobo stored is ~2 billion -> ~21M ngn.
They were storing balances in kobos. 😆 I asked, "If a customer has 1 trillion, how will you represent it in the database?" That becomes 100 trillion kobos. Then comes the real question: How are you handling overflow?
2
299
Jun 14
Replying to @OfficialSamkayz
Lmao all this tweeter engineer what does storing in kobo has to do with floating? Unit doesn't matter but data type. Bigint isn't for decoration
1
4
817
Replying to @OfficialSamkayz
You can effectively store 100 trillion in an unsigned bigint(20) column type, in fact that column type can store values wih upto 19 digits, so 1 quintillion can be stored comfortably in an unsigned bigint(20) column type and still occupy a total size of 8 bytes
1
516
Replying to @OfficialSamkayz
Well, the upper limit for most storages is 64 bits (bigint) so anything that grows beyond that is not gonna have anywhere to go.
1
1
1,353
To even do the math 100 trillion is 10¹⁴, bigint holds 10¹⁸ more money than exists in the world. I'll give you that on a 32 bit sys that'd be 2³² which is 2.1 billion Kobo, but if someone is using 32bit for financial operations they should be selling garri instead
1
20
1,168
Day 2 of my JavaScript journey 🚀 Today I learned about Primitive Data Types in JavaScript: • String • Number • Boolean • Undefined • Null • BigInt • Symbol #JavaScript #WebDevelopment #CodingJourney #100DaysOfCode #LearnToCode #FrontendDevelopment
1
12
In Puerto Rico they have a special financing program for expedited assets meaning that if you can verifiably ko the jucher and crawl their btree of asset nodes you can trap them by their tails and divide or divert their jucher oriented #bigint financier financing
13
I dislike faux engineering thought leaders man. What’s the max value of bigint in sql. The fact that this is your question and they allow you to consult says more about the company. Just read on Fowler money problem and stop the lies.
They were storing balances in kobos. 😆 I asked, "If a customer has 1 trillion, how will you represent it in the database?" That becomes 100 trillion kobos. Then comes the real question: How are you handling overflow?
7
330