Redis was running a large production service with about **10 million monthly active users**. Every record in Redis was a **JSON-serialized Pydantic model** It looked clean and convenient – until it started to hurt. At scale, JSON stops being a harmless convenience and becomes a silent tax on memory.Redis was running a large production service with about **10 million monthly active users**. Every record in Redis was a **JSON-serialized Pydantic model** It looked clean and convenient – until it started to hurt. At scale, JSON stops being a harmless convenience and becomes a silent tax on memory.

JSON Was Killing Our Redis Memory. Switching Serialization Made It 7× Smaller.

2025/10/30 14:08

We were running a large production service with about 10 million monthly active users, and Redis acted as the main storage for user state. Every record in Redis was a JSON-serialized Pydantic model. It looked clean and convenient – until it started to hurt.

As we grew, our cluster scaled to five Redis nodes, yet memory pressure only kept getting worse. JSON objects were inflating far beyond the size of the actual data, and we were literally paying for air – in cloud invoices, wasted RAM, and degraded performance.

At some point I calculated the ratio of real payload to total storage, and the result made it obvious that we couldn’t continue like this:

14,000 bytes per user in JSON → 2,000 bytes in a binary format

A 7× difference. Just because of the serialization format.

That’s when I built what eventually became PyByntic – a compact binary encoder/decoder for Pydantic models. And below is the story of how I got there, what didn’t work, and why the final approach made Redis (and our wallets) a lot happier.

Why JSON Became a Problem

JSON is great as a universal exchange format. But inside a low-level cache, it turns into a memory-hungry monster:

  • it stores field names in full
  • it stores types implicitly as strings
  • it duplicates structure over and over
  • it’s not optimized for binary data
  • it inflates RAM usage to 3–10× the size of the real payload

When you’re holding tens of millions of objects in Redis, this isn’t some academic inefficiency anymore – it’s a real bill and an extra server in the cluster. At scale, JSON stops being a harmless convenience and becomes a silent tax on memory.

What Alternatives Exist (and Why They Didn’t Work)

I went through the obvious candidates:

| Format | Why It Failed in Our Case | |----|----| | Protobuf | Too much ceremony: separate schemas, code generation, extra tooling, and a lot of friction for simple models | | MessagePack | More compact than JSON, but still not enough – and integrating it cleanly with Pydantic was far from seamless | | BSON | Smaller than JSON, but the Pydantic integration story was still clumsy and not worth the hassle |

All of these formats are good in general. But for the specific scenario of “Pydantic + Redis as a state store” they felt like using a sledgehammer to crack a nut – heavy, noisy, and with barely any real relief in memory usage.

I needed a solution that would:

  • drop into the existing codebase with just a couple of lines
  • deliver a radical reduction in memory usage
  • avoid any extra DSLs, schemas, or code generation
  • work directly with Pydantic models without breaking the ecosystem

What I Built

So I ended up writing a minimalist binary format with a lightweight encoder/decoder on top of annotated Pydantic models. That’s how PyByntic was born.

Its API is intentionally designed so that you can drop it in with almost no friction — in most cases, you just replace calls like:

model.serialize() # replaces .model_dump_json() Model.deserialize(bytes) # replaces .model_validate_json()

Example usage:

from pybyntic import AnnotatedBaseModel from pybyntic.types import UInt32, String, Bool from typing import Annotated class User(AnnotatedBaseModel): user_id: Annotated[int, UInt32] username: Annotated[str, String] is_active: Annotated[bool, Bool] data = User( user_id=123, username="alice", is_active=True ) raw = data.serialize() obj = User.deserialize(raw)

Optionally, you can also provide a custom compression function:

import zlib serialized = user.serialize(encoder=zlib.compress) deserialized_user = User.deserialize(serialized, decoder=zlib.decompress)

Comparison

For a fair comparison, I generated 2 million user records based on our real production models. Each user object contained a mix of fields – UInt16, UInt32, Int32, Int64, Bool, Float32, String, and DateTime32. On top of that, every user also had nested objects such as roles and permissions, and in some cases there could be hundreds of permissions per user. In other words, this was not a synthetic toy example — it was a realistic dataset with deeply nested structures and a wide range of field types.

The chart shows how much memory Redis consumes when storing 2,000,000 user objects using different serialization formats. JSON is used as the baseline at approximately 35.1 GB. PyByntic turned out to be the most compact option — just ~4.6 GB (13.3% of JSON), which is about 7.5× smaller. Protobuf and MessagePack also offer a noticeable improvement over JSON, but in absolute numbers they still fall far behind PyByntic.

Let's compare what this means for your cloud bill:

| Format | Price of Redis on GCP | |----|----| | JSON | $876/month | | PyByn­tic | $118/month | | MessagePack | $380/month | | BSON | $522/month | | Protobuf | $187/month |

This calculation is based on storing 2,000,000 user objects using Memorystore for Redis Cluster on Google Cloud Platform. The savings are significant – and they scale even further as your load grows.

Where Does the Space Savings Come From?

The huge memory savings come from two simple facts: binary data doesn’t need a text format, and it doesn’t repeat structure on every object. In JSON, a typical datetime is stored as a string like "1970-01-01T00:00:01.000000" – that’s 26 characters, and since each ASCII character is 1 byte = 8 bits, a single timestamp costs 208 bits. In binary, a DateTime32 takes just 32 bits, making it 6.5× smaller with zero formatting overhead.

The same applies to numbers. For example, 18446744073709551615 (2^64−1) in JSON takes 20 characters = 160 bits, while the binary representation is a fixed 64 bits. And finally, JSON keeps repeating field names for every single object, thousands or millions of times. A binary format doesn’t need that — the schema is known in advance, so there’s no structural tax on every record.

Those three effects – no strings, no repetition, and no formatting overhead – are exactly where the size reduction comes from.

Conclusion

If you’re using Pydantic and storing state in Redis, then JSON is a luxury you pay a RAM tax for. A binary format that stays compatible with your existing models is simply a more rational choice.

For us, PyByntic became exactly that — a logical optimization that didn’t break anything, but eliminated an entire class of problems and unnecessary overhead.

GitHub repository: https://github.com/sijokun/PyByntic

Clause de non-responsabilité : les articles republiés sur ce site proviennent de plateformes publiques et sont fournis à titre informatif uniquement. Ils ne reflètent pas nécessairement les opinions de MEXC. Tous les droits restent la propriété des auteurs d'origine. Si vous estimez qu'un contenu porte atteinte aux droits d'un tiers, veuillez contacter service@support.mexc.com pour demander sa suppression. MEXC ne garantit ni l'exactitude, ni l'exhaustivité, ni l'actualité des contenus, et décline toute responsabilité quant aux actions entreprises sur la base des informations fournies. Ces contenus ne constituent pas des conseils financiers, juridiques ou professionnels, et ne doivent pas être interprétés comme une recommandation ou une approbation de la part de MEXC.
Partager des idées

Vous aimerez peut-être aussi

Whales Dump 100M ADA as Cardano Struggles Below $0.70

Whales Dump 100M ADA as Cardano Struggles Below $0.70

Whales offload 100M ADA, pushing Cardano price below $0.70. Analysts eye breakout as Grayscale ETF speculation fuels investor optimism. Solana gains traction with $69.5M ETF inflows boosting confidence. Cardano holders have faced a turbulent few days as large investors offloaded massive amounts of ADA. According to Ali Martinez, whales sold nearly 100 million ADA within just three days, creating noticeable selling pressure in the market. The cryptocurrency now hovers below the $0.70 mark, struggling to overcome its current resistance level. The wave of selling has stirred short-term uncertainty among retail investors. However, Cardano’s fundamentals remain firm, supported by strong development activity and increasing total value locked across its DeFi ecosystem. These indicators show that while prices fluctuate, network growth continues steadily behind the scenes. At the same time, the broader crypto market is showing weakness. Bitcoin trades near $110,925 after a slight dip, while Ethereum remains around $3,930. Despite the broader slump, sentiment within the Cardano community has not turned bearish, as optimism builds around potential catalysts. 100 million Cardano $ADA sold by whales in 72 hours! pic.twitter.com/2VXsZnx90m — Ali (@ali_charts) October 29, 2025 Also Read: Analyst: “XRP Structure Remains Intact” – See Multiple Price Targets ETF Speculation Ignites Optimism Among Cardano Investors Ali Martinez noted that Cardano may be preparing for a significant rebound. He explained that a confirmed break above $0.80 could open the path toward $1.70, signaling strong upside momentum. Many traders are now monitoring that level closely as a possible trigger for the next rally. Meanwhile, attention is focused on the potential Grayscale Cardano ETF. The fund recently reached its SEC decision deadline without an announcement, fueling speculation that it could launch soon. Such a move would allow institutional investors to gain regulated exposure to ADA, potentially driving fresh inflows into the market. Experts believe the ETF could play a crucial role in ADA’s price recovery. Grayscale’s recent filings show that Cardano meets the SEC’s rule 19b-4 listing standards, meaning the ETF could list without direct approval. Consequently, even moderate institutional demand could lift Cardano’s market cap and price in the near term. Solana Whale Transfer Sparks Market Attention An on-chain alert from Whale Alert showed 1,097,555 SOL tokens moving from a verified Coinbase Institutional wallet to a new address. The large transaction fueled speculation about institutional investors expanding their Solana exposure. Analysts noted the timing aligned with Bitwise confirming $69.5 million in first-day inflows for its spot Solana ETF ($BSOL), nearly 480% higher than $SSK’s debut, reflecting strong institutional interest in Solana. Hence, while Cardano faces temporary selling pressure, the broader altcoin market remains dynamic. Both ADA and SOL continue to attract significant institutional attention, suggesting that investor interest in major blockchain ecosystems is far from fading. Also Read: Egrag Crypto Says “XRP Family is Under Attack,” Here’s Why The post Whales Dump 100M ADA as Cardano Struggles Below $0.70 appeared first on 36Crypto.
Partager
Coinstats2025/10/30 21:37
Lovable AI’s Astonishing Rise: Anton Osika Reveals Startup Secrets at Bitcoin World Disrupt 2025

Lovable AI’s Astonishing Rise: Anton Osika Reveals Startup Secrets at Bitcoin World Disrupt 2025

BitcoinWorld Lovable AI’s Astonishing Rise: Anton Osika Reveals Startup Secrets at Bitcoin World Disrupt 2025 Are you ready to witness a phenomenon? The world of technology is abuzz with the incredible rise of Lovable AI, a startup that’s not just breaking records but rewriting the rulebook for rapid growth. Imagine creating powerful apps and websites just by speaking to an AI – that’s the magic Lovable brings to the masses. This groundbreaking approach has propelled the company into the spotlight, making it one of the fastest-growing software firms in history. And now, the visionary behind this sensation, co-founder and CEO Anton Osika, is set to share his invaluable insights on the Disrupt Stage at the highly anticipated Bitcoin World Disrupt 2025. If you’re a founder, investor, or tech enthusiast eager to understand the future of innovation, this is an event you cannot afford to miss. Lovable AI’s Meteoric Ascent: Redefining Software Creation In an era where digital transformation is paramount, Lovable AI has emerged as a true game-changer. Its core premise is deceptively simple yet profoundly impactful: democratize software creation. By enabling anyone to build applications and websites through intuitive AI conversations, Lovable is empowering the vast majority of individuals who lack coding skills to transform their ideas into tangible digital products. This mission has resonated globally, leading to unprecedented momentum. The numbers speak for themselves: Achieved an astonishing $100 million Annual Recurring Revenue (ARR) in less than a year. Successfully raised a $200 million Series A funding round, valuing the company at $1.8 billion, led by industry giant Accel. Is currently fielding unsolicited investor offers, pushing its valuation towards an incredible $4 billion. As industry reports suggest, investors are unequivocally “loving Lovable,” and it’s clear why. This isn’t just about impressive financial metrics; it’s about a company that has tapped into a fundamental need, offering a solution that is both innovative and accessible. The rapid scaling of Lovable AI provides a compelling case study for any entrepreneur aiming for similar exponential growth. The Visionary Behind the Hype: Anton Osika’s Journey to Innovation Every groundbreaking company has a driving force, and for Lovable, that force is co-founder and CEO Anton Osika. His journey is as fascinating as his company’s success. A physicist by training, Osika previously contributed to the cutting-edge research at CERN, the European Organization for Nuclear Research. This deep technical background, combined with his entrepreneurial spirit, has been instrumental in Lovable’s rapid ascent. Before Lovable, he honed his skills as a co-founder of Depict.ai and a Founding Engineer at Sana. Based in Stockholm, Osika has masterfully steered Lovable from a nascent idea to a global phenomenon in record time. His leadership embodies a unique blend of profound technical understanding and a keen, consumer-first vision. At Bitcoin World Disrupt 2025, attendees will have the rare opportunity to hear directly from Osika about what it truly takes to build a brand that not only scales at an incredible pace in a fiercely competitive market but also adeptly manages the intense cultural conversations that inevitably accompany such swift and significant success. His insights will be crucial for anyone looking to understand the dynamics of high-growth tech leadership. Unpacking Consumer Tech Innovation at Bitcoin World Disrupt 2025 The 20th anniversary of Bitcoin World is set to be marked by a truly special event: Bitcoin World Disrupt 2025. From October 27–29, Moscone West in San Francisco will transform into the epicenter of innovation, gathering over 10,000 founders, investors, and tech leaders. It’s the ideal platform to explore the future of consumer tech innovation, and Anton Osika’s presence on the Disrupt Stage is a highlight. His session will delve into how Lovable is not just participating in but actively shaping the next wave of consumer-facing technologies. Why is this session particularly relevant for those interested in the future of consumer experiences? Osika’s discussion will go beyond the superficial, offering a deep dive into the strategies that have allowed Lovable to carve out a unique category in a market long thought to be saturated. Attendees will gain a front-row seat to understanding how to identify unmet consumer needs, leverage advanced AI to meet those needs, and build a product that captivates users globally. The event itself promises a rich tapestry of ideas and networking opportunities: For Founders: Sharpen your pitch and connect with potential investors. For Investors: Discover the next breakout startup poised for massive growth. For Innovators: Claim your spot at the forefront of technological advancements. The insights shared regarding consumer tech innovation at this event will be invaluable for anyone looking to navigate the complexities and capitalize on the opportunities within this dynamic sector. Mastering Startup Growth Strategies: A Blueprint for the Future Lovable’s journey isn’t just another startup success story; it’s a meticulously crafted blueprint for effective startup growth strategies in the modern era. Anton Osika’s experience offers a rare glimpse into the practicalities of scaling a business at breakneck speed while maintaining product integrity and managing external pressures. For entrepreneurs and aspiring tech leaders, his talk will serve as a masterclass in several critical areas: Strategy Focus Key Takeaways from Lovable’s Journey Rapid Scaling How to build infrastructure and teams that support exponential user and revenue growth without compromising quality. Product-Market Fit Identifying a significant, underserved market (the 99% who can’t code) and developing a truly innovative solution (AI-powered app creation). Investor Relations Balancing intense investor interest and pressure with a steadfast focus on product development and long-term vision. Category Creation Carving out an entirely new niche by democratizing complex technologies, rather than competing in existing crowded markets. Understanding these startup growth strategies is essential for anyone aiming to build a resilient and impactful consumer experience. Osika’s session will provide actionable insights into how to replicate elements of Lovable’s success, offering guidance on navigating challenges from product development to market penetration and investor management. Conclusion: Seize the Future of Tech The story of Lovable, under the astute leadership of Anton Osika, is a testament to the power of innovative ideas meeting flawless execution. Their remarkable journey from concept to a multi-billion-dollar valuation in record time is a compelling narrative for anyone interested in the future of technology. By democratizing software creation through Lovable AI, they are not just building a company; they are fostering a new generation of creators. His appearance at Bitcoin World Disrupt 2025 is an unmissable opportunity to gain direct insights from a leader who is truly shaping the landscape of consumer tech innovation. Don’t miss this chance to learn about cutting-edge startup growth strategies and secure your front-row seat to the future. Register now and save up to $668 before Regular Bird rates end on September 26. To learn more about the latest AI market trends, explore our article on key developments shaping AI features. This post Lovable AI’s Astonishing Rise: Anton Osika Reveals Startup Secrets at Bitcoin World Disrupt 2025 first appeared on BitcoinWorld.
Partager
Coinstats2025/09/17 23:40
Exploring High-Risk, High-Reward Crypto Investments: Pepe vs. Ozak AI

Exploring High-Risk, High-Reward Crypto Investments: Pepe vs. Ozak AI

During market bull runs, cryptocurrency investors are often presented with the tough decision of investing in well-known cryptocurrencies or exploring early-stage projects that promise higher returns. Here, we delve into the potential of two contrasting types of investments: the viral meme coin Pepe and the technologically innovative Ozak AI. The Viral Success of Pepe Pepe has established itself as a top contender in the meme coin category, fueled by its community and explosive social media presence. The token's price dynamics show strong support and resistance levels that indicate potential for significant price movements in the near future. Investors have seen Pepe's price surge as it capitalizes on the typical retail frenzy associated with meme coins, especially when driven by viral trends. Investing $2,500 in Pepe could potentially yield substantial returns, leveraging the massive rallies often seen in meme-driven markets. Introduction to Ozak AI and Its Potential Ozak AI represents a newer, technology-driven entrant in the crypto market, focusing on artificial intelligence to provide real-time trading insights and signals. This early-stage investment opportunity is currently in its presale phase, attracting significant attention due to its unique value proposition and foundational technology. The Ozak AI Presale has already demonstrated strong market trust by raising significant funds. The project's partnerships with various tech networks bolster its credibility and enhance its market positioning, potentially leading to exponential growth post-launch. Comparing Investment Upsides While both Ozak AI and Pepe offer unique investment opportunities, they cater to different investor mindsets. Pepe could multiply in value in the short term if it continues to capture the essence of the meme coin craze. In contrast, Ozak AI, with its solid technological foundation and AI-driven approach, presents a long-term investment prospect with the potential for even larger gains. Understanding Ozak AI's Broader Role Ozak AI not only promises high returns but also integrates advanced technological solutions to the blockchain sphere, enhancing decision-making processes in financial markets. This positions Ozak AI at a critical intersection of technology and finance, potentially revolutionizing how investments are managed in the crypto space. For more, visit: Ozak AI official website, Telegram, and Twitter. Disclaimer: This is a sponsored article and is for informational purposes only. It does not reflect the views of Bitzo, nor is it intended to be used as legal, tax, investment, or financial advice.
Partager
Coinstats2025/10/30 21:26