DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Data

Data is at the core of software development. Think of it as information stored in anything from text documents and images to entire software programs, and these bits of information need to be processed, read, analyzed, stored, and transported throughout systems. In this Zone, you'll find resources covering the tools and strategies you need to handle data properly.

icon
Latest Premium Content
Trend Report
Data Engineering
Data Engineering
Refcard #269
Getting Started With Data Quality
Getting Started With Data Quality
Refcard #398
Open-Source Data Management Practices and Patterns
Open-Source Data Management Practices and Patterns

DZone's Featured Data Resources

Understanding Vector Databases: Concepts, Similarity Search, and Trade-offs for Enterprise Applications

Understanding Vector Databases: Concepts, Similarity Search, and Trade-offs for Enterprise Applications

By Otavio Santana DZone Core CORE
For decades, enterprise applications have used databases to store, retrieve, and process information through structured queries, indexes, and defined relationships. Relational and NoSQL databases have supported a wide range of use cases, from financial transactions to distributed applications. However, artificial intelligence (AI) presents a new challenge: how can applications search for meaning instead of exact values? Vector databases offer a new approach to data retrieval by enabling applications to use semantic similarity rather than relying only on traditional matching. This unlocks new possibilities for recommendation engines, intelligent search, and AI-powered applications. For Java developers and software architects, understanding vector databases is increasingly important — not to replace existing solutions, but to identify when an alternative data model can address challenges that traditional approaches cannot. Why Vector Databases Matter Traditional databases are effective when applications search for exact values. For example, an application storing animal information might return records containing the word “pet” if queried directly. However, it may not return records about dogs or cats, even though they are closely related to the concept of a pet. Semantic search changes this approach. Instead of comparing words directly, an AI embedding model represents their meanings as numerical vectors. Concepts like “pet” and “dog” are sit close together in a multidimensional space, enabling applications to retrieve relevant information even when search terms don't match exactly. This distinction is especially important in enterprise systems. For example, a customer support application could find relevant solutions without requiring customers to use exact documentation terms, or a recommendation engine could recognize similarities beyond predefined categories. Previously, these capabilities required extra application logic, manual relationships, or specialized search infrastructure. As large language models (LLMs) and retrieval-augmented generation (RAG) become more common, vector search is now a key component of many AI architectures. However, vector databases do not automatically improve search accuracy or replace relational databases. Their effectiveness depends on the embedding model, similarity measures, indexing strategies, and data characteristics. For enterprise Java architects, the key question is not just how to persist information, but how to represent and retrieve it based on meaning. To inform these architectural decisions, we first need to examine how vector databases represent information and the types of vectors they support. Understanding Vector Data: Structure and Types Unlike traditional records that use fields and values, vector database records use numerical representations to enable similarity searches. Each record, or point, includes an identifier, a vector, and a payload. The following simplified JSON example represents a document about dogs: JSON { "id": 101, "vector": [0.12, -0.35, 0.87, 0.24], "payload": { "title": "Dog Care Guide", "category": "animals", "description": "A guide to caring for dogs" } } Each component serves a specific purpose: ID: Uniquely identifies the record for retrieval, update, or deletion.Payload: Contains the original information or metadata and supports filtering, such as searching by category.Vector: Encodes information as numerical values, enabling the database to calculate similarity between records. Developers typically do not define vector values manually. Instead, a machine learning model, known as an embedding model, converts text, images, or other data into numerical representations. For example, a model may generate similar vectors for “dog” and “pet” because it has learned their relationship. The individual numbers are not meaningful on their own. Their significance comes from their position in multidimensional space and their relationship to other vectors from the same model. The four-dimensional vector above is simplified; production models often generate vectors with hundreds or thousands of dimensions. This creates an architectural consideration: generating embeddings and storing them are separate tasks. A Java application might generate embeddings using an external AI service or a local model, then store them in a vector database. Some databases also provide integrated embedding generation. Three Types of Vector Representations While vectors share a mathematical foundation, their representations vary by application. The three main types are dense, sparse, and multi-vectors. Dense vectors represent information using a fixed-length sequence of numerical values. They are widely used in semantic search, recommendation systems, and RAG applications because embedding models can encode complex relationships into compact numerical representations. JSON { "vector": [0.12, -0.35, 0.87, 0.24] } Sparse vectors represent information where most dimensions are zero. They store only the positions and values of nonzero elements, making them useful for keyword-based retrieval and specialized search models. JSON { "vector": { "indices": [2, 15, 98], "values": [0.8, 0.4, 0.9] } } Multi-vectors link multiple vectors to a single record. Some models generate separate embeddings for individual tokens or components, enabling more detailed similarity comparisons but increasing storage and computation costs. JSON { "vector": [ [0.12, -0.35, 0.87], [0.24, 0.51, -0.18], [0.63, -0.21, 0.42] ] } These JSON structures are examples; actual representations depend on the database API and vector configuration. Choosing between these representations involves trade-offs in search quality, memory consumption, indexing, and computational cost. No single representation is universally superior; the right choice depends on the problem, the embedding model, and the database's capabilities. However, representing information as vectors is only part of the solution. How does a database determine whether two vectors are similar? This is where similarity metrics such as cosine similarity, Euclidean distance, and the dot product come in. Understanding how these measurements work, along with the algorithms used to search and index vectors, is essential before implementing them in Java. How Vector Similarity Search Works Storing vectors is only part of the challenge. A vector database must also identify which records are closest to a query. Unlike traditional searches that match exact conditions, vector searches use mathematical measures such as cosine similarity, Euclidean distance, and dot product. Each method evaluates similarity differently, even though all operate on numerical vectors. Consider a movie recommendation application that represents user preferences across genres such as action, comedy, and drama. Otavio has watched 100 action movies, while Poliana has watched 10. Should the system recommend more action movies to Otavio just because he has watched more? The answer depends on what we want to measure. Cosine Similarity: Comparing Direction Cosine similarity evaluates the direction of two vectors, not their magnitude. For example, if Otavio has watched 100 action movies and 20 comedies, and Poliana has watched 10 action movies and 2 comedies, their viewing volumes differ, but their genre distributions are identical. Cosine similarity would consider these preference vectors equivalent in direction. This approach is useful when recommendations should reflect user preferences rather than content consumption. Highly active users and occasional viewers can share similar interests despite different activity levels. Euclidean Distance: Comparing Absolute Differences Euclidean distance measures how far apart two vectors are in multidimensional space. In this example, Otavio’s and Poliana’s vectors would be far apart because their absolute viewing counts differ. This method is useful when data magnitude matters, such as comparing consumption patterns or activity levels. However, raw counts can be misleading, as watching more movies does not always indicate stronger preferences. Dot Product: Considering Direction and Magnitude The dot product considers both alignment and magnitude. Two vectors in similar directions will produce a larger score as their magnitudes increase. For recommendation systems, this is useful when vector magnitude reflects meaningful information, such as modeled preference strength. However, magnitude does not always represent enthusiasm. Otavio may have watched 100 action movies but rated most poorly, while Poliana watched 10 and loved each one. A recommendation model should incorporate ratings or other feedback to capture this distinction. Bringing Vector Databases to Enterprise Java with Eclipse JNoSQL While understanding vector databases matters, integrating them into enterprise applications is challenging because drivers, configurations, and query APIs differ. Eclipse JNoSQL 1.2.0 addresses this by adding support for vector databases like Qdrant, Milvus, and Weaviate. With Jakarta NoSQL mapping and a fluent API, developers can work with vector persistence while using familiar Java concepts. Consider an application that stores technical articles and enables users to search by meaning instead of exact keywords. With Eclipse JNoSQL, an article can be represented as a standard Java entity: Java @Entity public class Article { @Id private String id; @Column private String content; @Column private String author; @Column private int year; @Column private Vector embedding; // Constructors, getters, and setters } This entity uses the same mapping model as Jakarta NoSQL, with an added Vector attribute for similarity search. Eclipse JNoSQL supports DenseVector, SparseVector, and MultiVector representations, though availability depends on the database provider. Eclipse JNoSQL does not generate embeddings. A separate model handles embedding generation, which you can integrate using libraries like LangChain4j. After generating an embedding, the application can associate the vector with an entity and persist it using VectorTemplate. Java @Inject VectorTemplate template; template.insert(article); The real advantage shows up in search. Imagine a developer looking for articles about “building scalable Java applications” without requiring those exact words to appear in the content. Java Vector queryVector = embedder.embed( "building scalable Java applications" ); List<Article> articles = template.search(Article.class) .vector(queryVector) .limit(Limit.of(10)) .result(); In this example, embedder is an embedding service the application provides. The query retrieves semantically similar articles and returns them as mapped Java entities. Enterprise applications often require additional constraints. For instance, you may want to retrieve similar articles by a specific author published in recent years. Java List<Article> articles = template.search(Article.class) .vector(queryVector) .where("author").eq("Example Author") .and("year").gte(2024) .limit(Limit.of(10)) .result(); This approach combines vector similarity with traditional metadata filtering in a single fluent API. However, it differs from hybrid lexical-and-vector ranking, which uses separate retrieval mechanisms. Beyond the API, choosing a database is an architectural decision. Qdrant, Milvus, and Weaviate vary in indexing, supported vector types, filtering, and operational features. Eclipse JNoSQL reduces Java-level coupling but doesn't eliminate these trade-offs or guarantee identical capabilities across providers. Conclusion Vector databases introduce new possibilities for enterprise applications by enabling similarity searches that go beyond traditional keyword matching. Understanding vector representations, similarity metrics, and their trade-offs helps Java developers and software architects choose the right approach without unnecessarily replacing existing persistence solutions. With Eclipse JNoSQL 1.2.0, developers can explore vector persistence through familiar Java APIs while integrating databases such as Qdrant, Milvus, and Weaviate. To explore these capabilities further, check out the practical code examples and visit the Eclipse JNoSQL website for documentation and additional resources. More
Pitching Kotlin: An Engineering Leader's Guide to Legacy Modernization

Pitching Kotlin: An Engineering Leader's Guide to Legacy Modernization

By Yuri Geronimus
I've been on both sides of the Kotlin conversation: the engineer making the case, and the architect who reviews it and recommends a direction before a committee decides. On the reviewing side, the pattern is predictable: most Kotlin pitches die in the second meeting. A tech lead shows up with a list of syntax wins, managers or architects ask about migration risk, and the conversation ends with "we'll revisit this next quarter." The technical case for Kotlin is usually sound, but the pitch stalls because it argues from developer preference, while engineering leaders approve migrations based on cost and risk. I've spent a large part of my career on systems where a defect moves real money (I talked about what that means for Kotlin code at KotlinConf 2026), and when I wrote the Kotlin Enterprise Playbook, I ran this exact argument through a financial model across mobile, edge, and backend domains. The proposals that held up were the ones that priced cost and risk honestly, including the cases where the answer was "not here." This guide is the framework I use when I review these proposals. Decide domain by domain, solution by solution, instead of organization-wide. Make the cost of the status quo measurable. Price the migration, including the parts nobody budgets for. Place gates where decisions stop being reversible. Make sure the people who carry the risk own the outcome. Kotlin is the worked example, but the same framework applies to any large technical migration, whether it's a language, a framework, or a data platform. Technical Debt as an Engineering Friction Metric Before you can pitch a migration, you need to make the cost of staying put visible. That cost is spread across pull request (PR) timelines, defect densities, and onboarding logs. It only becomes clear when you add those numbers up over several months, because an incident report only records one failure at a time. Start with four concrete measurements your team already has access to: PR cycle time on service-layer changes. Verbose Java boilerplate (getters, setters, null checks, builder patterns) means more code per feature, which requires longer reviews. A data class in Kotlin replaces a 40-line Java POJO with four lines in a representative case (Java records narrow this gap for immutable value types, though not for mutable or framework-bound classes), and that compression shows up directly in review time.NullPointerException rate in production. Pull your error-tracking data from the last two or three release cycles. A persistent NPE trend is one of the clearest health signals a Java codebase gives you. Kotlin's type system reduces null-related runtime failures at the compiler level, so this number becomes a defensible baseline for the risk argument.Time-to-productive for new engineers. Ask your most recent hires how long it took them to make their first independent commit to your most heavily annotated service layer. In my experience, boilerplate-heavy Java codebases show longer onboarding ramps, and this measurement tells you whether yours does.Effort on existing code per quarter. Count the engineering hours per quarter spent changing existing code and the hours spent writing new functionality. In mature Java monoliths, the time on existing code tends to grow as the codebase ages. Separate structural changes from bug fixes and behavior changes, because only the structural share is the friction you are pricing. When you present these numbers, frame them as a cost to team throughput. A statement like "We're spending 30% of sprint capacity on structural changes to code that hasn't changed business logic in 18 months" gives leadership a number they can weigh against the cost of migrating, while "Java is too verbose" is a preference leadership can dismiss. If your organization already reports DORA metrics (lead time for changes, deployment frequency, change failure rate, and failed deployment recovery time), use them as the backbone for your case and attach the four friction measurements to each one. Leadership already reads DORA as delivery performance, so your Kotlin case arrives in a format they trust. Adoption Friction and Long-Term Velocity Gains A realistic adoption model will show a short-term slowdown before the long-term gains, and presenting only the gains will cost you credibility with your peers. During the initial rollout, your team will write slower Kotlin than they write Java. Code review will slow down while reviewers build pattern recognition for Kotlin idioms. Budget two to four sprints for the team to get comfortable with the idioms, and expect full velocity parity by sprint 8, midway through phase 2. Your Gradle or Maven build configuration will also need updating to add the Kotlin JVM plugin and compiler targets alongside existing Java compilation. Plan for the less visible costs too. Mixed Java and Kotlin compilation adds build time (the K2 compiler that shipped with Kotlin 2.0 narrowed the gap, and Gradle's build cache and configuration cache help further, but measure it on your own codebase before you promise anything), annotation processors need a path off kapt (now in maintenance mode) toward KSP where your libraries support it, and Spring or JPA code needs the kotlin-spring and kotlin-jpa compiler plugins, because Kotlin classes are final by default and both frameworks rely on proxies and no-arg constructors. Note that kotlin-jpa only adds the no-arg constructor: entities also need allOpen configured for @Entity, @MappedSuperclass, and @Embeddable, or Hibernate's lazy loading turns into eager loading without warning. These line items are where migration estimates fall apart, because the visible conversion work is only the tip of the iceberg. Once your team reaches parity, the gains will compound with each module you convert, because Kotlin produces an estimated 40% fewer lines of code than equivalent Java, which means a smaller surface area to read, review, and debug. Treat that figure as directional, since it's a vendor estimate, and replace it with numbers from your own converted modules as soon as you have them. A stronger reference point is JetBrains' telemetry study of about 28 million development cycles: on comparable work, Kotlin developers spent roughly 15-20% less time from first edit to push than Java developers. Compile-time null safety catches most null-related runtime errors before they reach staging. Extension functions let Kotlin code add convenience APIs on top of existing Java classes without touching the original source, which smooths incremental adoption. They're resolved statically, though, so Java callers see them as ordinary static utility methods. Kotlin is designed for Java interoperability at the JVM level, which means you don't convert a service and then wait for everything else to catch up. New features ship in Kotlin while stable Java modules stay exactly where they are. Both compile to JVM bytecode and call each other's APIs directly, so the adoption boundary moves at whatever pace your team sets. AI-assisted tooling further changes the conversion economics. The kotlin-tooling-java-to-kotlin AI Agent Skill, published by JetBrains, integrates with IntelliJ IDEA's AI Assistant and external agent tools to automate module translation with a structured four-step conversion process. The skill performs a faithful semantic translation first, then refines nullability and mutability, converts collection APIs to idiomatic Kotlin, and restructures for framework idioms. It checks five invariants at every step, verifying that public signatures stay compatible and that annotation site targets don't break reflection-based frameworks like Spring or Jackson. Present this to skeptics as a safety net on the conversion pipeline, since it reduces the manual cleanup burden on each converted file, and your team still reviews and commits the output. One caution from the wider migration literature: LLM-assisted translation can produce code that compiles and passes the existing tests while still changing behavior at the edges. Tests generated by the same pipeline tend to confirm the translation instead of challenging it. Keep the tests that guard a converted module independent of the tool that converted it, and before converting a module, add characterization tests that pin down its current behavior. Why the Case Gets Stronger When AI Writes the Code For most teams, a growing share of new code is now drafted by AI assistants and agents. That moves the bottleneck from writing code to verifying it, and verification is where the language matters. Every non-null type, every exhaustive when expression over a sealed hierarchy, and every value class that keeps two lookalike IDs from being swapped is a check the compiler runs on generated code before any human reviewer looks at it. Explicit types also work as a specification the agent reads: a non-null field in a signature states the contract more reliably than a comment the model may ignore. And less code per feature means less generated code to review, which matters more once generation is cheap, and review isn't. AI doesn't settle the question, though. Models have seen far more Java than Kotlin, so output quality can vary, and AI also makes a modern-Java upgrade cheaper. It also shrinks only the visible part of the migration cost: conversion gets cheaper, but parallel running, governance, and decommissioning cost the same with or without an agent. The question becomes which language lets your reviewers trust code they didn't write. In domains where a wrong value is expensive, a stricter type system pays off. Team Velocity Through a Phased Rollout Incremental adoption turns a high-risk initiative into a gated engineering program. The goal is to give leadership defined checkpoints to evaluate stability before authorizing the next phase, because a plan approved in stages is much easier to sign off on than a multi-year roadmap. Phase 1 (tests-first, sprints 1 to 4). Write all new unit and integration tests in Kotlin. Your existing Java production code stays untouched. The team gets hands-on time with Kotlin syntax in a low-stakes context, and your test suite stays green throughout. It is also the cheapest step in the plan to reverse. If the pilot fails, you delete test files, and nothing changes in production. Phase 2 (leaf modules, sprints 5 to 10). Start with independent utility classes, DTOs, and value objects. These are the leaf nodes of your dependency graph. Because they depend on almost nothing else in your codebase, converting one can't break the code it relies on. Check their fan-in, though. A widely shared DTO is a leaf with many callers, and every nullability decision in its Kotlin signature reaches each Java caller, so convert low-fan-in leaves first and treat shared DTOs as a separate step. Two framework details trip up DTO conversions: Jackson needs jackson-module-kotlin to deserialize data classes, and Kotlin code in a mixed module can't see Lombok-generated members without the Kotlin Lombok compiler plugin. Most of these objects translate cleanly to Kotlin data class declarations (JPA entities are the exception: keep them as regular classes, because data-class equals() and hashCode() conflict with Hibernate's lazy proxies), and conversion regressions are easy to catch with the test suite you built in phase 1. Commit the mechanical J2K conversion on its own, then follow it with an idiomatic cleanup so your code reviewers can diff them separately. Phase 3 (new service boundaries, ongoing). Any new microservice or greenfield module ships in Kotlin from day one. This is the Strangler Fig pattern applied to a language: new capability grows around the legacy system, which keeps running until each domain is ready to retire. Existing Java services stay untouched unless they're candidates for targeted conversion. This is where most of the return sits. When I modeled adoption across a full product portfolio, new development came out clearly positive, while migrating highly stable legacy code often produced a negative net present value (NPV). A good plan says so openly and classifies each domain as Kotlin by default, gated behind a business case, or not now. Use a lightweight decision matrix to triage which modules go into which phase, so the sequencing decision is traceable. The following table applies the decision matrix to modules from an example codebase: ModuleFan-in (modules depending on it)Current friction signalTranslates cleanly to a data class?PhaseNotesOrderDtoLowNPEs in the mapping code around itYes2Leaf used by one service, good J2K candidatePricingServiceHighHigh refactor hours/quarterNo3 (new boundary) or targetedCore business logic, convert only if rewriting anywayNotificationUtilsLowLong PR cycle timeN/A (utility class)2Pure utility class, no callers outside its module; becomes top-level functions, so add @file:JvmName to keep Java call sites unchangedPaymentGatewayClientHighMixedNoHoldHigh fan-in, defer until phase 2 modules are stable Score your own modules on the same four columns: dependency count, which friction metric from the baseline section it shows up in, whether it translates cleanly to a data class, and the phase it belongs to. Modules with low fan-in and a clean data-class shape go to phase 2 first. High fan-in modules wait until the team has review-cycle data from earlier conversions. Velocity through these phases usually follows a predictable curve. You'll see a brief slowdown during phase 1 as the team learns the idioms, a recovery to baseline by sprint 8, and then a compounding improvement as shared modules accumulate in Kotlin. The right milestone gate at the end of phase 1 asks whether the team shipped tests on schedule and whether the suite passes. The gate at the end of phase 2 asks whether conversion regressions appeared and how many review cycles each converted file required. Measure both against a control group: comparable Java modules the team changed over the same period. Without one, a before-and-after comparison picks up everything else that changed that quarter, and a careful reviewer will discount it. Each gate is a go/no-go evaluation point. You should place gates where the next step stops being cheap to reverse. Kotlin tests and new modules are easy to back out. A shared DTO with dozens of Java callers, or an organization-wide default, is not, so that is where the evidence bar goes up. Where you can, encode the gate criteria as fitness functions in the build instead of meeting agendas: architecture checks with Konsist or ArchUnit, a build-time budget, and a rule that rejects new Java files in domains classified as Kotlin by default. A gate that runs on every commit doesn't depend on anyone remembering to hold it. If a team misses gate 1, treat that as data about the plan, not as a scheduling problem to absorb in phase 2. Show leadership a velocity chart comparing your team's adoption path with the trend for your Java codebase if nothing changes, so they see the short-term dip and the long-term payoff on the same timeline. The legacy line trends down as refactoring overhead compounds, while the adoption line follows the dip-and-recovery pattern described above. Use your own baseline numbers from the friction metrics section to recalibrate the axis before presenting it. Four Objections I Check When Reviewing a Kotlin Migration When a Kotlin proposal comes to me for review, how it answers these four objections shapes my recommendation to the committee, and each maps to a concrete technical answer. "What if we need to roll back?" Kotlin's interoperability with Java means each module conversion can be reversed on its own, at least for a while. A Kotlin file compiles to standard JVM bytecode that Java code calls directly, and in most cases existing Java callers need no changes, as long as the converted code keeps a Java-friendly API (@JvmStatic, @JvmOverloads, @Throws, and the kotlin-spring plugin for proxied Spring beans). Once other Kotlin code relies on Kotlin-only features of the converted module (default arguments, extension functions, suspend functions, sealed hierarchies), reverting it breaks those callers, so make the rollback window part of your gate criteria. If a converted module introduces instability, revert the commit. Because the mechanical J2K output lives in its own commit, the rollback is one small, reviewable change. For higher-risk modules, run the Java and Kotlin versions side by side behind a feature flag (under different class names, since both can't share one on the classpath), or shadow a slice of production traffic through both and compare outputs before switching over. In payments, shadow only side-effect-free logic such as fee calculation or routing decisions, never authorizations, captures, or refunds, and keep in mind that mirroring card data widens your Payment Card Industry Data Security Standard (PCI DSS) scope. "The conversion overhead is too high." IntelliJ IDEA's built-in Java-to-Kotlin (J2K) converter handles the syntactic translation automatically. The two-commit pattern (one commit for the J2K output, one commit for idiomatic cleanup) keeps code review tractable. "We'll introduce null-safety regressions during conversion." The compiler catches most of these before they ship. The gap is the Java–Kotlin boundary. Unannotated Java types reach Kotlin as platform types with no compile-time check, so annotate the remaining Java side with JSpecify. The boundary can also fail at runtime in the other direction. Kotlin inserts null checks on public non-null parameters, so a Java caller that used to pass null now fails immediately with an NPE. Check the Java callers of each converted API before you mark a parameter non-null. The J2K converter infers nullability from annotations and usage and inserts non-null assertions (!!) where it can't decide, so your team reviews each one and replaces it with safe calls (?.) or Elvis operators (?:), or keeps the non-null assertion where a contract guarantees it. In practice, the bigger risk runs the other way. A converted field gets marked nullable "just in case," and a broken upstream contract turns into a silent fallback deep in the code. Keep mandatory fields non-null, validate them once at the system boundary, and make invalid input fail loudly there. I covered this pattern in my KotlinConf 2026 talk on type-driven reliability. "Why not just upgrade to modern Java?" This is the objection to take most seriously in 2026. Records, sealed classes, pattern matching, and virtual threads have closed much of the gap that drove early Kotlin adoption. For stable, low-change backends, a Java upgrade plus stronger engineering standards is often the higher-return choice. Kotlin earns its place where the bottleneck is modeling correctness, safe refactoring speed, or business logic shared across channels, especially when those factors show up in incident rates or time to market. A credible proposal compares Kotlin with the Java you could run next year (today, Java 25, the current long-term support release), not the Java 8 or 11 the codebase was written in, and it is willing to say "not here" where Java is enough. Architects in enterprise Java usually ask whether Spring fully supports Kotlin, and JetBrains and the Spring team answered that with a strategic partnership to make Kotlin a first-class language for Spring applications. The collaboration covers full null safety across the Spring portfolio (based on JSpecify annotations and shipped in Spring Boot 4), official Kotlin-first Spring learning materials, faster Kotlin reflection, and evolving configuration DSLs. Coroutine support in Spring WebFlux predates the partnership and has been available since Spring Framework 5.2. Spring and Spring Boot remain among the most widely used backend frameworks in JetBrains' own Kotlin developer surveys, with enterprise teams at Expedia Group, Kakao Pay, and Mercedes-Benz.io among those running Kotlin in production on that stack. Who Says Yes, and the Decision on One Page A proposal that only answers engineering gets approved and then stalls in the next review. Before you write it, map who has to say yes and what each of them protects: finance looks at payback and predictability, security at supply chain and scanning coverage, product at delivery risk during the dip, and platform engineering at a toolchain it will support for years. Then make ownership explicit. The architecture board owns the default, gated, and not-now classification. Platform engineering owns the toolchain and upgrade cadence. A small guild owns Kotlin conventions, with rotating membership so it doesn't harden into a gatekeeping inner circle. Write the result as an architecture decision record (ADR), including the context, the options you rejected and why, the decision, and who owns each consequence. The evidence behind the ADR comes down to four things: Codebase health baseline. Present your current friction metrics, including PR cycle time on service-layer changes, NPE rate from your error-tracking tool, engineering hours per quarter on structural refactoring, and new-engineer time-to-first-independent-commit. These establish the cost of the status quo in terms of team throughput. Pair them with an honest cost estimate that covers training, the learning dip, parallel running, governance, and the eventual decommissioning of legacy code.Phased migration plan with gates. Outline the three phases (tests-first, leaf module conversion, new service boundaries) with sprint estimates and go/no-go criteria at each gate. Request approval for phase 1 only. Add a kill switch: if build time, incident rate, or review load regress past agreed thresholds, expansion pauses until the platform is fixed. Name an owner for Kotlin conventions (a style guide, static analysis with detekt, and a short review checklist), so converted code doesn't turn into Java written in Kotlin syntax.Tooling and safety net inventory. Name the specific tools in the conversion pipeline, including IntelliJ IDEA's J2K converter for mechanical translation, the kotlin-tooling-java-to-kotlin AI Agent Skill for framework-aware idiomatic refinement and invariant checks, and the existing Gradle or Maven build for mixed-codebase compilation. Include the supply-chain controls security will ask about: a software bill of materials (SBOM), dependency scanning, and pinned, approved versions of the Kotlin compiler and Gradle plugins. The Kotlin standard library, kotlin-reflect, and kotlinx-coroutines become new runtime dependencies in your component inventory. Security will want to agree on which code may be sent to an AI conversion tool, especially anything that touches keys, hardware security module (HSM) integration, or cryptography. This answers the "how do we actually do this" question before it's asked.Ecosystem maturity signals. The JetBrains and Spring strategic partnership (announced May 2025), Google's continued backing of Kotlin as Android's recommended language (a sign that investment extends beyond any single vendor, not a reason to scope this migration around mobile), the enterprise case studies at kotlinlang.org/server-side, and the roughly 8.1 million Kotlin developers JetBrains estimates in its State of Kotlin 2026 report give leadership the external validation they need. For most backend teams, ecosystem maturity is no longer the main adoption risk. Treat vendor numbers, including these, as directional: independent case studies and your own pilot data carry more weight with a skeptical review board. Keep the main document to one page, two at most, and move the detail into appendices. Your goal is a decision the committee can make in a single 30-minute review, not a series of follow-up meetings. Building the Case, Section by Section This guide's framework comes down to five moves. Decide domain by domain which code is Kotlin by default, which needs a business case, and which is not now. Quantify the friction in your current Java codebase as throughput metrics, measured against a control group. Model both sides of the adoption curve honestly, including the short-term slowdown and the costs nobody budgets for. Phase the rollout through gates placed where decisions stop being cheap to reverse. Then map who has to say yes, make ownership explicit, and put the recommendation in a short ADR. The tooling makes conversion manageable, but tooling was never what blocked approval. A migration gets approved when the decision is scoped by domain, priced honestly, reversible at each step, and owned by the people who carry its risk. That holds whether the change is Kotlin, a new framework, or a new data platform, and it holds just as well when the honest answer is "not here." For the full financial model (NPV, IRR, payback, and the migration iceberg) and the governance setup behind this guide, see the Kotlin Enterprise Playbook I wrote, available at kotlinlang.org, and the recap of my KotlinConf 2026 talk. Where have you said "not here" to a migration your team wanted, and what evidence settled it? More
Debugging senro Pipelines: Replay a Run, Shell Into a Live Step, Audit a Cache
Debugging senro Pipelines: Replay a Run, Shell Into a Live Step, Audit a Cache
By Xavier Portilla Edo DZone Core CORE
Ingesting Public Data That Fails Silently: Patterns From a TypeScript and Cloudflare Workers Pipeline
Ingesting Public Data That Fails Silently: Patterns From a TypeScript and Cloudflare Workers Pipeline
By horus he
Prompt Caching for LLMs, Part 3: Model-Side Caching and Production Rollout
Prompt Caching for LLMs, Part 3: Model-Side Caching and Production Rollout
By Ram Ghadiyaram DZone Core CORE
How (and Why) to Build Dynamic Data Pipelines
How (and Why) to Build Dynamic Data Pipelines

AI is changing the way we code. Last week, a friend told me he completed a user story to add new columns to a table and tested it in under an hour. Upstream teams are now shipping changes in days that once took months. For data pipelines that sit downstream of these fast-moving systems, this speed is a new design constraint. One of the potential solutions is to build dynamic data pipelines that are built to keep up. What Is a Dynamic Data Pipeline Dynamic data pipelines are data processing workflows that adapt to changing data and business logic. They use parameterized templates and config files to run custom pipelines on the go as per data requirements. These pipelines are better suited to today’s fast-changing data environment. staticdynamic Hard-coded, fixed tasks Configuration-driven, flexible logic Breaks on schema changes Adapts automatically to schema changes Requires coding and redeployment to handle business logic changes Requires just config changes to handle business logic changes High maintenance with constant updates to prevent failure Low maintenance, may require some config changes from time to time Quick to build the pipeline Takes more time upfront for initial coding but once built, it’s easy to add more tasks Sample Dynamic Data Pipeline Architecture I'll walk you through a sample architecture to show how dynamicity is configured into a data pipeline. Sample dynamic data pipeline architecture 1. Configuration The key configurations of a dynamic data pipeline can be stored in Git (YAML/JSON) and a database. Git stores the pipeline logic, and a PostgreSQL/MongoDB database stores the dynamic values used when the pipeline runs. For example, you may want to build a standardized data ingestion workflow; the logic for it will be in Git, but the list of tables to be ingested can be stored in the database. So when an ingestion workflow initiates, it triggers multiple workflows for each table entry. Let’s understand it with code: YAML config of dynamic data ingestion pipeline: YAML pipeline: name: dynamic_data_ingestion_pipeline version: “1.0” source: type: "{{ source_type }" connection: host: "{{ source_host }" database: "{{ source_database }" table: "{{ source_table }" schema: on_new_column_detected: “add” # automatically add new columns on_column_removal_detected: “ignore” # ignore column removal on_type_change_detected: “cast” # cast the datatype on change transformations: name: “if_filter_null” enabled: “{{ if_filter_null }” column: “{{ null_filter_column }” target: type: “{{ target_type }” dataset: “{{ target_dataset }” table: “{{ target_table }” runtime: schedule: “{{ cron_schedule }” retry_attempts: 3 alert_on_failure: true Database entry of dynamic data ingestion pipeline: Markdown -- Table: pipeline_config | id | source_type | source_host | source_database | source_table | if_filter_null | null_filter_column | column_mapping | target_type | target_dataset | target_table | cron_schedule | |----|-------------|------------------------|-----------------|--------------|----------------|--------------------|----------------|-------------|----------------|-----------------------|---------------| | 1 | postgres | db.customers.prod.com | customers_db | customers | true | customer_id | true | bigquery | analytics | customers_details | 0 * * * * | | 2 | s3 | s3.amazonaws.com | transactions_db | transactions | false | null | true | redshift | finance | transactions_details | 0 0 * * * | These configurations are what make the pipeline dynamic. Instead of hardcoding column names or schema expectations into the pipeline code, the script reads the schema at runtime and adapts automatically, handling new, removed, or renamed columns without breaking. And whenever any changes happen upstream, all that's needed is a config table update. No pipeline rework, no redeployment. Tip: Make sure the database fetch step for dynamic pipelines happens during execution inside a task, not during DAG parsing. Because DAG parsing occurs on every scheduler heartbeat, it can crash your orchestrator. 2. Orchestrator After those configurations are ready, you can design the dynamic pipeline in an orchestrator (such as Airflow, Prefect, or Dagster). It generates pipelines based on configurations defined in YAML/database and dynamically creates the required tasks. Sample flow in orchestrator: Plain Text Reads YAML template ↓ Loops over DB config table ↓ One sub DAG per row with all tasks Dynamic DAG skeleton in Airflow: Python with open("/opt/airflow/configs/pipeline_config.yaml", "r") as f: raw_yaml_template = f.read() def get_pipeline_settings(): connection = psycopg2.connect( host="company_db.com", database="metadata_db", user="sys_admin", password="******" ) cur = connection.cursor() cur.execute(""" SELECT id, source_type, source_host, source_database, source_table, if_filter_null, null_filter_column, target_type, target_dataset, target_table, cron_schedule FROM pipeline_config """) rows = cur.fetchall() field_names = [col[0] for col in cur.description] cur.close() connection.close() return [dict(zip(field_names, row)) for row in rows] all_pipeline_settings = get_pipeline_settings() all_configs = [] for pipeline_settings in all_pipeline_settings: resolved_yaml = Template(raw_yaml_template).render(**pipeline_settings) pipeline_config = yaml.safe_load(resolved_yaml) all_configs.append(pipeline_config) def task1 (): #logic def task2 (): #logic def task3 (): #logic task1= PythonOperator( task_id="task1", python_callable=task1, dag=ingestion_dag ) task2= PythonOperator( task_id="task2", python_callable=task2, dag=ingestion_dag ) task3= PythonOperator( task_id="task3", python_callable=task3, dag=ingestion_dag ) # ========================================================== # DAG FLOW # ========================================================== task1>> task2>> task3 3. Executor Your pipeline logic will usually run on compute engines such as Apache Spark, BigQuery, Snowflake, or Presto/Trino, depending on your infrastructure and pipeline configuration. The output will be stored in cloud systems such as Amazon S3, Google Cloud Storage, or Azure Data Lake Storage. 4. Monitoring Depending on your environment, built-in logging platforms are available, such as AWS CloudWatch, Google Cloud Monitoring, or Azure Monitor. For advanced monitoring, tools like Logstash and Elasticsearch help to aggregate logs and perform analytics. Should Every Data Pipeline Be Dynamic No, not every pipeline needs to be dynamic. It will become very tough to maintain all dynamic pipelines. And then it doesn’t make sense to write this logic for every workflow. In some cases, explicit hardcoded logic is actually simpler to read and maintain. Dynamic pipelines are a good choice if: You have 20+ pipelines with similar logic that differ only in a few configuration valuesYour data source schema changes frequentlyYour pipelines have frequent business rule changesYou can handle pipeline failures in isolation, meaning one bad config cannot break all pipelines at once.You can easily monitor DAGs even after the shift to dynamicYou have non-engineers such as analysts, PMs, or business users who need to make changes to DAG configurations Best Practices to Maintain Dynamic Data Pipelines Dynamic data pipelines are still a relatively new concept. Here are some best practices to help you maintain them. Avoid Doing Too Much in One DAG One single DAG generating 1000s of sub-DAGs will be a maintenance nightmare. Also, if it’s hitting any API or shared services, it can cause overload. Limit how many sub-DAGs one parent DAG can initiate. How to implement this? Group pipelines based on business function or sources. For example, you can have one parent DAG for all tables from the same source. Alternatively, you can group pipelines by business function, such as marketing, finance, or reporting. Maintain Version History Given the dynamic nature of sources and pipelines, schemas and sources can change over time. The DAG must maintain version history, and any backfill must respect the configuration that was active when the partition originally ran. How to implement this? Always store the configuration associated with each run so you can trace it for any backfills. You can also design your pipeline config table to maintain history by adding "valid_from" and "valid_to" columns with the exact timelines when that config was active. Monitor at Sub-DAG Level Dynamic pipelines are essentially sets of tasks grouped together and generated multiple times based on configuration. For example, an ingestion pipeline is a set of tasks to extract, transform, and load data for different tables. Monitoring must be done at the sub-DAG level rather than the individual task level. That means ingestion must be tracked separately for each source. How to implement this? Maintain separate logs and tracking for each sub-DAG. For example, you can push a new entry for every sub-DAG with metadata like source name, config ID, row count, and duration to a monitoring table or tool like Datadog or Grafana. One Sub-DAG Should Not Block the Rest A dynamic pipeline can trigger hundreds of sub-DAGs, but each sub-DAG must operate as an independent entity. A failed or skipped sub-DAG should not affect other sub-DAGs generated from the same pipeline. How to implement this? Set failure rules at the sub-DAG level to prevent one failed task from blocking the rest. For example, configurations like on_failure_callback in Airflow can be set at the sub-DAG level to isolate failures and let the rest of the sub-DAGs run fine. Dynamic Data Pipelines Are No Longer a Nice-to-Have With AI, companies will soon be building high-velocity products. That means new features will get added at a pace that leaves rigid downstream systems struggling to keep up. The pipelines that run smoothly won't be the ones built for today's schema/rules. It’ll be the ones built to adapt to whatever comes next.

By Nidhin Ponon
Prompt Caching for LLMs, Part 2: Semantic Caching in Production
Prompt Caching for LLMs, Part 2: Semantic Caching in Production

Recap: Where This Fits Part 1 of this series covered exact-match caching: hashing the full request and returning a stored response when a new request matches an old one exactly. That layer is fast and safe, but it only helps when the input matches exactly, which is common for templated traffic and rare in open conversation. This article covers the layer that closes that gap: semantic caching. Part 3 covers what happens once a request actually reaches the model: self-hosted KV cache reuse and provider prefix caching, plus the production details: watching your metrics, working out your costs, and a full checklist. 2. Semantic Caching When a user asks the same thing in different words ("I am going from Bangalore to Mysore" vs. "I'm traveling Bangalore to Mysore and need hotels"), exact match fails. Semantic caching embeds the query and finds the nearest earlier response, and returns it if the two are similar enough. How It Works Embed the new query with a fast embedding model.Search a vector store, such as Redis Stack with RedisVL, pgvector, FAISS, or Milvus, for the closest matches.Use cosine similarity, the most common measure. Typical thresholds in production sit between 0.90 and 0.95.On a hit, return the stored response. On a miss, call the model and store both the embedding and the response. Trade-Offs Loss of detail. Embeddings compress meaning into numbers. "Laptop under $1000" and "laptop under $3000" can land close together in that number space, even though the right answer for each is different.Latency. A vector search, even a fast approximate one (HNSW), is slower than a simple hash lookup.Cost. Embedding a query is cheap and quick next to a full model call, but it is not free, and at high volume the embedding step becomes its own cost to plan for.Wrong answers. False positives are the main risk here. Reduce this risk with a stricter threshold, an embedding model tuned to your domain, a check after retrieval, or a mix of exact and semantic keys. Picking an Embedding Model The model you embed with has a direct effect on how many false positives you get, and just picking whatever is quickest to install is a common early mistake: General-purpose open models (sentence-transformers/all-MiniLM-L6-v2, all-mpnet-base-v2) are free, run on your own machines, and are fine for a first prototype. They struggle with domain-specific terms, product names, and short queries where one small word changes the meaning.Domain-tuned or retrieval-specific models (Redis's own redis/langcache-embed-v2, or a model tuned on your own past queries) usually tell near-miss pairs apart better, at the cost of an extra dependency, and, for hosted embedding APIs, a small per-call cost.Hosted embedding APIs (OpenAI, Cohere, Voyage) trade a small per-call cost for strong general performance, with no local GPU or model to manage. Most teams move to this once they are past the prototype stage. Whichever you pick, test it against your own real traffic instead of trusting a leaderboard. General embedding quality and "tells apart this exact near-miss pair in my domain" are not the same test. Python from redisvl.extensions.cache.llm import SemanticCache from redisvl.utils.vectorize import HFTextVectorizer # or OpenAIEmbeddings, etc. vectorizer = HFTextVectorizer(model="sentence-transformers/all-MiniLM-L6-v2") # or a stronger, domain-tuned model cache = SemanticCache( name="llm_semantic", redis_url="redis://localhost:6379", distance_threshold=0.1, # lower = stricter, this is cosine distance, not similarity vectorizer=vectorizer, ttl=3600 ) def cached_llm_call(prompt: str, llm_callable): hits = cache.check(prompt=prompt) if hits: return hits[0]["response"] # consider a cheap check here before trusting this blindly response = llm_callable(prompt) cache.store(prompt=prompt, response=response) return response Check the RedisVL docs for the current parameter names before you ship. Libraries like this change fast, and a name can shift between minor versions. One easy trap in the code above: distance_threshold is cosine distance, not cosine similarity, and the two run in opposite directions. As a rule of thumb, cosine distance is roughly 1 minus cosine similarity, so a similarity threshold of 0.92 is close to a distance threshold of 0.08. Reading distance_threshold=0.1 as "90% similar" instead of doing that conversion is a common way a threshold ends up looser or stricter than the team meant it to be. GPTCache follows the same embed, search, check, store pattern, and can sit in front of any OpenAI-compatible client if you would rather not build this loop yourself. Shipping Semantic Caching Safely: Threshold Plus Verification A raw similarity threshold, on its own, means "we tried semantic caching," not "we shipped it safely." The gap between those two is usually one cheap check placed between the vector hit and the return. Three patterns cover most production systems: High threshold, plus a cheap second check. Set the similarity bar high (0.94 to 0.97, or the matching distance value), then run the pair (new query, cached query) through a small, fast model or a rule-based check that answers one question: "do these two queries really want the same answer?" This costs a small fraction of a full model call and catches near-miss cases a threshold alone would let through.A verified semantic cache. Store a short note next to the cached answer when you write it, not just the answer itself; for example, a one-line summary of when the cached answer applies ("valid for laptop budgets between $900 and $1,100"). When there is a candidate hit, check the new query against that stored note before returning it, instead of trusting similarity alone.Fall back to a full call when confidence is low. Treat similarity as a sliding scale, not a strict yes or no, as the diagram above shows. Above a high threshold, return right away. In a middle band, run the check. Below that, treat it as a miss and call the model. This avoids the common mistake of picking one threshold and treating it as a perfect line, when it never really is. Python def cached_llm_call_verified(prompt: str, llm_callable, verifier_callable): hits = cache.check(prompt=prompt) if hits: candidate = hits[0] # Cheap check before trusting a vector-space match. if verifier_callable(prompt, candidate["prompt"], candidate["response"]): return candidate["response"] # Similarity said "close enough," verification disagreed. Treat as a miss. response = llm_callable(prompt) cache.store(prompt=prompt, response=response) return response verifier_callable can be as simple as a small classification model, a check against a second, differently-tuned embedding model, or a rule that checks specific details pulled out of both queries (price ranges, dates, entity names). The point is not to be fancy; it is to have a second, independent signal before a similarity score alone decides what a user sees. Semantic Cache Invalidation Is Harder Than It Looks TTL and LRU work well for exact matches, because a stale exact match is still at least a match for the same question. A stale semantic match is riskier: the cached answer can still look "close enough" to a new, slightly different question forever, because nothing about vector distance fades with time on its own. Practical fixes: Keep semantic TTLs shorter than exact-match TTLs by default, especially for anything tied to price, stock, or policy.Version the cache namespace whenever the underlying source of truth changes (a new product catalog, an updated policy page), instead of relying on TTL alone to catch it.Store a content hash or a last-updated time next to the cached response, and check it when reading, not just when writing. Multi-Turn Conversations Everything above treats a prompt as one standalone unit. Most production chat systems do not work that way. A conversation builds up history, and both the hashing and the embedding steps need to account for that: Exact match on multi-turn: Hash the full message history plus the new turn, not just the latest message. This means the exact-match hit rate on turn N of a conversation is close to zero unless the whole earlier conversation is replayed exactly, which rarely happens. Exact match is far more useful on the first turn of a session, or on isolated tool calls inside an agent loop, than on a deep conversation.Semantic match on multi-turn: Embedding only the latest user message loses the context that gives it meaning ("what about the second one" means nothing without the earlier turn). Common fixes are to embed a short summary of the running conversation state, or to embed the latest turn together with a summary of the relevant earlier turns. Neither one fully removes the risk described above, and that risk grows as the conversation gets longer.In practice, most teams apply exact and semantic caching to single tool calls and retrieval steps inside an agent loop, rather than to the full multi-turn exchange, and rely on model-side prefix reuse, covered in Part 3, for the conversation history itself. Streaming Responses If the model call streams tokens back to the client, the caching step cannot just wrap a normal, blocking call. Two common patterns: Buffer, then cache. Stream to the client as normal, build up the full response on the server, and write to the cache only once the stream is done. Simple, but a request that gets canceled mid-stream never gets cached, and a very long response delays the cache write.Cache and replay. On a cache hit, play back the stored response as a fake stream (in reasonable chunks) so the client's streaming UI still behaves as expected, instead of getting one big block of text. A UI built around token-by-token display looks broken if a cache hit suddenly returns the whole answer at once with no streaming pace. Some setups go a step further and cache partial answers: for a very long response, write the first N tokens to the cache as they come in, instead of waiting for the full stream, then return those N tokens right away on a hit while the rest streams live. This extra work is worth it mainly for long content, like reports or long code files, where the wait for the first token matters more to users than the total time to finish. Security Considerations Semantic cache poisoning. Because semantic caching returns a response based on similarity, not an exact match, an attacker who understands the embedding space can craft an input that lands close enough to a cached response that leaks sensitive information, gets around a guardrail, or returns a wrong but confident-sounding answer. High thresholds and a check after retrieval are the main defenses.One tenant seeing another tenant's data. In a multi-tenant app, a semantic cache without strict per-tenant filters can show one customer's cached response to a different customer's similar query. Filtering by tenant ID has to happen at the vector search step itself, not just in application code after the fact, or a bug in the app becomes a data leak instead of just a wrong answer. Part 3 covers the same risk at the model-serving layer.Personal data in cached responses. Any cached response that includes data tied to a specific person needs a retention and access policy at least as strict as the original response, since the cache is now a second copy of that data with its own TTL and its own access path. Testing Semantic Thresholds Before You Ship "Measure the false-positive rate" is easy to say and easy to skip. A simple process that works: Pull a sample of real (or realistic) query pairs from your own domain, marked by a person as "should share a cached answer" or "should not," including some deliberately tricky near-misses (same topic, different detail, like the laptop price example above).Run the sample through candidate embedding models at a few different thresholds, and check precision on the "should share" label. Optimize for precision here, not recall. A missed cache hit only costs latency. A wrong cache hit gives a wrong answer with full confidence.Re-run this test whenever the embedding model changes, and check it now and then against live traffic, since how real users phrase things shifts over time in ways a fixed test set does not catch. What's Next Exact and semantic caching skip the model call entirely on a hit, which is why they sit in front of everything else. But most requests still reach the model, and what happens there — self-hosted KV cache reuse on engines like vLLM and SGLang, or provider-side prefix caching on Anthropic, OpenAI, and Bedrock — is often the single biggest cost saver on repetitive workloads. Part 3 covers both, along with a provider pricing comparison, a worked cost example, the metrics that actually catch problems, and a full production checklist. Further Reading RedisVL documentation, semantic cache extension and vectorizersGPTCache project documentation

By Ram Ghadiyaram DZone Core CORE
Prompt Caching for LLMs, Part 1: Exact-Match Caching in Production
Prompt Caching for LLMs, Part 1: Exact-Match Caching in Production

Why Prompt Caching Matters for LLM Applications? Modern LLM apps often get the same, or almost the same, prompt more than once. This happens with form submissions, common FAQ questions, agent tool calls, or a user asking the same thing in different words. Without caching, each of these repeat requests pays full token cost, full latency, and adds unwanted pressure on your rate limits. There are four caching methods used in production today. This article, Part 1 of a 3-part series, covers the first and most basic one: exact-match caching. Part 2 covers semantic caching, for requests that mean the same thing but are worded differently. Part 3 covers what happens at the model-serving layer itself: self-hosted KV cache reuse and provider prefix caching, plus the production details every team ends up needing: watching your metrics, working out your costs, and a full checklist. Gateway or application exact-match caching. A hash lookup on a byte-identical or normalized request. Zero cost on a hit. Covered here.Semantic caching. Embedding plus a vector similarity search. Zero model cost on a hit for reworded queries. Covered in Part 2.Inference-engine KV cache reuse, for teams running their own models (vLLM, SGLang). Covered in Part 3.Provider prompt or prefix caching (Anthropic, OpenAI, Bedrock). Covered in Part 3. These layers stack. Check exact match first, then check semantic, then let the request reach the model, where either your own inference engine or the API provider reuses whatever part of the prompt stayed the same. The Full Picture Exact match sits right at the front of the stack. It is the cheapest check to run, so it should catch as many requests as it can before anything more costly runs. Layers 1 and 2 sit in front of the model and can skip the model call entirely. Layers 3 and 4, covered in Part 3, sit inside the model call itself and never skip it. They just make it much cheaper when a part of the prompt repeats. 1. Exact Query Caching (Baseline) Treat the prompt, or a cleaned-up version of it, as a key in a fast key-value store: Redis, Memcached, or an in-process LRU cache. Key Design Hash the full context that matters: system prompt, user message(s), tool definitions, and any settings (like temperature) that change the output.Clean up whitespace, and sort tool lists if their order does not change how the model behaves.Store the full response, or structured output, plus details like timestamp, model version, and TTL.For agents, the key needs more than just the user message. Include the full tool schema (name, description, parameters), any tool-call results you fold back into the context if they are always the same, and leave out anything you don't want changing the key, such as a request ID or trace ID that changes every call but doesn't affect the output. Two common ways a cache silently breaks here: tool definitions listed in a different order between calls, and JSON keys written in a different order by different parts of the same codebase. Sort both before hashing. Don't count on the order matching by chance. Where Should the Cache Live? The store you pick changes how it can fail, more than most teams expect at first: In-process LRU (a local dict, or a library like cachetools) is the fastest choice, under a millisecond, with no network call. It only sees traffic hitting that one process, so on a deployment with many instances, each instance builds its own cache on its own, and the hit rate stays low until every instance has warmed up. This is fine for small deployments, or for caching things that are cheap to redo per instance anyway.A shared store (Redis, Memcached) gives every instance the same view, so a hit on instance A also counts as a hit for a request landing on instance B. This is the right default once you go beyond a single instance, at the cost of a network round trip, usually a few milliseconds on the same network.A two-level setup (a small in-process LRU in front of shared Redis) gives you the best of both: the busiest keys never leave the process, and everything else falls through to the shared store. Worth the extra work once a small number of keys account for most of your traffic, which is common on FAQ-style workloads. Handling Stale Data A fixed TTL, for example, 60 seconds, for time-sensitive data such as travel prices or stock levels.LRU eviction once the cache fills up.Clear the cache on purpose when something changes: a price update, an outage, a policy change. Python example (Redis): Python import hashlib import json import redis from typing import Optional r = redis.Redis(host="localhost", port=6379, db=0) def make_key(prompt: str, model: str, temperature: float = 0.0) -> str: payload = json.dumps({"prompt": prompt, "model": model, "temp": temperature}, sort_keys=True) return "llm:exact:" + hashlib.sha256(payload.encode()).hexdigest() def get_exact(prompt: str, model: str, temperature: float = 0.0) -> Optional[str]: key = make_key(prompt, model, temperature) try: return r.get(key) except redis.RedisError as exc: # Cache being down should never break the request. # Log it and fall through to the model. logger.warning("exact cache read failed: %s", exc) return None def set_exact(prompt: str, response: str, model: str, temperature: float = 0.0, ttl: int = 300): key = make_key(prompt, model, temperature) try: r.setex(key, ttl, response) except redis.RedisError as exc: logger.warning("exact cache write failed: %s", exc) Treat the cache as a nice-to-have, not something the app depends on. If the cache goes down, fall back to full model calls; don't fail the request. Should You Cache Errors? Most production systems say no, or only in some cases, and it is easy to skip thinking about this until something goes wrong. A few good defaults: Never cache a 429 (rate-limited) or 5xx error from the model provider as if it were a real answer. Retry with backoff instead of remembering the failure.If your own guardrail or content filter rejects a response, that is a judgment call. Some teams cache the rejection briefly (a few seconds to a minute) just to stop a broken or hostile client from triggering the same expensive rejection path again and again. Others never cache rejections at all, so they don't end up serving a stale "rejected" result after the input has been fixed.If you do cache rejections, use a clearly different TTL and a different key prefix (llm:reject: instead of llm:exact:) so you can clear them, or leave them out of your hit-rate numbers, separately from real answers. Warming the Cache A cache that just went live is empty, and the first few minutes after any deploy that clears the cache see a drop in hit rate. If your logs keep old prompts and responses, a simple warm-up job that loads the most common prompts from the last few days into the new cache, before it takes real traffic, avoids that drop. This matters most for FAQ-style traffic where a small number of questions make up most of the volume. Request Coalescing: Solving the Thundering Herd Exact-match caching has one failure mode that only shows up under real load: if fifty identical requests arrive at almost the same time, before the first one has filled the cache, all fifty can miss, and all fifty can call the model on their own. This is called a cache stampede, and it is not rare at real traffic levels. A viral post, a batch job starting up, or a retry storm from another system can all set it off. How to Fix It Request coalescing, also called single-flight. The first request for a key takes a short lock (or sets an in-flight marker), and the other requests wait on that same result instead of calling the model on their own. Redis's SET NX pattern, or a library like singleflight in Go, handles this cleanly.Cache the "in progress" state too, not just finished responses, so other requests can see "someone is already working on this" instead of racing to do it themselves.Put a fair timeout on the wait, with a fallback to a normal model call if the in-flight request does not finish in time, so one stuck request does not hold up every other request waiting on it. Without this fix, exact-match caching can actually make traffic spikes worse, not better. Every process learns about a busy key at almost the same moment and hits the model all at once, right when the model can least handle it. When It Shines Templated queries, form-driven flows, test suites, batch jobs — anywhere the same string keeps coming back. Hit rates can be very high in narrow domains and close to zero in open, free-form chat, which is exactly the gap semantic caching, covered in Part 2, is built to close. What's Next Exact-match caching only helps when the input matches exactly, which is common for templated and form-driven traffic but rare in open conversation. Part 2 covers semantic caching: matching reworded questions with embeddings, doing it safely with a verification step, and the invalidation, multi-turn, and security issues that come with trusting a similarity score instead of an exact match. Further Reading Redis documentation, SET command options (including NX for locking patterns)Redis documentation, key eviction policies (LRU, LFU, TTL-based)

By Ram Ghadiyaram DZone Core CORE
Kafka vs Flink vs Spark: Do You Really Need Real-Time?
Kafka vs Flink vs Spark: Do You Really Need Real-Time?

Real-time is the most overused word in data infrastructure. Every vendor in the Kafka vs Flink vs Spark debate leads with it. Milliseconds. Faster engines. Benchmark charts where their product wins. The pitch is always the same, and it plays on a fear: fall behind on latency, and you fall behind on the business. Here is what the pitch leaves out: Most enterprise use cases do not need milliseconds. Many are fine with seconds. Plenty still run on request-response APIs or nightly batch, and that is acceptable. The one place that needs deterministic, hard real-time is OT, and these frameworks cannot serve it. So who runs the speed race? The commercial vendors around the projects, not the projects themselves. Apache Kafka, Apache Flink, and Apache Spark are open source, built by large communities solving real problems. The faster marketing comes from the commercial vendors around them. The community ships capability. The vendors sell speed. The real question behind Kafka vs Flink vs Spark is not latency. It is the SLA. Do You Really Need Real-Time? Ask four questions before you shortlist a single tool. What latency does the business actually require, as a number tied to a use case? Not "fast," but 50 milliseconds, or two seconds, or ten minutes.Is this operational or analytical? A payment is not a dashboard.What is the SLA for data loss and uptime? Can you drop a record, or does the business break if you do?Where does the data live and get consumed? The edge, on-premises, one cloud region, or many? Most teams cannot answer these because nobody defined real-time for the use case. Until you can, latency benchmarks are noise. Real-Time Is a Spectrum, Not a Number Hard real-time is a deterministic system with guaranteed response times and zero tolerance for latency spikes. That is OT: engine control, flight control, a collaborative robot on a factory line. These systems run on C, C++, or Rust in embedded environments. Kafka, Flink, and Spark are not hard real-time systems and never will be. This is a category boundary, not a flaw. I covered this in "Apache Kafka is not hard real-time." Everything else is soft real-time, split into three tiers. Critical real-time means microseconds. Trading engines at a stock exchange. This is not Kafka, Flink, or Spark. It needs specialized, co-located, often proprietary technology.Low-latency real-time means tens to hundreds of milliseconds. Fraud detection in instant payments. Sensor analytics in manufacturing. End-to-end correlation in ride-hailing. This is the sweet spot for data streaming.Near real-time means seconds. Streaming ETL into a warehouse. Regulatory reporting. This is still real-time enough for the business, and it covers a large share of production workloads. Real-time is a spectrum. Kafka, Flink, and Spark serve the low-latency to near real-time tiers, not hard real-time OT. Most enterprise use cases live in the low-latency or near real-time tier. The millisecond pitch targets a tier most workloads never reach. Even a single business shows this. At Nasdaq, the matching engine runs in the critical microsecond tier, but the surveillance, analytics, and reporting around it run in low-latency and near real-time, and Kafka fits those parts, not the matching engine. One use case, several latency tiers, one pipeline. I broke the Nasdaq trading architecture down: Apache Kafka is NOT real-time. Operational or Analytical: The Estate Decides, Not the Latency The distinction that matters more than latency is the estate, the operational side of the architecture versus the analytical side. Operational systems run the business and need transactions, uptime, zero data loss, and disaster recovery. Analytical systems make sense of the business and need throughput, cost efficiency, and freshness. The operational side sits close to systems like the mainframe, Oracle, SAP, and Salesforce. The SLA here is about survival, not speed. If a payment is lost, latency was never the problem. The analytical side powers BI, reporting, and machine learning. The SLA here is about scale and cost. As a rough mapping: Kafka and Flink fit operational workloads. Spark, Databricks, and Snowflake fit analytical workloads. Both matter, with different SLAs. Decide which side you are on first, then pick the tool. That decision drives more than any benchmark. And when a use case genuinely needs both at once, a unified engine like Apache Fluss can serve real-time analytics in one place. Kafka vs. Flink vs. Spark: The Speed Race Nobody Won The history of the speed race is instructive, because the fastest tool rarely won. Pulsar is the clearest example. StreamNative ran benchmark campaigns showing Pulsar with lower latency and higher throughput than Kafka in specific setups. Pulsar won the benchmarks. It lost the market. Back in 2020, I went through the Pulsar vs. Kafka claims one myth at a time, and the conclusion still holds today: the headline benchmarks were setup-dependent, and maturity, ecosystem, and community decided the outcome. Adoption stalled on architectural complexity and a thin ecosystem, while Kafka won on tooling, integrations, and support. Speed was never the deciding factor. Redpanda made a similar bet with strong engineering. It rewrote the broker in C++ with a thread-per-core design and no JVM, pitched on raw low latency and operational simplicity. The market moved a different way. The cost conversation shifted to object storage economics with diskless designs like WarpStream and AutoMQ, and in March 2026 the Apache Kafka community accepted KIP-1150, the umbrella proposal for diskless topics that write directly to object storage. Redpanda read the room. In October 2025, it acquired the Oxla SQL engine and launched the Agentic Data Plane, then added an AI Gateway and governance in February 2026. The headline story moved from fastest broker to agentic enterprise data. The low-latency niche is real, for trading and fraud. It was not the growth engine. Spark is getting faster too. Real-Time Mode was introduced with Apache Spark 4.1, stateless queries first, and reached general availability on Databricks in 2026. It breaks the microbatch floor with longer epochs, concurrent stages, and a streaming shuffle, reaching sub-second latency. Databricks markets it as faster than Flink for feature engineering, and as the reason you no longer need a second engine. The demand is concrete: feature stores and fraud scoring want fresher data. Databricks and Snowflake Speak Kafka at the Ingestion Layer Data ingestion is the other front. Alongside the faster engine, Databricks now speaks the Kafka wire protocol through ZeroBus, and Snowflake announced Datastream, a Kafka-compatible service. In both cases, existing Kafka producers stream straight into the lakehouse with a config change and no new code. Two separate parts of the platform, the engine and the ingestion layer, both aimed at the same goal: fresher data without leaving the lakehouse. That looks like the analytical vendors walking into the operational estate. It is not. Speaking the Kafka protocol for lakehouse ingestion is not running Kafka as an event-driven architecture, a distinction I made in Why Databricks and Snowflake Speak the Kafka Protocol. The lakehouse gets a continuous feed of the events. Kafka still runs the live business. Analytical vendors want the operational moment, but they are buying the feed, not the backbone. The pattern across all of them is consistent. Raw speed rarely wins the deal. Ecosystem, SLAs, and fit win the deal. Benchmarketing: Every Vendor Wins Its Own Benchmark Benchmarketing is the practice of publishing a benchmark designed so the vendor wins. Most vendors do it. The setup is specific: chosen hardware, a favorable workload shape, tuned durability settings, and the percentile that flatters the result. Change one variable and the ranking flips. These numbers describe the vendor's lab, not your production. Source: Jack Vanlightly Take the MakeMyTrip case study from Databricks, which is strong engineering and a real use case. The headline is a P50 latency of 44 milliseconds for personalized last-searched hotels, down from over a second. Read one line further, and the P99 is around 500 milliseconds, and the pipeline still runs Kafka for ingestion, Aerospike for state, and Redis for serving underneath the single-engine narrative. It is a personalization feature that lifts click-through, not a payment that demands exactly-once and zero data loss. The median headline is not the SLA. The tail and the estate are. The fix is simple. Define your use cases and SLAs first. Then test the shortlist against those numbers, on your data, on your infrastructure. In many cases, every tool will be fast enough, and the decision comes down to operations, cost, and ecosystem. Does Agentic AI Need Milliseconds? Agentic AI raises the stakes for data, but not the way the marketing suggests. An agent needs fresh, consistent context. Stale data is the failure mode. An AI initiative built on yesterday's data fails from the start. That part is true, and it matters. Now measure the loop. An agent makes an LLM call, runs tool calls, retrieves context, sometimes waits for a human, and reasons across several steps. End to end, that is hundreds of milliseconds to several seconds. Shaving the data layer from 50 milliseconds to 5 milliseconds is invisible next to a two-second model call. Real-time context, yes. Microseconds, almost never. Hundreds of milliseconds or a few seconds is acceptable for most agentic use cases. Freshness and consistency beat raw speed here, the same lesson as everywhere else. In an agentic loop, the LLM call dominates. Optimizing the data layer from 50 ms to 5 ms is invisible next to it. Erste Group is one of the largest banks in Central and Eastern Europe. They were clear about why they chose Kafka. Real-time messaging was not the requirement. Data consistency across systems was. That is what made Kafka the right fit. I covered it in this Erste Group case study. The same holds for AI: fresh and consistent beats fast. When You Really Need Real-Time, Use Fewer Tools If a use case does need low-latency real-time analytics, complexity is the enemy, not latency. The classic stack stitches together a broker, a stream processor, a serving store, a lakehouse, and a set of sync jobs. Kafka plus Spark or Flink plus Redis plus Iceberg plus glue. Every boundary between systems is where data diverges, and freshness drifts. A newer class of engines takes the opposite path. Instead of stitching systems together, they fold streaming storage, fast lookups, and lakehouse tiering into one layer. Apache Fluss is the clearest example, an incubating project, Flink-native with Spark support coming, created by the Flink SQL lead at Alibaba Cloud and supported by Ververica. Others push toward the same convergence from different angles, including RisingWave, Confluent Tableflow, and the Iceberg-plus-streaming direction the whole market is moving in. Fluss unifies streaming storage, fast lookups, and lakehouse tiering in one system. It offers sub-second freshness, columnar streaming on Apache Arrow, primary-key tables, and native tiering to Iceberg and Paimon, with a union read across hot and cold data. The processing and analytics still run on Flink or a query engine on top. If the use case needs real-time analytics, one engine can replace five systems. It is early, so treat it as a direction, not a finished answer. The principle stands. Fewer moving parts, fewer places to fail. If you really need real-time, fewer systems mean fewer sync boundaries where data can diverge. Latency Is Physics: Edge, On-Premise, Cloud, and Air-Gapped You cannot optimize away the speed of light in a benchmark. A cloud round trip adds latency no engine can remove. Real-time close to the source, in a factory, a vehicle, or a store, needs the edge or on-premises, not a hop to a distant region. Air-gapped environments in defense, OT, and critical infrastructure cannot use the cloud at all. This is where cloud-only analytical platforms hit a wall, and where Kafka and Flink at the edge, on-premises, or in hybrid setups fit the operational estate. Deployment location is part of the SLA. It rarely appears on a benchmark chart. Kafka vs. Flink vs. Spark? Start With the SLA, Not the Speed! Do not follow the real-time hype. Start with the business requirement, define the SLA, pick the estate, then choose Kafka vs Flink vs Spark vs something else. The order matters. Reverse it, and you buy a benchmark instead of an outcome. Look at the data integration landscape, and the answer becomes clear. An event-driven architecture at the core is valuable. It creates consistency and decoupling that batch and point-to-point APIs cannot. But request-response APIs and batch are still there, and that is fine. The ideal is event-driven everywhere. The real world is a mix, and good enough is a legitimate target. The same spectrum, event-driven at the core with batch and request-response around it, shows up in workflow orchestration too. What matters is not real-time. It is data consistency and the right SLA for the estate. Choose Kafka, Flink, Spark, or something else based on that. For deeper context, see the Data Streaming Landscape Q3 2026.

By Kai Wähner DZone Core CORE
Engineering Data Observability: Detecting Schema Drift, Data Drift, and Silent Pipeline Failures
Engineering Data Observability: Detecting Schema Drift, Data Drift, and Silent Pipeline Failures

Modern data platforms are increasingly responsible for powering critical decisions, applications, analytics systems, and AI workloads. As organizations move more business processes onto data-driven architectures, the reliability of data pipelines becomes as important as the reliability of application services. A pipeline that fails loudly is usually easy to diagnose. A failed job, broken dependency, or unavailable service typically generates an alert and directs engineers toward a specific issue. The more difficult problems are the ones that do not interrupt execution at all. A pipeline can complete successfully while producing incorrect, incomplete, or misleading data. This is where data observability becomes essential. Traditional monitoring focuses primarily on whether systems are running. Data observability focuses on whether the data flowing through those systems remains trustworthy. It examines changes in structure, volume, freshness, distribution, and behavior to identify failures that traditional operational monitoring cannot detect. The Problem With Silent Data Failures Modern data ecosystems are rarely static. Enterprises often operate hundreds or thousands of pipelines connecting transactional systems, applications, event streams, warehouses, and analytical platforms. These pipelines evolve continuously as teams add new features, modify applications, and introduce new data sources. A database team may add a new column to a production table. An application team may change the format of an event payload. A third-party provider may alter the frequency or structure of delivered data. Each change may be intentional and technically valid, but it can create unexpected consequences downstream. Consider a customer analytics pipeline that receives transaction events from multiple systems. The pipeline may continue processing records after an upstream application changes a field format from a numeric value to a string. The ingestion process may not fail. The transformation jobs may still complete. Dashboards may continue refreshing. However, the business logic depending on that field may now produce incorrect results. The challenge is not detecting that a system is unavailable. The challenge is detecting that a system is operating while producing unreliable output. Detecting Schema Drift Before It Creates Downstream Issues Schema drift occurs when the structure of data changes over time. This can include adding or removing fields, changing data types, renaming attributes, or modifying relationships between datasets. Many organizations still rely on static schemas and manual documentation to manage these changes. While these approaches provide value, they often cannot keep pace with highly distributed environments. Data observability introduces automated schema monitoring that continuously compares incoming data against expected patterns. Instead of only checking whether a pipeline completed, observability systems examine whether the data structure remains consistent. For example, an observability layer can identify: A previously required field becoming consistently emptyA new field appearing unexpectedly in event streamsA data type changing from integer to textA significant reduction in the number of columns arriving from a source system The goal is not to prevent every schema change. Modern systems need to evolve. The goal is to identify changes quickly, understand their impact, and determine whether they represent expected evolution or an unintended failure. Understanding Data Drift Through Behavioral Changes Schema validation only examines structure. Many data quality issues happen without any structural change. Data drift occurs when data characteristics change over time. A dataset can maintain the same columns while its underlying patterns shift significantly. Examples include: A sudden increase in transactions from a specific regionA sharp decrease in average order valuesUnexpected changes in customer behavior patternsA growing percentage of missing valuesAbnormal distributions in machine learning features These changes are particularly important for AI and analytics systems. Machine learning models often assume that incoming data resembles the data used during development. When production data changes significantly, model performance can degrade without any visible infrastructure failure. Data observability helps teams establish baselines for normal behavior. Instead of defining every possible failure condition manually, systems can analyze historical patterns and identify statistically unusual changes. Combining Deterministic Rules With Intelligent Detection A common misconception is that data observability requires replacing traditional validation with machine learning. In practice, reliable data platforms need both deterministic checks and intelligent anomaly detection. Deterministic validation remains valuable because some conditions are clear. A customer identifier should not be null. A timestamp should follow an expected format. A transaction amount should not be negative. These rules provide strong guarantees for known requirements. However, not every failure can be captured through predefined rules. Unknown issues require systems that can recognize unusual behavior. Statistical and machine learning approaches can analyze: Record volume changesDistribution shiftsUnusual null patternsProcessing delaysUnexpected relationships between datasetsChanges in key business metrics The combination creates a layered defense. Rules catch known problems. Intelligent detection identifies emerging problems that engineers did not anticipate. Data Lineage: Understanding Where Problems Begin Detecting an anomaly is only the first step. The harder question is determining where the issue originated. Large organizations often have complex dependency chains. A single dashboard may depend on dozens of upstream tables, transformations, and source systems. Without visibility into these relationships, engineers may spend hours investigating symptoms rather than causes. Data lineage provides a map of how information moves through the organization. When an anomaly appears, lineage allows teams to answer important questions: Which pipelines depend on this dataset?Which upstream source introduced the change?Which downstream applications may be affected?When did the behavior begin changing? This turns incident response from manual investigation into a structured troubleshooting process. Building Effective Alerting and Root Cause Analysis Poor alerting can create another operational challenge. If every unusual data point generates an alert, engineering teams quickly experience alert fatigue. If alerts are too limited, important failures remain unnoticed. Effective data observability requires context-aware alerting. A sudden increase in records may not indicate a failure if it aligns with a known business event. A small change in a critical dataset may be more significant than a large change in a less important pipeline. Alerts should incorporate factors such as: Business importance of the affected dataSeverity of the anomalyHistorical behaviorDownstream dependenciesConfidence level of detection The objective is not simply generating more notifications. It helps engineers prioritize issues that require action. Designing Reliable Data Platforms for the Future As organizations adopt real-time analytics, AI applications, and increasingly complex data architectures, data reliability becomes an engineering discipline of its own. Reliable pipelines require more than successful job execution. They require confidence that the information moving through those pipelines remains accurate, complete, and useful. A mature data observability strategy combines multiple capabilities: Automated schema monitoringData quality validationStatistical anomaly detectionFreshness trackingPipeline performance monitoringData lineageIntelligent alertingRoot cause analysis The future of data engineering will not be defined only by how much data organizations can process. It will be defined by how confidently they can trust that data. Data observability provides the foundation for building that trust. By detecting silent failures before they become business problems, engineering teams can create data platforms that are not only scalable but also dependable.

By RISHI SHRIVASTAVA
Two AI Agents, One Database: Solving Concurrent Updates With Optimistic Locking
Two AI Agents, One Database: Solving Concurrent Updates With Optimistic Locking

AI agents are moving beyond simple chat interfaces and becoming part of real application workflows. In a modern distributed system, one agent might handle customer refunds, another might manage inventory, while a background process updates the same data at the same time. The main problem isn't always that an agent makes a bad decision. The real issue is that two agents can make valid decisions using the same data and then overwrite each other's changes without knowing that the data has changed. race condition scenario Agent A reads an order record in 'pending' status and decides to approve it.Agent B reads the exact same record concurrently and decides to cancel it.Agent A commits status = 'approved'.Agent B commits status = 'cancelled'.The database now reflects 'cancelled', completely overwriting Agent A's approval based on stale information. This article shows how to prevent this problem using Optimistic Concurrency Control (optimistic locking) with Python and SQLite. 1. The Concurrent Agent Problem In a typical multi-agent setup, multiple agents work through an application or tool layer: Suppose our database table initially contains a single pending order: idStatusupdated_byversion101PendingSystem1 A naive update pattern executes unversioned queries sequentially: SQL -- Agent A commits approval UPDATE orders SET status = 'approved', updated_by = 'agent-a' WHERE id = 101; -- Agent B commits cancellation moments later UPDATE orders SET status = 'cancelled', updated_by = 'agent-b' WHERE id = 101; Because neither query verifies the record state at the exact moment of execution, Agent B silently destroys Agent A's update. This is the classic lost update anomaly. 2. Why AI Agents Widen the Concurrency Window In a traditional web application, updates usually happen within a short request-response cycle. The time between reading and updating data is often limited to network and database delays. Agentic systems work differently. An agent may take much longer to complete a task: An agent may retrieve data, call an LLM, run tools, and process the results before writing back to the database. This read-to-write cycle can take seconds or even minutes. During that time, another agent or process may change the same record. The database therefore needs to check that the data has not changed since the agent first read it. 3. Mechanics of Optimistic Locking Optimistic locking assumes that conflicts are uncommon. It prevents them by checking a record's version before every update. The database table includes a version number that increases with each successful update: SQL CREATE TABLE orders ( id INTEGER PRIMARY KEY, status TEXT NOT NULL, updated_by TEXT, version INTEGER NOT NULL ); INSERT INTO orders (id, status, updated_by, version) VALUES (101, 'pending', 'system', 1); When an agent reads an order, it also reads its current version, such as version = 1. When the agent updates the order, the application checks that the version is still 1 and increases it to 2 as part of the same update. SQL UPDATE orders SET status = 'approved', updated_by = 'agent-a', version = version + 1 WHERE id = 101 AND version = 1; If the record is still at version 1, the update succeeds, and the version becomes 2. SQL UPDATE orders SET status = 'cancelled', updated_by = 'agent-b', version = version + 1 WHERE id = 101 AND version = 1; -- Evaluates to FALSE! (Current database version is 2) Now, if Agent B tries to update the same record using version 1, the condition fails because the database already has version 2. The update affects zero rows, so the application knows that the data has changed and safely rejects the stale update. 4. Python and SQLite Implementation Here is a simple implementation that shows how to set up the database, read records, and safely update them using version checks. Database Setup and Helper Functions Python import sqlite3 def initialize_database(): with sqlite3.connect("orders.db") as conn: conn.execute(""" CREATE TABLE IF NOT EXISTS orders ( id INTEGER PRIMARY KEY, status TEXT NOT NULL, updated_by TEXT, version INTEGER NOT NULL ) """) conn.execute(""" INSERT OR IGNORE INTO orders (id, status, updated_by, version) VALUES (101, 'pending', 'system', 1) """) conn.commit() def get_order(order_id: int): with sqlite3.connect("orders.db") as conn: cursor = conn.execute(""" SELECT id, status, updated_by, version FROM orders WHERE id = ? """, (order_id,)) return cursor.fetchone() def update_order(order_id: int, status: str, agent: str, expected_version: int): with sqlite3.connect("orders.db") as conn: cursor = conn.execute(""" UPDATE orders SET status = ?, updated_by = ?, version = version + 1 WHERE id = ? AND version = ? """, (status, agent, order_id, expected_version)) conn.commit() if cursor.rowcount == 0: raise RuntimeError( f"Conflict detected on order {order_id}. " f"Expected version {expected_version}, but the record has changed." ) return True Demonstrating a Stale Update Python # Both agents inspect the order concurrently order_agent_a = get_order(101) order_agent_b = get_order(101) print(f"Agent A snapshot: {order_agent_a}") print(f"Agent B snapshot: {order_agent_b}") # Agent A successfully commits update_order( order_id=101, status="approved", agent="agent-a", expected_version=order_agent_a[3] ) print("Agent A update: SUCCESS (Version 1 -> 2)") # Agent B attempts update with stale version try: update_order( order_id=101, status="cancelled", agent="agent-b", expected_version=order_agent_b[3] ) except RuntimeError as err: print(f"Agent B update: FAILED -> {err}") Plain Text Console Output: Agent A snapshot: (101, 'pending', 'system', 1) Agent B snapshot: (101, 'pending', 'system', 1) Agent A update: SUCCESS (Version 1 -> 2) Agent B update: FAILED -> Conflict detected on order 101. Expected version 1, but the record has changed. 5. Conflict Resolution: What to Do Next Detecting a conflict is only the first step. What the application does next is important for keeping the system reliable. A common mistake is to retry the failed operation with the latest version without checking the updated data. Don't blindly retry an agent's decision. For example, an agent may decide to cancel an order because it was pending. If the order is now shipped, retrying the cancellation could create a serious data or business logic problem. 6. Optimistic Locking vs. Idempotency These two patterns solve different problems: Optimistic locking: Prevents stale updates when multiple agents or processes change the same record.Idempotency keys: Prevents the same request from being processed more than once, such as after a timeout or retry. 7. Architectural Separation: Keep Consistency Out of the Model LLMs are good at reasoning, but they are not designed to manage database consistency. System prompts alone cannot guarantee data integrity. Core Principle: Layered Responsibility AI agent: Decides what action to take, such as "Cancel order #101."Application service: Checks permissions and business rules.Database: Ensures data stays consistent using version checks and atomic updates. 8. Testing Concurrent Updates The earlier example shows how a stale update is rejected. We can take it one step further and run two updates at the same time. Python's threading module can help simulate two agents working on the same order: Python import threading def agent_update(agent, status): order = get_order(101) try: update_order( order_id=101, status=status, agent=agent, expected_version=order[3] ) print(f"{agent}: update successful") except RuntimeError as err: print(f"{agent}: update failed -> {err}") thread_a = threading.Thread( target=agent_update, args=("agent-a", "approved") ) thread_b = threading.Thread( target=agent_update, args=("agent-b", "cancelled") ) thread_a.start() thread_b.start() thread_a.join() thread_b.join() Both threads read the order and try to update it. Only the update using the current version can succeed. The other update receives a conflict instead of overwriting the first change. The exact order of the output can vary because the threads run concurrently. For example: Plain Text agent-a: update successful agent-b: update failed -> Conflict detected on order 101. This is the key benefit of optimistic locking: the database decides which update is valid based on the version, rather than relying on which agent happens to write last. 9. Production Checklist When building multi-agent workflows that update operational databases, keep these practices in mind: Use transactions: Use transactions when updating multiple tables so all changes succeed or fail together.Add backoff and jitter: Add random delays between retries to avoid too many agents retrying at the same time.Keep audit logs: Record details such as the agent ID, model version, and data version for each update.Limit retries: Limit automatic retries to 2–3 attempts. If conflicts continue, send the task for human review. Final Thoughts As AI agents become more involved in real-world applications, traditional distributed systems problems become important again. Two agents can make correct decisions independently but still cause problems when they update the same data at the same time. Treating agents as independent clients and using optimistic locking at the database level helps prevent stale updates and keeps data consistent, even when agents take longer to complete their tasks.

By Tanushree Das
Designing a Polling Pipeline for Rate-Limited APIs Without Losing Data
Designing a Polling Pipeline for Rate-Limited APIs Without Losing Data

Every system that ingests data from someone else's API eventually writes a poller. It starts as fifteen lines in a cron job: hit the endpoint, compare against the last timestamp, insert what's new. It works immediately, which is the problem — it keeps appearing to work long after it has started losing records. I maintain an ingestion layer that polls public discussion APIs continuously, and the gap between "the poller is running" and "the poller is correct" took considerably longer to close than I expected. What follows are the four failure modes that caused real data loss, and the patterns that fixed them. None of this is exotic. It is the set of things I wish had been in one place before I wrote the first version. Failure Mode 1: The Fixed Interval The naive poller runs on a fixed schedule — every 60 seconds, every source, forever. This is wrong in both directions simultaneously. High-volume sources produce more records between polls than a single page returns, so you lose everything past the page boundary. Low-volume sources return nothing on the vast majority of calls, burning quota that the high-volume sources needed. With a shared quota across sources, the fixed interval guarantees you are under-sampling exactly where the data is. The fix is to let observed yield drive the interval. If the last poll came back full, poll sooner. If it came back empty, back off. TypeScript interface PollState { sourceId: string; intervalMs: number; consecutiveEmpty: number; } const MIN_INTERVAL = 30_000; const MAX_INTERVAL = 1_800_000; // 30 min function nextInterval(state: PollState, recordsFound: number, pageSize: number): number { // Page came back full — we are probably truncating. Poll aggressively. if (recordsFound >= pageSize) { return MIN_INTERVAL; } if (recordsFound > 0) { // Productive but not saturated. Ease toward the current rate. return clamp(state.intervalMs * 0.8, MIN_INTERVAL, MAX_INTERVAL); } // Empty. Back off geometrically, but bounded. const factor = 1.5 ** Math.min(state.consecutiveEmpty, 6); return clamp(MIN_INTERVAL * factor, MIN_INTERVAL, MAX_INTERVAL); } function clamp(n: number, lo: number, hi: number): number { return Math.min(hi, Math.max(lo, n)); } The condition worth highlighting is recordsFound >= pageSize. A full page is not a success signal — it is evidence that records may exist beyond what you fetched. Treat it as a truncation warning and either paginate immediately or shorten the interval. Systems that treat a full page as "great, got everything" lose data proportional to source velocity, which means they lose the most from the sources that matter most. After deploying adaptive intervals, our total request volume dropped by roughly 40% while records captured went up, because quota moved from silent sources to active ones. Failure Mode 2: The Watermark Boundary The standard incremental pattern stores the timestamp of the newest record seen and requests everything after it: SQL SELECT * FROM source WHERE created_at > :watermark ORDER BY created_at This loses records, for three independent reasons. Clock skew. The upstream timestamp is assigned by their server, not yours. Distributed writers mean created_at is not guaranteed to be monotonic in the order records become visible to the API.Visibility lag. A record can be written at T but not appear in query results until T+2s due to replication or index lag. Poll at T+1s, advance the watermark past T, and that record is never returned.Ties. Multiple records sharing the same timestamp, split across a page boundary, silently drop the remainder when you use a strict >. The fix is to rewind the watermark by a safety margin and deduplicate downstream: TypeScript const OVERLAP_MS = 120_000; // tune to observed upstream lag function queryWindow(watermark: number): { since: number; until: number } { return { since: watermark - OVERLAP_MS, until: Date.now(), }; } This deliberately re-fetches records you already have. That is the point — you trade a small amount of redundant bandwidth for the guarantee that a record has to be missed by two consecutive polls to be lost permanently. Size OVERLAP_MS From measurement, not intuition. Log the delta between upstream created_at and your own ingest time, take the 99th percentile, and double it. Ours sat around 40 seconds at p99, so 120 seconds gives real headroom without meaningful cost. Failure Mode 3: Deduplication That Isn't Overlap windows only work if dedup is correct, and ID-based dedup handles less than people assume. Upstream records get edited. A post whose body changes after ingestion keeps its ID, so an INSERT ... ON CONFLICT DO NOTHING on the ID silently discards the update. Meanwhile, some sources reuse or re-issue identifiers across deletion, so the ID alone is not always a stable key either. Hash the fields that constitute a meaningful change, and store both: TypeScript import { createHash } from "node:crypto"; function contentHash(record: SourceRecord): string { // Only fields whose change means "this record is materially different." // Volatile counters (score, comment count) are excluded on purpose. const canonical = JSON.stringify({ id: record.id, title: record.title ?? "", body: record.body ?? "", author: record.author ?? "", }); return createHash("sha256").update(canonical).digest("hex"); } SQL INSERT INTO records (source_id, external_id, content_hash, payload, first_seen_at, last_seen_at) VALUES ($1, $2, $3, $4, now(), now()) ON CONFLICT (source_id, external_id) DO UPDATE SET content_hash = EXCLUDED.content_hash, payload = EXCLUDED.payload, last_seen_at = now(), revision = records.revision + 1 WHERE records.content_hash IS DISTINCT FROM EXCLUDED.content_hash; Two details carry most of the weight. The WHERE clause means the overlap window costs nothing when nothing changed — no write amplification, no spurious updated_at churn, and downstream consumers watching for changes don't get woken up by re-fetches. And excluding volatile counters from the hash is what makes this viable at all. Include a score that ticks every few seconds and every single poll registers as a change, which defeats the purpose and turns your overlap window into a write storm. Failure Mode 4: Retry Storms and Undetected Gaps When a rate-limited API returns 429, the instinct is to retry. Retry immediately, and you extend the penalty. Retry on a fixed delay across N workers, and they resynchronize into a thundering herd that hits the limit together, forever. Most rate-limited APIs tell you what you need in response headers. Read them instead of guessing: TypeScript interface RateLimitState { remaining: number; resetAt: number; } function parseRateLimit(res: Response): RateLimitState | null { const remaining = res.headers.get("x-ratelimit-remaining"); const reset = res.headers.get("x-ratelimit-reset"); if (remaining === null || reset === null) return null; return { remaining: Number(remaining), // Some APIs send seconds-until-reset, others an absolute epoch. Normalize. resetAt: Number(reset) > 1e9 ? Number(reset) * 1000 : Date.now() + Number(reset) * 1000, }; } async function backoff(attempt: number, res?: Response): Promise<void> { const retryAfter = res?.headers.get("retry-after"); if (retryAfter) { const ms = Number(retryAfter) * 1000; if (Number.isFinite(ms)) return sleep(ms); } // Full jitter — see AWS Builders' Library on backoff. const ceiling = Math.min(60_000, 1000 * 2 ** attempt); return sleep(Math.random() * ceiling); } const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms)); Full jitter matters more than the backoff curve. Exponential backoff with a deterministic delay keeps clients synchronized; randomizing across the whole interval is what actually spreads load. Retry-After, When present, it is authoritative — honor it over your own calculation. The subtler problem is that these failures are invisible. A source that throws 429 for six hours produces no errors in your application logs if the poller catches and backs off correctly. It just quietly returns nothing, and your data has a hole in it that nobody notices until someone asks why a report looks wrong. Detect gaps explicitly rather than inferring them from error rates: TypeScript async function detectGaps(sourceId: string): Promise<Gap[]> { const { rows } = await db.query(` SELECT window_end AS gap_start, LEAD(window_start) OVER (ORDER BY window_start) AS gap_end FROM poll_log WHERE source_id = $1 AND status = 'ok' AND window_start > now() - interval '48 hours' ORDER BY window_start `, [sourceId]); return rows .filter(r => r.gap_end && r.gap_end - r.gap_start > GAP_THRESHOLD_MS) .map(r => ({ sourceId, from: r.gap_start, to: r.gap_end })); } This requires logging every poll attempt with its requested window and outcome — a table most people skip because it feels like overhead until the first time it tells you about four hours of missing data you would otherwise never have found. Feed detected gaps into a low-priority backfill queue that runs when quota is available. What Actually Matters If you take three things from this: Log the window, not just the result. Without a record of what range each poll requested, gaps are undetectable. This is the single highest-value thing to add to an existing poller.Overlap deliberately, dedup by content. A safety margin plus content-hash dedup converts "we might have missed something" into "a record must be missed twice to be lost."Treat a full page as a warning. It is the most common silent truncation point in production pollers, and it is one comparison to check for. None of these are difficult. They are just easy to omit, and their absence produces a system that looks healthy while quietly dropping records. I work on the ingestion layer at SignalMelo, which polls public discussion sources continuously — the patterns above came out of production incidents there. Disclosure: it's a commercial product I help build.

By CARTER WANG
Decoupling a Data Pipeline From the Tables It Was Never Supposed to Depend On
Decoupling a Data Pipeline From the Tables It Was Never Supposed to Depend On

I built a pipeline framework on top of a convenience feature, and for about a year it looked like the best decision in the design. The framework generates analytics pipelines from declarative configuration: a user describes the events, stages, and metrics they care about, and the framework produces the Spark jobs, output tables, and dashboards. To make those pipelines incremental, I required every upstream source to be a table with change data feed enabled. The table format's changelog told us exactly which rows had been inserted, updated, or deleted since the last run, so every generated pipeline processed only deltas, for free, with no bookkeeping code of its own. The fragility hidden in that decision took longer to surface than it should have because it never showed up as a framework bug. It showed up as other people's schema changes. The Coupling Nobody Signed Up For When your only supported source type is a physical table with a change feed, every pipeline you generate is bound directly to that table's physical schema. Not to the concept the table represents, and not to some resilient subset of columns. It is bound to the table itself, exactly as its owning team defined it this week. Upstream teams in a large organization evolve their tables constantly, and they are right to. A column gets renamed to match a naming convention. A type gets widened. A table gets rebuilt as part of a storage migration and picks up a new layout. From the owning team's perspective, these are internal changes to an asset they own. From my framework's perspective, each one was a breaking change delivered without notice to every downstream pipeline reading the table. Because the framework made pipelines cheap to create, there were a lot of them. One upstream rename could break a dozen production pipelines in a single morning, none of which had changed at all. The standard answer to this problem is an isolation layer: put a view between the physical table and its consumers, and absorb schema changes in the view definition. That is exactly the layer my design made impossible. Change data feeds are a property of physical tables. A view does not emit a changelog. By requiring change-data-feed sources, I had not just failed to build an isolation layer. I had structurally forbidden anyone from adding one. The convenience feature and the fragility were the same feature. It is worth being precise about why the usual mitigations do not work here. Asking upstream teams to freeze their schemas does not scale past two or three teams, and should not, because it converts your fragility into their paralysis. Materializing private copies of every upstream table restores isolation but doubles storage and adds a freshness lag you now have to monitor. Contract tests detect the breakage earlier, which is worth something, but detection is not absorption. The pipelines still break; you just get a nicer error message. The only structural fix is to let pipelines depend on an interface rather than an implementation, which meant the framework had to stop requiring physical tables at all. Re-Architecting for Views and Arbitrary SQL Supporting views and arbitrary SQL queries as first-class upstream sources sounds like adding a source type. It is actually a rewrite of the framework's incremental-processing model, because the thing you lose when you give up the change feed is the framework's entire notion of "what's new." The replacement is less elegant and more honest: date-field-based processing. Every view or SQL source declares a date or timestamp field that partitions its data by processing period. In the declarative config, the difference between the old world and the new one is small on the surface: YAML sources: # Old style: physical table, incremental via change data feed orders_cdf: type: table name: prod.orders_v2 # New style: view or SQL, incremental via a declared date field orders_view: type: view name: analytics.orders_stable date_field: order_date sessions_sql: type: sql query: > SELECT s.session_id, s.user_id, s.started_at, d.channel FROM prod.sessions s JOIN prod.session_details d ON s.session_id = d.session_id date_field: started_at Underneath, everything changes. Instead of asking the storage layer which rows changed, the framework tracks which date ranges each pipeline has processed and generates predicates that read exactly the unprocessed ranges: SQL SELECT * FROM analytics.orders_stable WHERE order_date >= '{{ watermark }' AND order_date < '{{ run_end }' This is watermark-based incremental processing, one of the oldest patterns in data engineering, and there is a reason it has survived: it depends only on the logical content of the data, never on any physical property of how the data is stored. A view can answer a date-range predicate. A three-table join can answer it. A changelog can only be asked for by the physical table's direct reader. Moving to date-range semantics forced two other pieces of the re-architecture. The first was backfill handling. Change-feed processing has no natural story for reprocessing history; the feed only moves forward, and most implementations retain limited history anyway. Date-range processing makes backfill a first-class operation. Reprocessing means re-running a set of date ranges, and correctness means each range must be idempotent, overwriting that period's output atomically rather than appending to it. Building that idempotency into every generated pipeline, instead of leaving it to each pipeline author, was most of the work. It also required adding a true batch mode, because a three-year backfill and a daily increment are the same operation at different scales only if the execution engine treats them that way. The second piece was a source-contract layer, and this is the part I would build first if I were starting over. Each pipeline declares the columns it needs from each source, with expected types and nullability, and the framework validates every source against its contract before any run: Python def validate_contract(source_schema, contract): failures = [] for col in contract.columns: actual = source_schema.get(col.name) if actual is None: failures.append(f"missing column: {col.name}") elif not compatible(actual.dtype, col.dtype): failures.append( f"type drift on {col.name}: " f"expected {col.dtype}, found {actual.dtype}" ) elif col.required and actual.nullable: failures.append(f"nullability drift on {col.name}") if failures: raise SourceContractError(source=contract.source_name, failures=failures) When an upstream schema changes now, one of two things happens, and both are enormous improvements over silent breakage. Either the view definition absorbs the change, and the contract still validates, in which case downstream pipelines never know anything happened; or validation fails before the run starts, producing a named, actionable discrepancy (this column, this type, this source) instead of a runtime failure deep inside a generated Spark job at 3 a.m. What Actually Changed The measurable effect was the disappearance of a whole failure category. Schema drift incidents went from a recurring operational tax, each one a cross-team scramble to identify what changed and patch every affected pipeline, to a non-event absorbed at the view layer, usually by the upstream team itself as part of making their change. The less measurable effect was on how teams model their data. Once views were first-class sources, upstream teams could treat their physical tables as private implementation details and publish stable view interfaces on top, which is how table ownership should work anyway. The framework had previously punished that discipline. Now it rewarded it. The lesson I keep returning to is about where convenience features belong in a design. Change data feeds are a genuinely good optimization. My mistake was promoting an optimization into an interface. The framework's contract with its sources became "you are a physical table with a changelog" when it should have been "you can answer a date-range query and honor this column contract." Optimizations belong behind interfaces, where you can keep them for the sources that support them and fall back cleanly for the sources that do not. When an optimization becomes the interface, every one of its physical preconditions becomes a coupling point, and you inherit fragility from parts of the system you never intended to depend on. The tables were never supposed to be the dependency. The data was.

By Rahul Narakula
A Non-Expiring AKS Deployment Token Could Read Secrets Across Three Namespaces
A Non-Expiring AKS Deployment Token Could Read Secrets Across Three Namespaces

A security review started after connection strings were visible through a Kubernetes management tool. The first request sounded simple: remove Secrets from the cluster and move the values to Azure Key Vault. That request focused on which system stored the values. The access review found a wider problem. Kubernetes stored a deployment service account's legacy token in a kubernetes.io/service-account-token Secret. The token had no expiry in its normal use, and RoleBindings allowed the same identity to operate in three application namespaces. The Role used resources: ["*"] across several API groups and allowed get, list, watch, create, update, patch and delete. The Role included the core API group, so the token could read every Secret in each of those namespaces. The review found no evidence of token misuse. It found an avoidable access path with a long lifetime and a larger scope than the pipeline needed. Moving application passwords to Key Vault would improve their source of truth and rotation. It would not revoke this token, narrow its RBAC permissions or remove the cross-namespace bindings. Those controls needed their own fix. Why the Kubernetes Secrets Existed The application images carried JSON configuration files for local development. Database, cache and message-broker endpoints pointed to localhost. Those defaults were useful on a developer machine and unusable inside the cluster. The shared Helm chart supplied the deployment values at runtime. It rendered an Opaque Secret from a secrets map, then loaded the Secret into the application container through envFrom. The reduced chart looked like this: YAML {{- if .Values.secrets } apiVersion: v1 kind: Secret metadata: name: {{ include "app.fullname" . }-secrets type: Opaque stringData: {{- range $key, $value := .Values.secrets } {{ $key }: {{ $value | quote } {{- end } {{- end } The Deployment then loaded every entry as an environment variable: YAML envFrom: - secretRef: name: {{ include "app.fullname" . }-secrets The application configuration placed environment variables after the file-based settings, so the runtime values won. That ordering made the Kubernetes Secret part of the configuration path. Removing it without replacing that path would leave the containers pointing at local services. Figure 1. The existing deployment used a Kubernetes Secret as the runtime override for local file defaults. The next question was, "Which components can retrieve the value, and how long does each form of access last?" Key Vault Does Not Always Remove the Kubernetes Secret The Azure Key Vault provider for the Secrets Store CSI Driver supports more than one consumption model. A pod can read mounted files directly from a CSI volume. This path can avoid creating a native Kubernetes Secret. The application still needs a configuration method that reads those files and responds safely when their contents rotate. The driver can also copy mounted values into a native Kubernetes Secret through the secretObjects field of a SecretProviderClass. Microsoft documents this as secret synchronisation. It is useful when an application already consumes secretKeyRef or envFrom, which was the case here. It also means that moving the source value to Key Vault does not remove the Secret object from Kubernetes. YAML apiVersion: secrets-store.csi.x-k8s.io/v1 kind: SecretProviderClass metadata: name: app-vault spec: provider: azure secretObjects: - secretName: app-runtime-secrets type: Opaque data: - objectName: database-password key: Database__Password The choice affects rotation too. Microsoft notes that an existing process does not receive updates when a container consumes a Kubernetes Secret through an environment variable. The team must restart the pod before the process receives the new value. Key Vault remains a sound source for secrets. The important point is narrower: the storage migration and the Kubernetes access review solve different problems. The Service Account Crossed Namespace Boundaries The next part of the review followed the identities that could read Secrets. Kubernetes allows a RoleBinding in one namespace to name a ServiceAccount from another namespace. That feature is useful for controlled cross-namespace work. It also means that checking only the ServiceAccount's home namespace can understate its reach. The review found a layout equivalent to this generalized example: YAML apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: pipeline-deployer namespace: environment-b rules: - apiGroups: ["", "apps", "batch", "autoscaling", "networking.k8s.io", "policy"] resources: ["*"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: pipeline-deployer-from-a namespace: environment-b subjects: - kind: ServiceAccount name: pipeline-deployer namespace: environment-a roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: pipeline-deployer Two bindings of this form extended the identity from its home namespace into two more namespaces. The same bearer token could therefore authenticate once and use the permissions that each Role granted. Figure 2. Two cross-namespace bindings extended one long-lived credential into three namespaces. The identity was not a cluster administrator. The Role listed its API groups, and it did not include rbac.authorization.k8s.io. The token could not grant itself new RoleBindings through this Role. That limit mattered, but it did not make the existing scope acceptable. The core API group still covered Secrets, and the wildcard resource rule covered much more than the deployment needed. The following authorization check avoids printing any secret value: Shell identity="system:serviceaccount:environment-a:pipeline-deployer" for namespace in environment-a environment-b environment-c do printf '%s: ' "$namespace" kubectl auth can-i list secrets \ --namespace "$namespace" \ --as "$identity" done For the reviewed identity, the effective result was yes in all three namespaces. The Token Type Made the Scope Harder to Contain The service account had one manually created Secret of type kubernetes.io/service-account-token. Kubernetes describes this as a legacy mechanism that provides a long-lived credential. The current documentation recommends the TokenRequest API for short-lived tokens instead. The difference changes the failure window. A deployment job can request a token that expires shortly after the job finishes. If someone copies a static token into a CI/CD service connection, that credential can remain useful until somebody deletes or rotates it. An old export, agent workspace or copied configuration can preserve the same access during that period. The cluster version already supported projected service account tokens. Another environment-specific service account had no legacy token Secret, which confirmed that the static pattern was not present in every namespace. The First Fix Reduces the Token's Reach The quickest containment step is to remove the two cross-namespace RoleBindings. That immediately reduces the token's potential reach from three namespaces to one without changing the applications. Each environment should then have its own deployment identity, Role and RoleBinding. A pipeline for one namespace should not borrow the service account from another. This keeps the credential, audit trail and revocation boundary aligned with the environment it deploys. The desired shape is simple: Plain Text pipeline A uses a short-lived token for its Role in namespace A pipeline B uses a short-lived token for its Role in namespace B pipeline C uses a short-lived token for its Role in namespace C These deployments require no cross-namespace subject. Figure 3. The target design aligns one service account and its short-lived token with one namespace. A Short-Lived Token Replaces the Static Credential Kubernetes can issue a bounded token with the TokenRequest API. kubectl create token is a convenient way to exercise that API: Shell kubectl create token pipeline-deployer \ --namespace environment-a \ --duration 15m The command covers only one part of a CI/CD design. The runner still needs a trusted way to request the token. The pipeline should receive the credential at run time, the requester should limit its audience, and the token should expire soon after the deployment window. The service connection must stop storing the old bearer token before that change has value. After the new path succeeds, delete the legacy token Secret and confirm that the API rejects the old credential. Explicit RBAC Replaces Wildcard Access resources: ["*"] made future chart changes part of the role automatically. Kubernetes warns that wildcard rules can grant access to resource types that future API extensions add. A deployment role should name the resource types and verbs the release actually uses. The rendered manifests provide the initial resource list: Shell helm template app ./chart \ --namespace environment-a \ --values values.environment-a.yaml \ > rendered.yaml Inventory every apiVersion and kind in that output. Then compare the result with deployment calls in API audit logs or a dry run. The resulting Role may need access to Deployments, Services, ConfigMaps, Secrets, Jobs, Ingresses and autoscaling resources. It should not receive every resource merely because the chart might use one later. If a separate controller owns runtime Secrets, the deployment identity can lose Secret write access as well. If Helm still renders those Secrets, the role needs the exact verbs required by that release process. The policy must match the delivery design instead of hiding a required permission until the next deployment fails. The Review Found Other Paths to the Same Values The cluster token was the widest durable access path that the review found. Several pipeline variables also stored credentials as ordinary variables. Azure DevOps treats secret variables as protected resources. It encrypts their values at rest and masks exact values in logs. A task can still send a value elsewhere, and masking does not always hide partial strings. Marking the variables as secret still removes routine plaintext visibility from the library interface and logs. The remediation plan combined four related controls: Mark credential variables as secret and restrict which pipelines can use each variable group.Remove routine human permission to read Kubernetes Secrets through cluster tools.Rotate the database, cache and broker credentials that broader access paths exposed.Move non-sensitive settings out of the Helm secrets map and into a ConfigMap. Moving non-sensitive settings to a ConfigMap makes the review surface honest. Feature flags, log levels and endpoint names do not need to sit beside credentials merely because the original release populated only one values map. Validation Uses the Identity's Point of View The validation must test permissions from the identity's point of view. For each deployment identity, build an explicit matrix: Plain Text own namespace other namespaces read required objects yes no apply release objects yes no read application Secrets only if required no modify RBAC no no Then verify the old paths: the deleted legacy token fails authenticationeach identity returns no for Secret access outside its namespacethe pipeline can still deploy and roll backvariable-group values appear masked in the interface and logscluster users without an operational need cannot reveal Secret valuesrotated application credentials work and the previous values fail This sequence keeps the deployment usable while shrinking the access path in measurable steps. Secret Location and Secret Access Need Separate Reviews The visible Kubernetes Secret started the investigation, but deleting that object first would have left the long-lived deployment credential untouched. Using CSI secret synchronization could even have recreated the same type of object from a better source. The useful review order was identity, scope, lifetime, source and rotation. It exposed one token that crossed three namespace boundaries, wildcard permissions that exceeded the release surface, and pipeline values that lacked basic secrecy controls. Key Vault can improve storage and rotation. Short-lived credentials and narrow RBAC control who can reach the Kubernetes API. Environment-specific identities contain the effect of a leaked token. These controls work together, and none of them can substitute for the others. References Kubernetes documentation: SecretsKubernetes documentation: Service AccountsKubernetes documentation: Managing Service AccountsKubernetes documentation: RBAC good practicesMicrosoft Learn: Azure Key Vault provider configuration options for AKSMicrosoft Learn: Access Key Vault through the CSI Driver on AKSMicrosoft Learn: Secrets in Azure PipelinesMicrosoft Learn: Manage Azure Pipelines variable groups

By Ahmed Tariq
Build a GitHub Contribution City With Java and Quarkus
Build a GitHub Contribution City With Java and Quarkus

GitHub's contribution calendar gives you an already iconic overview of your activity over the year. Each day has a square, and its color changes with the contribution level. And of course, those days and contributions can also be arranged into buildings, with a week becoming a small part of a city and busier weeks adding height to the skyline. I had some spare minutes and built Quarkus Contribution City around this idea, using Java and Quarkus to generate an SVG from GitHub's contribution data. The visual inspiration came from Pink Pixel's skyline, and you can see a version with my real data on my GitHub profile. A scheduled GitHub Action updates the image at night. For a Java developer, this is a small project you can follow from the API request through to the image. You can use the released action on your own profile, then change the drawing code locally once you have a feel for how the city is put together. For this article, I created a special DZone example that adds a small piece of character art above the buildings. Add the City to Your Profile Your GitHub profile README lives in a public repository with the same name as your account. For my account, that repository is myfear/myfear. Open your own profile repository, or create it with a README if you haven't used this GitHub feature before. Copy the project's complete publishing workflow into .github/workflows/contribution-city.yml on the default branch. This example checks out your profile repository and the action's v1 release line. It then generates the image and publishes it to an output branch. The workflow includes the repository write permission needed for that last step. The generation step uses the repository owner's username, so the same configuration can be copied between personal profile repositories. You can add the layout options to that step: - name: Generate contribution city id: city uses: ./.city-action with: github-token: ${{ secrets.CONTRIBUTION_TOKEN || secrets.GITHUB_TOKEN } username: ${{ github.repository_owner } weeks: '53' height: '14' theme: github-dark The local path refers to the action checkout made earlier in the example workflow. The built-in GITHUB_TOKEN is the starting point for reading your visible contribution data. An optional CONTRIBUTION_TOKEN secret can supply a personal token when additional access is needed. The calendar returned by GitHub depends on the token's permissions and your account's contribution visibility settings. After committing the workflow, open Actions in your profile repository, select publish-contribution-city, and choose Run workflow. A successful run creates contribution-city.svg on the output branch. Add this image reference to your profile README, replacing both occurrences of USERNAME: ![My GitHub contribution city](https://raw.githubusercontent.com/USERNAME/USERNAME/output/contribution-city.svg) The example also has a daily schedule for 03:17 UTC. Subsequent runs create a commit when the generated image changes. For this setup, the workflow and its run history can be found in your profile repository, while the Java implementation is maintained in the action's repository. Give Each Week a Building The city is arranged in time order, with the most recent week on the right. Every building is two character cells wide, so all weeks occupy the same horizontal space. Weekly contribution totals determine the height, and daily contribution levels provide the window colors. Month labels beneath the street help you find your place in the year. Height needs a little extra thought. A very busy week can have many times the contributions of a quiet one. With a linear scale, those quieter weeks would be compressed close to the street. The city uses a logarithmic scale, which gives them more room while preserving the order of weekly totals. For each week, the calculation can be expressed as: int height = weeklyTotal == 0 ? 1 : 1 + (int) Math.round( Math.log1p(weeklyTotal) / Math.log1p(maximumWeeklyTotal) * (maxHeight - 1)); With a maximum of 20 contributions and a height limit of 14, a week with three contributions gets seven window rows. The busiest week gets 14, and a week with zero contributions keeps one row. Quiet periods therefore retain their position in the calendar. An antenna marks the busiest displayed week; when totals are tied, the most recent week receives it. The two columns of windows are filled by cycling through the days of the week. This repeats the daily pattern in taller buildings, so window count is a visual texture. The weekly total controls height, while the window colors carry the daily contribution levels. Together, they give you a view of the pattern across your calendar. You can change weeks to 12 for a shorter view. The tallest building is then calculated from those recent weeks, which lets the selected period use the available height. Keep this in mind when comparing images: the same week can appear taller in a shorter view. The displayed contribution total still covers the full calendar returned by GitHub. Follow the Data Through Java The released project uses Quarkus with the Quarkus GitHub Action extension. That extension connects an @Action method to workflow inputs, outputs, and the job summary. Inside the method, the drawing process comes down to three steps: ContributionCalendar calendar = contributionClient.fetch( configuration.username(), inputs.getGitHubToken().orElseThrow(), context.getGithubGraphQLUrl()); Scene scene = cityBuilder.build(calendar, configuration.options()); String svg = svgRenderer.render(scene, configuration.options().theme()); The client reads the contribution calendar with one GraphQL request and converts the response into Java records for the calendar, weeks, and days. CityBuilder uses these records to place roofs, windows, and the street in a grid. SvgRenderer turns that grid into the final SVG. Changes to the skyline can therefore be made in plain Java classes, with the GitHub connection kept in the client. The SVG contains the shapes and text needed to display the city. Adjacent characters with the same color are grouped during rendering, and their horizontal positions are set explicitly to keep the columns aligned. Identical data and options produce identical file contents, which allows the publisher to compare images before creating a commit. The action sets up Java and JBang, builds the selected source revision, and runs the packaged application. Change the Layout Locally To try a change, install JDK 21 and JBang, with Git and Bash available. The repository includes a Maven wrapper. JBang is also used by the integration tests to run the packaged action through the same launcher used in GitHub Actions. git clone --branch v1.0.0 https://github.com/myfear/quarkus-contribution-city.git cd quarkus-contribution-city ./mvnw verify The tests use local test data and a local GraphQL server, so you can run them without GitHub credentials. They also generate SVG previews under target/previews. Open github-dark.svg, recent-12.svg, and empty.svg in a browser to compare a full calendar, a shorter period, and a calendar with zero contributions. Start with the height calculation in CityBuilder, then run the same command again and compare the previews. The saved data stays the same between runs, which makes the effect of your change easier to see. The project is available under the Apache License 2.0, and the v1.0.0 release gives you a fixed starting point. Give the City a DZone Landmark Version 1.0.0 exposes weeks, height, and the two built-in themes through workflow inputs. For a custom shape, you extend the Java code in your fork. The Scene record gives you a grid of cells to change before the SVG is rendered, and that is where we'll add the DZone lettering. Each cell has a character, a role such as roof or window, and the color information used by the renderer. A character mask is enough to describe a new shape: # marks a filled block, and spaces leave the background visible. By arranging those blocks, you can draw letters, an arch, or a stepped tower. For this example, the lettering is placed above the weekly buildings. It has its own fixed shape, while the buildings below continue to show the contribution calendar. The image uses a snapshot of my real account data, with 534 contributions returned by GitHub on October 5, 2026, when I wrote this article. A DZone-inspired palette and decorative lettering added to my contribution city. The weekly building heights and daily window patterns come from the same calendar used by the regular view. Add this class to the existing city package in your fork, at src/main/java/com/themainthread/contributioncity/city/DZoneLandmark.java: package com.themainthread.contributioncity.city; import java.util.ArrayList; import java.util.Collections; import java.util.List; import com.themainthread.contributioncity.render.Theme; public final class DZoneLandmark { public static final Theme THEME = new Theme("dzone-example", "#161b22", "#242c36", "#303947", "#f58a42", "#9ba9ba", "#edf2f7", List.of("#536070", "#86431f", "#b85b25", "#e57d36", "#ffb365")); private static final List<String> MASK = List.of( "#### ##### ### # # #####", "# # # # # ## # # ", "# # # # # ## # # ", "# # # # # # # # #### ", "# # # # # # ## # ", "# # # # # # ## # ", "#### ##### ### # # #####"); private DZoneLandmark() { } public static Scene addTo(Scene city) { int landmarkWidth = MASK.getFirst().length() * 2; int width = Math.max(city.width(), landmarkWidth); int left = (width - landmarkWidth) / 2; List<List<Cell>> rows = new ArrayList<>(); Cell block = new Cell('█', CellKind.ROOF, 0, -1); for (String line : MASK) { List<Cell> row = new ArrayList<>(Collections.nCopies(width, Cell.SKY)); for (int column = 0; column < line.length(); column++) { if (line.charAt(column) == '#') { row.set(left + column * 2, block); row.set(left + column * 2 + 1, block); } } rows.add(row); } rows.add(Collections.nCopies(width, Cell.SKY)); for (List<Cell> sourceRow : city.rows()) { List<Cell> row = new ArrayList<>(sourceRow); row.addAll(Collections.nCopies(width - city.width(), Cell.SKY)); rows.add(row); } return new Scene(city.username(), city.totalContributions(), rows); } } The theme defines the background, two building shades, roof, street, and label colors, followed by the five window colors. Those window colors follow GitHub's contribution levels from zero through four. Here, the roof color is also used for the lettering, so the decoration has a consistent orange color across all seven rows. Inside addTo, each marked position is expanded to two cells because the renderer's cells are taller than they are wide. The lettering is centered, a blank row is added beneath it, and the original city rows are copied below. Short calendars receive extra background space on the right to make room for the lettering. The dates, counts, and order of the weekly buildings are preserved. To use the decoration in your fork, import DZoneLandmark from the city package in ContributionCityAction. Replace the existing scene-building and rendering lines with: Scene scene = cityBuilder.build(calendar, configuration.options()); Scene decorated = DZoneLandmark.addTo(scene); String svg = svgRenderer.render(decorated, DZoneLandmark.THEME); This selects the example's palette in Java. The published @v1 action continues to accept github-dark and mono; your fork contains the additional drawing code. For a local preview, add the following after the existing Files.writeString call in PreviewTest.write, with the same import for DZoneLandmark: Scene decorated = DZoneLandmark.addTo(builder.build(calendar, options)); Files.writeString(directory.resolve(name.replace(".svg", "-dzone.svg")), renderer.render(decorated, DZoneLandmark.THEME)); Run ./mvnw verify again and open target/previews/github-dark-dzone.svg. The build also writes the shorter and empty versions with the -dzone.svg suffix, so you can check how the decoration fits several calendars. When you're ready to use your fork on GitHub, update the second checkout in the publishing workflow to your fork's repository and a commit containing your changes. The generation step then runs the customized action from that checkout. Try It With Your Own Contributions Try Quarkus Contribution City with your own GitHub account and add the generated SVG to your profile. Start with the released action, then fork the project and change the character mask to give your city a landmark of its own. You could draw a stepped tower from your hometown or add your team's initials above the street, using the DZone version as a starting point. Share your version in a GitHub issue, or open a pull request if you'd like to contribute a new shape.

By Markus Eisele

Monthly Top Data Experts

expert thumbnail

Brian O'Neill

Technical Writer,
Cloudmersive

A Technical Writer and Media Content creator with a passion for communicating complex ideas.
expert thumbnail

Fawaz Ghali, PhD

Fawaz Ghali is an independent applied AI technologist with over 25 years of experience spanning AI research, higher education, and industry delivery. He works at the point where enthusiasm has faded, tools have been tried, and AI initiatives are expected to deliver real value. Holding a PhD in Computer Science, Fawaz has led and contributed to applied AI, data engineering, and distributed systems across academia and industry. He has published 45+ peer-reviewed papers and delivered over 300 talks worldwide, focusing on what actually works once AI meets real data, real constraints, and real organisational pressure. Fawaz speaks and teaches independently, without vendor affiliation or sales agendas. His sessions are direct, evidence-based, and deliberately free of marketing, product promotion, or speculative claims, offering audiences clarity, critical evaluation, and hard-earned insight grounded in practice rather than hype.

The Latest Data Topics

article thumbnail
Designing a Data Pipeline for Multi-Location Marketing Attribution (Before You Actually Need One)
This article is a practical breakdown of what that looks like and why building it early is cheaper than reconciling bad data later.
November 20, 2026
by James Watson
· 638 Views · 1 Like
article thumbnail
The Alert Is Not the Incident: LLM Triage on a Multi-Engine Data Platform
Incidents cross engine boundaries; alerts do not. Discover how bounded LLM context assembly accelerates incident triage while keeping remediation safely in human hands.
November 19, 2026
by Thirupathi Reddy Anneda
· 763 Views · 1 Like
article thumbnail
Securing AI Agents in Production: A Developer’s Guide To Prompt Injection, RAG Leaks, and Tool Abuse
Learn how to secure AI agents in production against prompt injection, RAG data leaks, and tool abuse with practical controls, access policies, and monitoring.
November 18, 2026
by Paresh Sagar
· 1,115 Views · 1 Like
article thumbnail
Understanding Vector Databases: Concepts, Similarity Search, and Trade-offs for Enterprise Applications
Explore vector databases, similarity search, and how Eclipse JNoSQL brings vector persistence to enterprise Java applications.
November 18, 2026
by Otavio Santana DZone Core CORE
· 918 Views
article thumbnail
Pitching Kotlin: An Engineering Leader's Guide to Legacy Modernization
Most Kotlin pitches stall on developer preference. This reviewer's framework prices the friction, phases the rollout behind gates, and wins approval.
November 17, 2026
by Yuri Geronimus
· 1,068 Views · 1 Like
article thumbnail
Your Agents Think Data Federation Means One Truth. It Means a Collage.
Federation makes data reachable across Snowflake, Databricks, and Iceberg. It doesn't make it trustworthy for an AI agent that acts on it without checking twice.
November 16, 2026
by Sushree Mishra
· 980 Views · 1 Like
article thumbnail
Debugging senro Pipelines: Replay a Run, Shell Into a Live Step, Audit a Cache
Replay a run, open a shell inside a live step, and explain cache misses component by component: the field guide to debugging senro pipelines.
November 16, 2026
by Xavier Portilla Edo DZone Core CORE
· 601 Views
article thumbnail
Designing for Hot Keys: When Distributed Systems Stop Distributing
Learn how to mitigate hot keys in distributed systems using bucketed writes, caching, replication, queues, and admission control.
November 13, 2026
by Jaswanth Mopathi
· 869 Views · 1 Like
article thumbnail
Ingesting Public Data That Fails Silently: Patterns From a TypeScript and Cloudflare Workers Pipeline
Public statistical data rarely throws an error when it goes wrong. Five defenses from a pipeline built on wage, price index and ZIP crosswalk datasets.
November 12, 2026
by horus he
· 2,157 Views · 1 Like
article thumbnail
Persisting Cookies Across JAX-WS Service Calls Using a Custom SOAP Handler
A custom SOAP handler preserves JAX-WS session cookies across calls without JVM-wide state, using ThreadLocal isolation and explicit cleanup to prevent session leaks.
November 12, 2026
by Vishal Rameshchandra Shah
· 1,119 Views
article thumbnail
Prompt Caching for LLMs, Part 3: Model-Side Caching and Production Rollout
Learn how LLM prompt caching reduces inference costs and latency using KV cache reuse, provider-side caching, and production monitoring.
November 12, 2026
by Ram Ghadiyaram DZone Core CORE
· 1,090 Views · 1 Like
article thumbnail
How (and Why) to Build Dynamic Data Pipelines
Discover a sample dynamic data pipeline architecture with configurations. Also learn best practices to keep a dynamic architecture stable over time.
November 11, 2026
by Nidhin Ponon
· 1,000 Views · 1 Like
article thumbnail
Prompt Caching for LLMs, Part 2: Semantic Caching in Production
Semantic LLM prompt caching explained: embeddings, similarity thresholds, safe verification patterns, invalidation, multi-turn, and security, with diagrams.
November 11, 2026
by Ram Ghadiyaram DZone Core CORE
· 1,119 Views
article thumbnail
Kafka vs Flink vs Spark: Do You Really Need Real-Time?
Compare Kafka, Flink, and Spark by business SLAs, data consistency, and latency requirements to choose the right data streaming architecture.
November 10, 2026
by Kai Wähner DZone Core CORE
· 1,212 Views · 2 Likes
article thumbnail
Prompt Caching for LLMs, Part 1: Exact-Match Caching in Production
Learn how exact-match prompt caching with Redis and Memcached reduces LLM costs and latency, and how request coalescing prevents cache stampedes.
November 10, 2026
by Ram Ghadiyaram DZone Core CORE
· 1,004 Views · 1 Like
article thumbnail
Engineering Data Observability: Detecting Schema Drift, Data Drift, and Silent Pipeline Failures
Learn how data observability detects schema drift, data quality issues, anomalies, and pipeline failures through monitoring, lineage, and alerting.
November 9, 2026
by RISHI SHRIVASTAVA
· 947 Views · 1 Like
article thumbnail
Two AI Agents, One Database: Solving Concurrent Updates With Optimistic Locking
Multiple AI agents can update the same record and cause conflicts. Learn how optimistic locking with Python and SQLite prevents stale updates.
November 6, 2026
by Tanushree Das
· 1,864 Views · 2 Likes
article thumbnail
Time to First Token: How Long Does It Take for a Large Model to Start Responding?
Learn what time to first token (TTFT) measures, which factors affect LLM response latency, and how to reduce wait time before output begins.
November 6, 2026
by Jake Tao
· 1,301 Views
article thumbnail
Designing a Polling Pipeline for Rate-Limited APIs Without Losing Data
Learn four common API polling failure modes and how adaptive intervals, watermark overlap, content-based deduplication, and retry backoff prevent data loss.
November 6, 2026
by CARTER WANG
· 1,242 Views · 2 Likes
article thumbnail
Decoupling a Data Pipeline From the Tables It Was Never Supposed to Depend On
Build resilient Spark analytics pipelines with SQL and view-based sources, date-range processing, and source contracts to prevent schema drift.
November 3, 2026
by Rahul Narakula
· 852 Views
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • ...
  • Next
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook
×