Why Was Apache Kafka Created?

Mike's Notes

The backstory.

Resources

References

  • Reference

Repository

  • Home > Ajabbi Research > Library >
  • Home > Handbook > 

Last Updated

19/12/2025

Why Was Apache Kafka Created?

By: Stanislav Kozlovski
Big Data Stream: 23/08/2025

7yr experience with Kafka; committer; writes concisely about kafka and big data engineering.

EDIT: This reached first page on Hacker News and spurred some good discussion. Check it out here:

  • https://news.ycombinator.com/item?id=44988845
  • https://lobste.rs/s/pc87c0/why_was_apache_kafka_created

Intro - the Integration Problem

We talk all the time about what Kafka is, but not so much about why it is the way it is.

What better way than to dive into the original motivation for creating Kafka?

Circa 2012, LinkedIn’s original intention with Kafka was to solve a data integration problem.

LinkedIn used site activity data (e.g. someone liked this, someone posted this) [1] for many things - tracking fraud/abuse, matching jobs to users, training ML models, basic features of the website (e.g who viewed your profile, the newsfeed), warehouse ingestion for offline analysis/reporting and etc.

The big takeaway is that many of these activity data feeds are not simply used for reporting, they’re a dependency to the website’s core functionality.

As such, they require very robust infrastructure.

Their old infrastructure was not robust.

It mainly consisted of two pipelines:

The Batch Pipeline

One was an hourly batch-oriented system designed purely to load data into a data warehouse.

Applications would directly publish XML messages of the events (e.g profile view) to an HTTP server. The system would then write these to aggregate files, copy them to ETL servers, parse & transform the XML and finally load it into the warehouse infrastructure consisting of a relational Oracle database and Hadoop clusters.

The Real-Time Pipeline

They used a separate more real-time pipeline for observability. It contained regular server metrics (CPU, errors, etc.), structured logs and distributed tracing events, all flowing to Zenoss.

It was a cumbersome manual process to add new metrics there. This pipeline’s data was not available anywhere else besides Zenoss, so it couldn’t be freely processed or joined with other data.

💥 The Problems

There were a few commonalities between both of these pipelines:

  1. manual work - both systems required a lot of manual maintenance, both to keep the lights on and add new data to.
  2. large backlogs - both systems had large work backlogs of missing data that needed to be added by the resource-constrained central teams responsible for them.
  3. no integration - both of these systems were effectively point-to-point data pipelines that delivered data to a single destination with no integration between them or other systems.

Along the line, LinkedIn figured out that they gained massive value from the simple act of integration - joining previously-siloed data together. Just getting data into Hadoop would unlock new features for them.

As such, the demand for more pipelines to move data to Hadoop grew. But data coverage wasn’t there - only a very small percentage of data was available in Hadoop.

The current way was unsustainable - the pipeline team would never be able to catch up with their ever-growing backlog as more teams realized the value and demanded more features.

There were too many problems - both individual within the pipeline and fundamental throughout the architecture - that made it impossible to scale:

  • Schema Parsing: there were hundreds of XML schemas. XML did not map to the downstream [2] systems (e.g. Hadoop), so it required custom parsing and mapping.
    • This was time consuming, error prone and computationally expensive - they would often fail and were hard to test with production releases. This then led to delays in adding new types of activity data, which forced them to do hacks like shoe-horning new data into already-existing inappropriate types in order to avoid extra work but ship on time.
  • Brittle: The pipeline(s) were critical, because any problem in it would break the downstream system (i.e website feature). Running fancy algorithms on bad data simply produced more bad data.
    • Reliability had to be prioritized.
  • Schema Evolution: adding/removing fields from the schemas without breaking downstream systems in the pipeline was hard.
    • The app generating the data would own the XML format - testing and being aware of all downstream uses was difficult for them, especially due to the asynchronous nature of the pipeline.
    • There wasn’t good communication between teams either, so sometimes the schema would change unexpectedly. [3]
  • Lag: it was impossible to inspect the activity metrics in real time. They would only be available hours later (via the batch process).
    • This led to a long lag time in understanding and resolving problems with the website.
  • Separation of Data: the fact that operational server metrics can’t be joined with the activity data was problematic - it further prevented them from correlating, detecting and understanding problems (e.g. decrease in page views can’t always be seen in server CPU metrics)
  • No Deep Operational Metrics Analysis: can’t run long-form longitudinal queries on the operational metrics because they’re only present in a real-time system that doesn’t support such queries.
  • Single Destination: the use cases for the activity data were growing by the day. But the clean data was solely present in the warehouse. Even if it had 100% data coverage, it wasn’t enough for the data to just be there. It had to go to other destinations too.

What Did They Need?

Reading these problems, LinkedIn’s requirements are pretty clear.

They needed to have robust pipeline (1/7) infrastructure (i.e a standardized, well-maintained API). This pipeline had to be scalable (2/7).

They needed to handle schemas (3/7) properly - commit to a backwards-compatible contract.

They needed the system to handle high fan-out (4/7) - the activity data, for example, needed to go to a lot of destinations.

They needed it to be real-time (5/7) - measured in seconds, not hours.

They needed plug-and-play integration capabilities (6/7). Ideally new sources/sinks would be very easy to load, without any manual work. For this to work, they needed structured schemas (the 3/7) with clean data (6/7), so no extra processing would be required.

And they needed to switch the ownership (7/7) of some of this work, because the two small teams handling the pipelines would have never caught up on their large backlogs while the rest of the organization kept coming up with new use cases.

Something like this had to happen

PS: While evaluating solutions, they figured out that the system had to support data backlogs - i.e decouple writers from readers (8/8). Some systems they tested (ActiveMQ) would collapse in performance when readers fell behind and a significant data backlog accumulated.

Enter - Kafka 🔥

They created Apache Kafka. This solved for 5/8 of the problems:

  • Robustness (1/7) - being a distributed system with built-in replication, failover and durability guarantees meant single machine hiccups would not disrupt the pipelines
  • Scalability (2/7) - the distributed nature and sharding of topics via partitions made it horizontally scalable on commodity hardware
  • High read fan-out (4/7) - the lock-free design of the Log data structure made high-scale reading trivial
  • Real-time (5/7) - the system was real-time, although funnily initially average latency of their large multi-cluster pipeline was 10 seconds. Nowadays this’d be a lot lower.
  • Decouple writers from readers (8/8)- the fact that the data was buffered to disk by design allowed them to set longer retention and not tie the retention to whether the message was consumed or not. This meant slow readers would never impact the system.

The other three problems were schemas, data integration and ownership.

Let’s dive into them, because they’re pretty interesting.

1. Schemas

They moved from XML to Apache Avro as both the schema and serialization language for all the activity data records, as well as downstream in Hadoop.

This led to significantly less data size - Avro messages were 7x smaller than XML. They additionally compressed them 3x down later when producing to Kafka.

They developed what seems like the precursor to Confluent’s Schema Registry: a service to serve as the source of truth for the schema in a Kafka topic, as well as maintain a history of all schema versions ever associated with the topic.

Kafka messages carried an id to refer to the exact schema version it was written with. This versioning made it impossible to break deserialization of messages, because you could always know the right schema to read a message with. [4]

This was a much needed improvement, but it wasn’t everything they needed.

While messages were individually understandable, Hadoop applications could still be broken by toying with the schema - e.g. removing a field in the record they needed to use. They generally expected a single schema to describe a data set. [5]

To solve this backwards compatibility issue, LinkedIn developed a compatibility model to programmatically check schema changes for backwards compatibility against existing production schemas. The model only allowed changes that maintained compatibility with historical data - something that sounds just like schema registry’s `BACKWARD` compatibility level. [6]

2. Plug & Play Integration

To make new data very easy to integrate without any extra manual work, you need to settle on a single schema between the upstream and downstream system.

Having even slight differences means you’ll always have to translate them between systems - i.e., an extra JIRA ticket for somebody to manually write, test & deploy code to transform the data into whatever the downstream system’s requirements.

But if the schema is the same, then that work doesn’t exist.

Ideally, you could then fully automate data offload to sinks because there’s no extra work to do besides writing to the particular sink system’s API.

Another big problem with the different schema approach was the time at which problems would surface. Hadoop used a Schema on Read model, where data would be stored in files, unstructured [7], and the structure would only be defined within each script that reads the files. This meant that things would break much later, at query time, not at the time of ingestion.

Traditionally, at the time, the data warehouse was the only location with a clean version of the data. The dirty, unstructured data would land in Hadoop, and then get cleansed/curated through various scripts (if they didn’t break).

Access to such clean & complete data was of utmost importance to any data-centric company, so having it locked up in the warehouse didn’t scale to meet the organization’s needs. Not to mention it only arrived in the warehouse after hours of delay - very problematic for anybody who wants to access it sooner.

The solution was very straightforward - “simply” move the clean data upstream to a real-time source. Clean it as it lands into Kafka - i.e adopt a Schema on Write model.

This not only allows plug and play integration with the warehouse (e.g creating a new table from a new topic is a piece of cake), but also makes it available for other types of consumers - be it real-time or batch.

Similarly, schema changes like adding a new field could be automatically handled.

That’s exactly what LinkedIn did - define a single uniform schema with the canonical, cleansed format of the particular message. But this required organizational change to execute:

3. Ownership and Governance

Previously, it was the pipeline team’s responsibility to match the schema to the downstream system. LinkedIn needed to move this ownership away from them if they wanted to ever get to 100% data coverage. This was the final step in solving the problem.

The best team to drive this? The team(s) that created the data, of course! They best know what the cleanest representation of the data should be.

Agreeing on a uniform schema amongst downstream systems was still a joint effort though.

LinkedIn established a mandatory code review process between all involved teams - whenever schema code was changed, there would need to be LGTMs from stakeholders before the next production release [8].

A side-effect of this was that it helped document the thousands of fields in their hundreds of schemas.

Summary

This was a very long-winded way of saying that:

  • data needs to be integrated between many systems
  • schemas play a very crucial role in this, make sure you define them well and establish good ownership
  • Kafka, with schemas, was literally invented to solve this problem at scale.

In the end, this proved very effective for LinkedIn. A single engineer was able to implement and maintain the process that does data loads for all topics with no incremental work or co-ordination needed as teams add new topics or change schemas.

Source: this 2012 paper and this blog.

Schema Driven Development Anyone?

One thing that surprised me while reading this paper was the emphasis on schemas.

I’ve been vocal before that I believe the lack of first-class schema support was Kafka’s biggest mistake.

The paper’s solution shares a lot similarities to Buf’s schema-driven development vision. Buf has been talking about universal schemas for the longest time, and built a diskless Kafka system that prioritizes schemas as a first-class citizen. I haven’t seen any other Kafka provider focus on schemas that much.

What surprised me precisely in this paper is that it, 13+ years ago, described a problem for which LinkedIn literally invented Kafka and auxiliary systems to solve, then took their time to write out the universal schema solution really well:

why am I hearing about this schema-centric vision a full decade later from a Protobuf/Kafka startup?

I’ve posted before on how Kafka lacks first-class schemas and how Buf seems to be the only one in the space beating the drum on their importance:

Every valuable use-case requires schemas. You can’t use Kafka Connect to integrate data between upstream system A, Kafka and downstream system B without the existence of schemas — because chances are both systems A & B require some structure. Ditto for stream processing - you can’t do joins and aggregations on 1s and 0s.

Every message has a schema - it’s either explicit and defined in a single place, or implicit and scattered throughout your application’s code.

Fragmentation - absent of an “official” schema registry that ships with Kafka, we have dozens of options to choose from - Confluent’s Schema Registry, Karaspace, AWS Glue, Apicurio, Buf’s Schema Registry, etc.

No Server-Side Validation - the Producer client is the only one who validates the schema prior to writing. There’s no way to defend against buggy (or malicious) clients, hence no way to enforce a uniform schema under all circumstances.

Again, I really commend Buf’s server-side validation. When you embrace the fundamental idea that messages must have schemas and enforce it on the server, a lot of things open up:

  • Native Iceberg integration - writing into an open table format becomes a trivial job of translating one schema language (e.g Avro or Protobuf) to another’s (Parquet’s) [9]
  • Semantic validation - ensuring message fields match a specific format (e.g email validation, age validation)
  • Filtering fields based on policies (RBAC) - certain sensitive fields ought to not be readable by certain groups.
  • Debugging - if a bad message somehow makes it in there (e.g configuration wasn’t right), the server can immediately pin-point it.
  • Filtering bad messages directly on the server - avoiding the need to have custom poison pill handling code (e.g send into a DLQ topic) in each consumer application.

Schemaless Kafka

Lack of schemas continues to be my biggest gripe with Kafka.

The fact that LinkedIn treated schemas as first-class citizens all the way back in 2012 really has left me scratching my head…

They knew this was a major problem, yet never baked it into the product. Neither did Confluent after branching out of LinkedIn.

I’m uncertain how much of the schema decision was a business decision versus a technical one.

Back in the days, Confluent made their money off of their on-premise Confluent Platform package which priced things per node, hence a financial incentive existed to deploy more nodes (i.e. a schema registry cluster with three nodes for HA versus bundling it in the broker).

Perhaps there was investor pressure to preserve pricing optionality? Any business has to make money, and you can’t give away your most valuable features. It’s pretty common in the open-core business model to gate enterprise features behind paywalls.

Schema Registry is source-available though. In fact, it’s pretty much free to use unless you plan on selling it as a SaaS. But basic features like ACLs require a paid license. Something open-source Schema Registries like Karaspace offer for free. And hence my point on fragmentation in the space. It’s got to the point where we have to have proxies that enforce schemas [10].

At the same time, there are some technical reasons why no-schema can be preferred:

  • Enforcement on the client scales easier, as no bottleneck exists in the broker.
  • Any state management on the broker could require extra resource usage (parsing schemas [11], validating) and worse off — it could block the stream as it’d require additional locking. That’s contrary to the value prop of Kafka for slinging lots of bytes fast.

I believe it didn’t have to be an either-or decision today. Kafka could have shipped with first-class schema support built into topics - just an optional toggle.

And I don’t think performance would be hurt to the point of being unusable. Few people push Kafka to its true limits anyway - it’s frequently bottlenecked on network and storage. Not to mention that serialization overhead on CPUs has gone a long way since 2011 - the Java libraries improved, Java’s GC improved, JVM improved and CPU perf skyrocketed.

In hindsight, it’s clear that the schemaless wave (“it’s just byte arrays!”) was a fad that went away. We see which model won out in the SQL vs NoSQL wars - Postgres is not eating the world today by accident. [12]

I keep asking - why doesn’t Apache Kafka have schemas?

  1. My understanding is this was all sort of user activity on the website. Sending a message to somebody, applying for a job, liking a post, reposting something, commenting under something, opening a profile. Basic features off the website work on this principle - e.g you get a notification of who “viewed your profile”. Less basic things too - the newsfeed adjusts to what you’ve been consuming; jobs get recommended to you based on what you’ve been applying to/viewing, etc.
  2. I used to always confuse upstream and downstream together for whatever reason, so let me clarify: data has a source (where it comes from) and a destination (where it goes to). In this article, I use the following words interchange-ably: {Source, Upstream, Producer} and {Destination, Downstream, Sink, Consumer}
  3. Probably the #1 problem in data engineering - schemas aren’t respected! They’re the contract between your systems, so naturally any unexpected changes there will break the pipeline. We, as an industry, need to treat this contract as something explicit (not implicit) and develop more tooling/automation around it.
  4. Said more explicitly, if my schema database naively stores only one schema (e.g. a key-value pair of topic name to latest schema), I wouldn’t be able to deserialize old messages because I don’t know their exact schema! This is an important problem to solve for, because even if you store very little data (e.g 24hrs’ worth), there will always be a t=1h time point where you have 1 hours’ worth of the latest schema and 23 hours’ worth of the old schema. No consumer would be able to read everything within that window until the old data gets deleted. Hence - versioning of schemas and associating each message to a version to the rescue.
  5. Hadoop tools like Hive and Pig would work with many, many files, but expected one fixed schema for all of them. If you change the schema, it’s expected to rewrite all your historical data with the new schema. In LinkedIn’s case, this was hundreds of TBs worth of data.
  6. Nowadays these tools are pretty standard. `buf breaking` is another standard CLI tool that comes to mind with relation to checking compatibility for protobuf
  7. Unstructured data — data that does not conform to a pre-defined model or schema. This type of thing was very popular during the NoSQL wave.
  8. This is what the buzzword Schema Governance means. A set of rules/processes/tools to help you control how schemas are handled in data pipelines.
  9. Funnily this is what initially got me thinking into why Kafka doesn’t support schemas as first-class citizens. I asked about it on Reddit here - https://www.reddit.com/r/apachekafka/comments/1h80if5/why_doesnt_kafka_have_firstclass_schema_support/.
  10. I think Kroxylicious is super cool. But in an ideal world, we wouldn’t need a third-party proxy to enforce such a basic feature.
  11. I don’t have actual data as to how much resource usage parsing would take. I tried figuring out how Bufstream does it (since they’re the only solution with server-side validation i.e parsing) and they seemed to have written their own protobuf parser that’s allegedly 10x faster. Maybe something like that is necessary to keep performance under check. Even if so - that parser is Apache-licensed so nothing would stop Kafka from adopting it.
  12. Well, it didn’t literally go away - it just faded in significance. Postgres supports “NoSQL” like JSON arrays too now, and the general flexibility is welcomed. But it’s clear it’s not the default.

A Practical Guide to Monte Carlo Simulation

Mike's Notes

A great introduction to using Microsoft Excel for Monte Carlo simulation by Jon Wittwer. The 4-part series of articles is combined into a single article here. Vetex42 is an excellent free resource for learning to use Excel.

I recently discovered that Pipi has used Markov chain Monte Carlo (MCMC) since version 6, but the method was unnamed, as is much of Pipi's internal functioning (A disadvantage of working visually 😇 and finding ideas from anywhere to solve a problem)

Resources

References

  • Reference

Repository

  • Home > Ajabbi Research > Library >
  • Home > Handbook > 

Last Updated

15/02/2026

A Practical Guide to Monte Carlo Simulation

By: Jon Wittwer
Vertex42: 1/06/2004

Jon Wittwer started Vertex42 in 2003 while working on a PhD in mechanical engineering. After finishing his degree, he worked for Sandia National Laboratories where he kept Vertex42.com running on the side. In 2008, he left the labs to work on Vertex42 full time. In addition to his expertise with Excel, Dr. Wittwer is respected in multiple fields for his development of financial tools such as the Debt Reduction Calculator, project management tools like the Gantt Chart Template, statistical tools such as the Monte Carlo Simulator, and a large collection of business productivity and time management tools.

A Monte Carlo method is a technique that involves using random numbers and probability to solve problems. The term Monte Carlo Method was coined by S. Ulam and Nicholas Metropolis in reference to games of chance, a popular attraction in Monte Carlo, Monaco (Hoffman, 1998; Metropolis and Ulam, 1949).

Computer simulation has to do with using computer models to imitate real life or make predictions. When you create a model with a spreadsheet like Excel, you have a certain number of input parameters and a few equations that use those inputs to give you a set of outputs (or response variables).

This type of model is usually deterministic, meaning that you get the same results no matter how many times you re-calculate.

Example 1: A Deterministic Model for Compound Interest

Deterministic Model

Figure 1: A parametric deterministic model maps a set of input variables to a set of output variables.

Monte Carlo simulation is a method for iteratively evaluating a deterministic model using sets of random numbers as inputs. This method is often used when the model is complex, nonlinear, or involves more than just a couple uncertain parameters. A simulation can typically involve over 10,000 evaluations of the model, a task which in the past was only practical using super computers.

By using random inputs, you are essentially turning the deterministic model into a stochastic model. Example 2 demonstrates this concept with a very simple problem.

Example 2: A Stochastic Model for a Hinge Assembly

In Example 2, we used simple uniform random numbers as the inputs to the model. However, a uniform distribution is not the only way to represent uncertainty. Before describing the steps of the general MC simulation in detail, a little word about uncertainty propagation:

The Monte Carlo method is just one of many methods for analyzing uncertainty propagation, where the goal is to determine how random variation, lack of knowledge, or error affects the sensitivity, performance, or reliability of the system that is being modeled.

Monte Carlo simulation is categorized as a sampling method because the inputs are randomly generated from probability distributions to simulate the process of sampling from an actual population. So, we try to choose a distribution for the inputs that most closely matches data we already have, or best represents our current state of knowledge. The data generated from the simulation can be represented as probability distributions (or histograms) or converted to error bars, reliability predictions, tolerance zones, and confidence intervals. (See Figure 2).

Uncertainty Propagation

Monte Carlo Analysis

Figure 2: Schematic showing the principal of stochastic uncertainty propagation. (The basic principle behind Monte Carlo simulation.)

If you have made it this far, congratulations! Now for the fun part! The steps in Monte Carlo simulation corresponding to the uncertainty propagation shown in Figure 2 are fairly simple, and can be easily implemented in Excel for simple models. All we need to do is follow the five simple steps listed below:

  • Step 1: Create a parametric model, y = f(x1, x2, ..., xq).
  • Step 2: Generate a set of random inputs, xi1, xi2, ..., xiq.
  • Step 3: Evaluate the model and store the results as yi.
  • Step 4: Repeat steps 2 and 3 for i = 1 to n.
  • Step 5: Analyze the results using histograms, summary statistics, confidence intervals, etc.

On to an example problem ...

REFERENCES:

  • Hoffman, P., 1998, The Man Who Loved Only Numbers: The Story of Paul Erdos and the Search for Mathematical Truth. New York: Hyperion, pp. 238-239.
  • Metropolis, N. and Ulam, S., 1949, "The Monte Carlo Method." J. Amer. Stat. Assoc. 44, 335-341.
  • Eric W. Weisstein. "Monte Carlo Method." From MathWorld--A Wolfram Web Resource.
  • Paul Coddington. "Monte Carlo Simulation for Statistical Physics." Northeast Parallel Architectures Center at Syracuse University. http://www.npac.syr.edu/users/paulc/lectures/montecarlo/p_montecarlo.html
  • Decisioneering.com. "What is Monte Carlo Simulation?"" Part of: Risk Analysis Overview - http://www.decisioneering.com/risk-analysis-start.html

Our example of Monte Carlo simulation in Excel will be a simplified sales forecast model. Each step of the analysis will be described in detail.

The Scenario: Company XYZ wants to know how profitable it will be to market their new gadget, realizing there are many uncertainties associated with market size, expenses, and revenue.

The Method: Use a Monte Carlo Simulation to estimate profit and evaluate risk.

You can download the example spreadsheet by following the instructions below. You will probably want to refer to the spreadsheet occasionally as we proceed with this example.

Download the Sales Forecast Example

Step 1: Creating the Model

We are going to use a top-down approach to create the sales forecast model, starting with:

Profit = Income - Expenses

Both income and expenses are uncertain parameters, but we aren't going to stop here, because one of the purposes of developing a model is to try to break the problem down into more fundamental quantities. Ideally, we want all the inputs to be independent. Does income depend on expenses? If so, our model needs to take this into account somehow.

We'll say that Income comes solely from the number of sales (S) multiplied by the profit per sale (P) resulting from an individual purchase of a gadget, so Income = S*P. The profit per sale takes into account the sale price, the initial cost to manufacturer or purchase the product wholesale, and other transaction fees (credit cards, shipping, etc.). For our purposes, we'll say the P may fluctuate between $47 and $53.

We could just leave the number of sales as one of the primary variables, but for this example, Company XYZ generates sales through purchasing leads. The number of sales per month is the number of leads per month (L) multiplied by the conversion rate (R) (the percentage of leads that result in sales). So our final equation for Income is:

Income = L*R*P

We'll consider the Expenses to be a combination of fixed overhead (H) plus the total cost of the leads. For this model, the cost of a single lead (C) varies between $0.20 and $0.80. Based upon some market research, Company XYZ expects the number of leads per month (L) to vary between 1200 and 1800. Our final model for Company XYZ's sales forecast is:

Profit = L*R*P - (H + L*C)
Y = Profits
X1 = L
X2 = C
X3 = R
X4 = P

Notice that H is also part of the equation, but we are going to treat it as a constant in this example. The inputs to the Monte Carlo simulation are just the uncertain parameters (Xi).

This is not a comprehensive treatment of modeling methods, but I used this example to demonstrate an important concept in uncertainty propagation, namely correlation. After breaking Income and Expenses down into more fundamental and measurable quantities, we found that the number of leads (L) affected both income and expenses. Therefore, income and expenses are not independent. We could probably break the problem down even further, but we won't in this example. We'll assume that L, R, P, H, and C are all independent.

Note: In my opinion, it is easier to decompose a model into independent variables (when possible) than to try to mess with correlation between random inputs.

Step 2: Generating Random Inputs

The key to Monte Carlo simulation is generating the set of random inputs. As with any modeling and prediction method, the "garbage in equals garbage out" principle applies. For now, I am going to avoid the questions "How do I know what distribution to use for my inputs?" and "How do I make sure I am using a good random number generator?" and get right to the details of how to implement the method in Excel.

For this example, we're going to use a Uniform Distribution to represent the four uncertain parameters. The inputs are summarized in the table shown below. (If you haven't already, Download the example spreadsheet).

Sales Forecast Input Table

Figure 1: Screen capture from the example sales forecast spreadsheet.

The table above uses "Min" and "Max" to indicate the uncertainty in L, C, R, and P. To generate a random number between "Min" and "Max", we use the following formula in Excel (Replacing "min" and "max" with cell references):

= min + RAND()*(max-min)

You can also use the Random Number Generation tool in Excel's Analysis ToolPak Add-In to kick out a bunch of static random numbers for a few distributions. However, in this example we are going to make use of Excel's RAND() formula so that every time the worksheet recalculates, a new random number is generated.

Let's say we want to run n=5000 evaluations of our model. This is a fairly low number when it comes to Monte Carlo simulation, and you will see why once we begin to analyze the results.

A very convenient way to organize the data in Excel is to make a column for each variable as shown in the screen capture below.

Random Inputs in Column Format

Figure 2: Screen capture from the example sales forecast spreadsheet.

Cell A2 contains the formula:

=Model!$F$14+RAND()*(Model!$G$14-Model!$F$14)

Note that the reference Model!$F$14 refers to the corresponding Min value for the variable L on the Model worksheet, as shown in Figure 1. (Hopefully you have downloaded the example spreadsheet and are following along.)

To generate 5000 random numbers for L, you simply copy the formula down 5000 rows. You repeat the process for the other variables (except for H, which is constant).

Step 3: Evaluating the Model

Our model is very simple, so to evaluate the output of our model (the Profit) for each run of the simulation, we just put the equation in another column next to the inputs, as shown in Figure 2.

Cell G2 contains the formula:

=A2*C2*D2-(E2+A2*B2)

Step 4: Running the Simulation

To iteratively evaluate our model, we don't need to write a fancy macro for this example. We simply copy the formula for profit down 5000 rows, making sure that we use relative references in the formula (no $ signs). Each row represents a single evaluation of the model, with columns A-E as inputs and the Profit as the output.

Re-run the Simulation: F9

Although we still need to analyze the data, we have essentially completed a Monte Carlo simulation. We have used the volatile RAND() function. So, to re-run the entire simulation all we have to do is recalculate the worksheet (F9 is the shortcut).

This may seem like a strange way to implement Monte Carlo simulation, but think about what is going on behind the scenes every time the Worksheet recalculates: (1) 5000 sets of random inputs are generated (2) The model is evaluated for all 5000 sets. Excel is handling all of the iteration.

If your model is not simple enough to include in a single formula, you can create your own custom Excel function (see my article on user-defined functions), or you can create a macro to iteratively evaluate your model and dump the data into a worksheet in a similar format to this example (Update 9/8/2014: See my new Monte Carlo Simulation template).

In practice, it is usually more convenient to buy an add-on for Excel than to do a Monte Carlo analysis from scratch every time. But not everyone has the money to spend, and hopefully the skills you will learn from this example will aid in future data analysis and modeling.

A Few Other Distributions

My new Monte Carlo Simulation template includes a worksheet that calculates inputs sampled from a variety of distributions. Some of the formulas are listed below.

Normal (Gaussian) distribution

To generate a random number from a Normal distribution you would use the following formula in Excel:

=NORMINV(rand(),mean,standard_dev)
Ex: =NORMINV(RAND(),$D$4,$D$5)
Excel 2010+: =NORM.INV(RAND(),$D$4,$D$5)

Lognormal distribution

To generate a random number from a Lognormal distribution with median = exp(meanlog), and shape = sdlog, you would use the following formula in Excel:

=LOGINV(RAND(),meanlog,sdlog)
Ex: =LOGINV(RAND(),$D$6,$D$5)
Excel 2010+: =LOGNORM.INV(RAND(),$D$4,$D$5)

Weibull distribution

There isn't an inverse Weibull function in Excel, but the formula is quite simple, so to generate a random number from a (2-parameter) Weibull distribution with scale = c, and shape = m, you would use the following formula in Excel:

=c*(-LN(1-RAND()))^(1/m)
Ex: $C$5*(-LN(1-RAND()))^(1/$C$6)

Beta distribution

This distribution can be used for variables with finite bounds (A,B). It uses two shape parameters, alpha and beta. When alpha=beta=1, you get a Uniform distribution. When alpha=beta=2, you get a dome-shaped distribution which is often used in place of the Triangular distribution. When alpha=beta=5 (or higher), you get a bell-shaped distribution. When alpha<>beta (not equal), you get a variety of skewed shapes.

Excel 2010+: =BETA.INV(RAND(),alpha,beta,A,B)

MORE Distribution Functions: Dr. Roger Myerson provides a free downloadable Excel add-in, Simtools.xla, that includes many other distribution functions for generating random numbers in Excel.

Creating a histogram is an essential part of doing a statistical analysis because it provides a visual representation of data.

In Part 3 of this Monte Carlo Simulation example, we iteratively ran a stochastic sales forecast model to end up with 5000 possible values (observations) for our single response variable, profit. If you have not already, download the Sales Forecast Example Spreadsheet.

The last step is to analyze the results to figure out how much the profit might be expected to vary based on our uncertainty in the values used as inputs for our model. We will start off by creating a histogram in Excel. The image below shows the end result. Keep reading below to learn how to make the histogram.

Histogram With Excel

Figure 1: A Histogram in Excel for the response variable Profit, created using a Bar Chart.

(From a Monte Carlo simulation using n = 5000 points and 40 bins).

We can glean a lot of information from this histogram:

  • It looks like profit will be positive, most of the time.
  • The uncertainty is quite large, varying between -1000 to 3400.
  • The distribution does not look like a perfect Normal distribution.
  • There doesn't appear to be outliers, truncation, multiple modes, etc.

The histogram tells a good story, but in many cases, we want to estimate the probability of being below or above some value, or between a set of specification limits. To skip ahead to the next step in our analysis, move on to Summary Statistics, or continue reading below to learn how to create the histogram in Excel.

Creating a Histogram in Excel

Update 7/2/15: A Histogram chart is one of the new built-in chart types in Excel 2016, finally! (Read about it).

Method 1: Using the Histogram Tool in the Analysis Tool-Pak.

This is probably the easiest method, but you have to re-run the tool each to you do a new simulation. AND, you still need to create an array of bins (which will be discussed below).

Method 2: Using the FREQUENCY function in Excel.

This is the method used in the spreadsheet for the sales forecast example. One of the reasons I like this method is that you can make the histogram dynamic, meaning that every time you re-run the MC simulation, the chart will automatically update. This is how you do it:

Step 1: Create an array of bins

The figure below shows how to easily create a dynamic array of bins. This is a basic technique for creating an array of N evenly spaced numbers.

To create the dynamic array, enter the following formulas:

  B6 = $B$2
  B7 = B6+($B$3-$B$2)/5

Then, copy cell B7 down to B11

Array of Bins in Excel

Figure 2: A dynamic array of 5 bins.

After you create the array of bins, you can go ahead and use the Histogram tool, or you can proceed with the next step.

Step 2: Use Excel's FREQUENCY formula

The next figure is a screen shot from the example Monte Carlo simulation. I'm not going to explain the FREQUENCY function in detail since you can look it up in the Excel's help file. But, one thing to remember is that it is an array function, and after you enter the formula, you will need to press Ctrl+Shift+Enter. Note that the simulation results (Profit) are in column G and there are 5000 data points ( Points: J5=COUNT(G:G) ).

The Formula for the Count column:

  FREQUENCY(data_array,bins_array)

  a) Select cells J8:J48
  b) Enter the array formula: =FREQUENCY(G:G,I8:I48)
  c) Press Ctrl+Shift+Enter

Layout for Creating a Scaled Histogram

Figure 3: Layout in Excel for Creating a Dynamic Scaled Histogram.

Creating a Scaled Histogram

If you want to compare your histogram with a probability distribution, you will need to scale the histogram so that the area under the curve is equal to 1 (one of the properties of probability distributions). Histograms normally include the count of the data points that fall into each bin on the y-axis, but after scaling, the y-axis will be the frequency (a not-so-easy-to-interpret number that in all practicality you can just not worry about). The frequency doesn't represent probability!

To scale the histogram, use the following method:

  Scaled = (Count/Points) / (BinSize)

  a) K8 = (J8/$J$5)/($I$9-$I$8)
  b) Copy cell K8 down to K48
  c) Press F9 to force a recalculation (may take a while)

Step 3: Create the Histogram Chart

Bar Chart, Line Chart, or Area Chart:

To create the histogram, just create a bar chart using the Bins column for the Labels and the Count or Scaled column as the Values. Tip: To reduce the spacing between the bars, right-click on the bars and select "Format Data Series...". Then go to the Options tab and reduce the Gap. Figure 1 above was created this way.

A More Flexible Histogram Chart

One of the problems with using bar charts and area charts is that the numbers on the x-axis are just labels. This can make it very difficult to overlay data that uses a different number of points or to show the proper scale when bins are not all the same size. However, you CAN use a scatter plot to create a histogram. After creating a line using the Bins column for the X Values and Count or Scaled column for the Y Values, add Y Error Bars to the line that extend down to the x-axis (by setting the Percentage to 100%). You can right-click on these error bars to change the line widths, color, etc.

Histogram Via Error Bars

Figure 4: Example Histogram Created Using a Scatter Plot and Error Bars.

REFERENCES:

CITE THIS PAGE AS:

Wittwer, J.W., "Creating a Histogram In Excel" From Vertex42.com, June 1, 2004

Workspaces include customer support

Mike's Notes

This is where I will keep detailed working notes on creating Workspaces > Customer Support. Eventually, these will become permanent, better-written documentation stored elsewhere. Hopefully, someone will come up with a better name than this working title.

This replaces the coverage in Industry Workspace dated 13/10/2025.

Testing

The current online mockup is version 2 and will be updated frequently. If you are helping with testing, please remember to delete your browser cache so you see the daily changes. Eventually, a live demo version will be available for field trials.

Learning

(To come)

Why

Ajabbi will adopt the Atlassian approach. Provide enough learning material

Resources

References

  • Reference

Repository

  • Home > Ajabbi Research > Library >
  • Home > Handbook > 

Last Updated

18/12/2025

Workspaces include customer support

By: Mike Peters
On a Sandy Beach: 17/12/2025

Mike is the inventor and architect of Pipi and the founder of Ajabbi.

Open-source

This open-source SaaS cloud system will be shared on GitHub and GitLab.

Dedication

This workspace is dedicated to the life and work of .

Change Log

Ver 2 combines support with learning.

Existing products

(to come)

Features

This is a basic comparison of features in support software.

[TABLE]

Data Model

(to come)

Database Entities

  • Facility
  • Party
  • etc

Standards

The workspace must comply with all applicable international standards.

  • (To come)

Support

There will be extensive free documentation sets tailored for different users.

Every user account includes access to customer support when using these modules (which can be enabled or disabled in account settings). 

Modules with descriptions

  • Customer
    Customer support dashboard.
  • Bookmarks
    Bookmarked web pages.
  • Support
    The ways of getting customer support.
    • Contact
      A contact web form.
    • Forum
      Post questions and answers to a forum using a web form.
    • Live Chat
      Live chat with a human.
    • Office Hours
      Book a time slot using a calendar for a 1-on-1.
    • Requests
      Add a feature request using a web form.
    • Tickets
      Create a support ticket about your account or workspace.
  • (To come)
    • Feature Vote
      Vote to prioritise features.
    • Feedback
      A simple feedback web form.
    • Surveys
      Complete a web survey about the workspace you are using.
  • Learning
    Training material available for self-directed learning
    • Explanation
      "Background information and conceptual discussions that provide context and illuminate topics more broadly." - Tom Johnson.
    • How to Guide
      "Practical guides focused on providing the steps to solve real-world problems." - Tom Johnson.
    • Reference
      "Technical descriptions and factual information about the system, APIs, parameters, etc." - Tom Johnson.
    • Tutorial
      "Lessons that provide a learning experience, taking users step-by-step through hands-on exercises to build skills and familiarity." - Tom Johnson.

Workspace navigation menu

This default outline needs significant work. The outline can be easily customised by future users via drag-and-drop and tick boxes to toggle features on and off.

  • Generic User Account
    • Applications
    • Customer (v2)
      • Bookmarks
        • (To come)
      • Support
        • Contact
        • Forum
        • Live Chat
        • Office Hours
        • Requests
        • Tickets
      • (To come)
        • Feature Vote
        • Feedback
        • Surveys
      • Learning
        • Explanation
        • How to Guide
        • Reference
        • Tutorial
    • Settings

Mathematicians Crack a Fractal Conjecture on Chaos

Mike's Notes

Very useful.

Here is a summary generated by Google.

"Harmonic analysis of Gaussian Multiplicative Chaos (GMC) on the circle involves studying its Fourier coefficients, revealing key properties like its near-certainty of being a Rajchman measure, meaning coefficients vanish at high frequencies, and connecting to random matrix theory (Circular-β-ensembles) and spectral theory, with recent work proving exact Fourier dimensions and describing convergence laws for scaled coefficients. This field investigates how random multiplicative structures on the circle behave under Fourier transformation, revealing spectral properties and connections to number theory and random matrix models, with significant recent advances in understanding critical and subcritical phases.

Key Concepts & Findings:

    • Rajchman Property: GMC on the circle almost surely becomes a Rajchman measure, meaning its Fourier coefficients 𝜇̂(𝑛) tend to zero as the frequency 𝑛 → ∞.
    • Fourier Dimensions: Researchers establish precise Fourier dimensions (how fast coefficients decay) for various GMC models, confirming conjectures and linking to spectral properties.
    • Connection to Random Matrices: There's a deep link between GMC on the circle and the Circular-β-Ensemble (CBE) from random matrix theory, with holomorphic analogues (HMC) also studied.
    • Spectral Approach: Using random orthogonal polynomials and spectral methods allows for efficient analysis of GMC properties, including its support's Hausdorff dimension.
    • Convergence Laws: Normalized Fourier coefficients are shown to converge in distribution to specific random variables (e.g., complex normal) in certain phases (L1-phase).
    • Critical & Subcritical Phases: Significant focus is on subcritical 𝛾 = √2 and critical 𝛾 = √2 regimes, with new methods improving understanding, especially for the unit interval and circle.

Recent Research Directions:

    • Proving exact Fourier decay rates and dimensions for various GMC models (e.g., critical GMC).
    • Developing unified approaches for classical multiplicative chaos measures.
    • Studying the holomorphic analogue (HMC) and its convergence properties.
    • Exploring connections to number theory and large random matrices.

In essence, researchers use harmonic analysis tools (like Fourier coefficients) to understand the random, fractal-like structures of GMC on the circle, revealing underlying deterministic patterns and links to other mathematical areas."

- Gemini 3

Resources

References

  • Reference

Repository

  • Home > Ajabbi Research > Library >
  • Home > Handbook > 

Last Updated

16/12/2025

Mathematicians Crack a Fractal Conjecture on Chaos

By: Lyndie Chiou
Scientific American: 9/12/2025

Lyndie Chiou is a scientist, a science writer and founder of ZeroDivZero, a science conference website. Her writing has also appeared in Sky & Telescope. Follow her on X @lyndie_chiou.

A type of chaos found in everything from prime numbers to turbulence can unify a pair of unrelated ideas, revealing a mysterious, deep connection that disappears without randomness.

The world may seem orderly, but randomness and chaos shape everything in the universe, from enormous galaxies all the way down to subatomic particles. Take a chilly window sheeting over with ice: even one oddly shaped snowflake can exert an influence on the final frosty pattern.

Understanding how random fluctuations can ripple out to produce global effects is what French mathematician Vincent Vargas of the University of Geneva in Switzerland set out to do more than 10 years ago. His earliest ideas for simple geometries appeared in a decade-old paper, but it wasn’t until 2023, while he was working with Christophe Garban of the University of Lyon in France, that the concept finally crystallized into what is now known as the Garban-Vargas conjecture. Now mathematicians have proved the conjecture using an insightful technique that should open the door for understanding much more complex systems.

The conjecture involves the behavior of a form of randomness found in a huge range of fields, from quantum chaos to Brownian motion to air turbulence. Mathematicians use a mathematical “measuring tape” called Gaussian multiplicative chaos, or GMC, to pick out subtle patterns hidden inside an otherwise impenetrable sea of randomness. GMC has even been used to find patterns in the prime numbers. The topic is one of the most important and fundamental ideas in probability theory today.

French mathematician Jean-Pierre Kahane is credited with first developing GMC in 1985, although his pioneering work was quickly forgotten. “I was one of the people who revived his work,” Vargas says. “I met him many times, and he said he was amazed how important the topic [had] become. Everywhere on the planet, people are working on something related to Gaussian chaos.”

Vargas first encountered the measure while studying turbulence and finance. He then came across it again in a project on conformal field theory, which is used to study patterns that remain constant as you zoom in or out. Lately he has focused on investigating its fundamental mathematical nature.

To understand GMC, imagine a turbulent fluid full of swirling eddies at many different scales. Enormous eddies randomly break apart into smaller ones, which themselves break into even smaller eddies, in a vast, nested hierarchy of randomness. GMC serves as a mathematical model that measures this kind of multiscale randomness—it captures random fluctuations that persist across every scale of the observation. Because of this, it is often referred to as a fractal measure.

Mathematicians have uncovered surprising behaviors in the types of randomness governed by GMC. For instance, events at the smallest scales can govern the entire system; the powerful tendrils of fractal structure shape chaos at every level. As a result, these systems cannot be understood by looking at averages. Instead the rules of GMC produce a universal picture that applies to every scale.

But this fascinating picture only holds up to a critical threshold. If the underlying randomness becomes too strong, the GMC measure collapses. Or, in the language of eddies, once enough randomness infuses the swirls, they become unstable, losing all their hidden order. Like ice transitioning to a liquid, this breakdown marks an important phase transition for chaos.

In 2023 Garban and Vargas introduced a new lens for studying GMC chaos. It came from a field of mathematics called harmonic analysis. Instead of looking at eddies directly, they examined the frequencies of patterns hidden in the eddies, much like analyzing a complex sound by breaking it into pure tones.

Then an idea came to them. If they could match two completely different physical descriptions—complexity and harmonics—they might learn something new. Mathematicians refer to this idea of matching unrelated physical descriptions as matching “dimensions.”

As an example, consider snowflakes falling to the ground. As the snow gently lands, two possible dimensions might be how many patterns appear in the distribution of the snowflakes and how many clumpy piles form across different scales. But is there a formula that can relate the two dimensions of patterns (harmonics) and clumpiness (correlations)?

“The key word is dimension,” Vargas says. “That’s the name of the game. You have lots of natural dimensions, but when do they coincide?”

After studying systems governed by GMC on a circle, the duo conjectured an extraordinarily elegant equation that matched a GMC system’s correlation dimension to its harmonic dimension.

Unfortunately they couldn’t prove their formula, even for a simple geometry. In 2023 they posted their conjecture to the preprint server arXiv.org, and it subsequently became a major open problem.

In 2024 mathematicians Zhaofeng Lin and Yanqi Qiu of the Hangzhou Institute for Advanced Study, University of Chinese Academy of Sciences, and Mingjie Tan of Wuhan University resolved the conjecture. Their research, which was posted as a preprint to arXiv.org and has not yet been peer-reviewed, not only confirmed the formula but also revealed why it works.

Mathematically, they likened GMC to a “fair betting game,” in which the expected winnings remain constant no matter the size of the game. When applied to fractal fluctuations, this means that the system remains balanced as you zoom in and out, and each smaller scale contributes randomness in a way that conserves energy.

Mathematicians call a process that exhibits this type of fair, scale-by-scale behavior a martingale. Unlike normal betting games, however, chaos “games” are much more complex, requiring higher-dimensional martingales.

“I heard about this conjecture during an online math workshop,” Qiu says. “I had focused on martingales for my Ph.D. thesis a few years back, and I had a hunch they would be the right tool here.”

The group used its higher-dimensional martingale structure to carefully track the accumulation of randomness at every scale. And sure enough, by conserving energy, numerous tiny “fair games” combined to give the same formula for the decay that Garban and Vargas had conjectured.

Qiu and his colleagues’ proof not only settled the conjecture but also paved the way for further proofs on more complex fractal models. The roadway to a complete theory isn’t entirely free of barriers, though. Even the new method fails when randomness forces the system to its critical phase-transition point. This phase transition itself is a rich and intriguing topic with its own set of deep questions, mathematicians say. But “to go further,” Qiu says, “we need new ideas.”

Stack Overflow and the Programming Language Rankings

Mike's Notes

Fascinating overview of languages from RedMonk.

Resources

References

  • Reference

Repository

  • Home > Ajabbi Research > Library > Subscriptions >RedMonk
  • Home > Handbook > 

Last Updated

15/12/2025

Stack Overflow and the Programming Language Rankings

By: Rachel Stephens
Red Monk:ALT+ESV: 18/06/2025

I’m Rachel Stephens, Research Director with RedMonk. I focus on helping clients understand and contextualize technology adoption trends, particularly from the lens of the practitioner. I cover a broad range of developer and infrastructure products, with a particular focus on developer tools.

Before joining RedMonk, I worked as a database administrator and financial analyst. I am located in Colorado.

At RedMonk we track technology adoption trends in the industry, particularly from the lens of the developer and the practitioner. Our goal is to understand how software is being built, what tools are being used and why, and how all the pieces of the SDLC fit together.

In order to accomplish this we use any qualitative and quantitative information we can gather to piece the picture together. We talk to practitioners. We meet with all types of technology vendors. We read a lot – we keep up on the news, lurk on forums, read research papers, and subscribe to too many newsletters to count. And – when it’s available – we look at data.

None of these sources can give us a complete picture, but in the aggregate they help tell a story.

Programming Language Rankings

One of the pieces of analysis we regularly perform is the programming language rankings. Typically we run these rankings twice a year dating back to 2012. The goal of this analysis to use publicly available data sets to track if there are any meaningful changes in how people are using programming languages.

The full methodology is described here, but in brief we correlate cumulative language usage as seen through non-forked PRs on public GitHub repos against questions asked on Stack Overflow.

These metrics have always told an incomplete story at best. There are languages that were under- or over-represented by using public GitHub repos; there are communities that were under- or over-represented by looking at discussions happening in Stack Overflow. These metrics were not perfect by any means, but the two large, publicly facing datasets created an interesting decade plus long trend for RedMonk to track over time. Here’s how we’ve seen the language use change over time.

A line chart titled "RedMonk Language Rankings: September 2012 – December 2024" shows the top 20 programming languages over time based on a combination of GitHub and Stack Overflow data. The x-axis represents time in half-year increments from 2012 to 2024, and the y-axis represents rank, with 1 at the top and 20 at the bottom. Each language is represented by a uniquely colored and labeled line, with the final rankings labeled on the right. A dark background with horizontal grid lines enhances readability. The chart is branded with the RedMonk logo in the bottom right corner.

Sourcehttps://redmonk.com/rstephens/files/2024/09/redmonk-language-rankings-jun-2024.png

However, the veracity of the Stack Overflow data is increasingly questionable.

The Decline of Stack Overflow

When we use Stack Overflow for programming language rankings we measure how many questions are asked using specific programming language tags.

If you take the above top 20 programming languages for each time period and then aggregate the questions tagged, you get the below chart.

A bar chart titled “Stack Overflow Tags Over Time” shows the volume of questions asked about RedMonk’s Top 20 programming languages, from 2012 to 2024

A bar chart titled “Stack Overflow Tags Over Time” shows the volume of questions asked about RedMonk’s Top 20 programming languages as percentage of max, from 2012 to 2024

From this you can see that questions peaked in 2016 and have been in decline since. While other pieces, like Matt Asay’s AI didn’t kill Stack Overflow are right to point out that the decline existed before the advent of AI coding assistants, it is clear that the usage dramatically decreased post 2023 when ChatGPT became widely available. The number of questions asked are now about 10% what they were at Stack Overflow’s peak.

What’s Next?

RedMonk is continuing to evaluate the quality of this analysis. On the one hand there is value in long-lived data, and seeing trends move over a decade is interesting and worthwhile. On the other hand, at this point half of the data feeding the programming language rankings is increasingly stale and of questionable value on a going-forward basis, and there is as of now no replacement public data set available. We’ll continue to watch and advise you all on what we see with Stack Overflow’s data.