Using client quotas with IBM Event Streams

February 26th, 2023

In this post, I want to highlight a feature that I often see under-used in IBM Event Streams, and show how you can easily give it a try.

Kafka can enforce quotas to limit the impact that client applications can have on your cluster. To quote the Kafka documentation:

It is possible for producers and consumers to produce/consume very high volumes of data or generate requests at a very high rate and thus monopolize broker resources, cause network saturation and generally DOS other clients and the brokers themselves.

Having quotas protects against these issues and is all the more important in large multi-tenant clusters where a small set of badly behaved clients can degrade user experience for the well behaved ones.

In fact, when running Kafka as a service this even makes it possible to enforce API limits according to an agreed upon contract.

Read the rest of this entry »

Teaching students that machine learning doesn’t always learn what we intend it to

January 3rd, 2023

This post was written for MachineLearningForKids.co.uk/stories: a series of stories I wrote to describe student experiences of artificial intelligence and machine learning, that I’ve seen from time I spend volunteering in schools and code clubs.

Some of the best lessons I’ve run have been where a machine learning model did the “wrong” thing. Students learn a lot from seeing an example of machine learning not doing what we want.

Perhaps my favourite example of when something went wrong was a lesson that I did on Rock, Paper, Scissors.

Students make a Scratch project to play Rock, Paper, Scissors. They use their webcam to collect example photos of their hands making the shapes of rock (fist), paper (flat hand), and scissors (two fingers) – and use those photos to train a machine learning model to recognise their hand shapes.

It this particular lesson, the project worked really nicely for nearly all the students. There was one student where things went a little bit wrong.

Read the rest of this entry »

What I’ll be playing in 2023

January 2nd, 2023

(To start with, anyway…)

These are my current favourite toys…

Read the rest of this entry »

Running IBM Event Streams on a laptop (sort of)

December 23rd, 2022

How to run a tiny local Kafka cluster using IBM Event Streams images

For local development on Kafka projects, I always run the public open source builds of ZooKeeper and Kafka as Java processes directly on my laptop (similar to steps described in the Apache Kafka Quickstart).

But for a project this week, I needed to verify something with the distribution of Kafka that comes with IBM Event Streams.

I used a simple Docker Compose setup for this. I’ll use this post to share how I did it.

Read the rest of this entry »

Xbox LIVE events for Kafka

December 19th, 2022

I’ve made a Kafka Connect source connector for sending “real-time” events from Xbox LIVE to Kafka topics.

Quick primer if you’re not a gamer or don’t know what I’m talking about!
The Xbox platform comes with a social aspect: details about games you play and the achievements you earn playing them, are shared with your friends on the Xbox LIVE service. That is the source of data I’m using here.

Create an API key for your Xbox LIVE account, and run the Connector with it, and it will start producing two streams of events to your Kafka cluster:


Screenshot from Event Streams, but as a Kafka Connect connector, you could use any flavour of Kafka, including Apache Kafka.

ACHIEVEMENTS
Events when one of your friends earns an achievement.

PRESENCE
Events when your friends start playing a game, or go online/offline.

Details about the attributes of each of these events can be found in the Connector README, but here are a few screenshots to give you an idea.

An example message on the ACHIEVEMENTS topic.

Read the rest of this entry »

Teaching students how to use confidence scores

December 18th, 2022

This post was written for MachineLearningForKids.co.uk/stories: a series of stories I wrote to describe student experiences of artificial intelligence and machine learning, that I’ve seen from time I spend volunteering in schools and code clubs.

Machine learning models don’t just give an answer, they also typically return a score showing how confident the system is that it has correctly recognized the input.

Knowing how to use this confidence score is an important part of using machine learning.

An example of how a student used this in their project is shown in this video. Their Scratch script says that if the machine learning model has less than 50% confidence that it has correctly recognized a command, it replies “I’m sorry I don’t understand” (instead of taking an action).

The project was trained to understand commands to turn on a lamp or a fan. When they asked it to “Make me a cheese sandwich”, their assistant didn’t try to turn the lamp or fan on, it said “I don’t understand”

This command was unlike any of the example commands that had been used to train the model, causing the machine learning model to have a very low level of confidence that it had recognised the command. This was represented with a very low confidence score.

The challenge for the students making this project was knowing what confidence score threshold to use. Instead of telling them a good value to use, I let them try out different values and decide for themselves. By playing and experimenting with it, they get a feel for the impact that this threshold has on their project.

Read the rest of this entry »

Spotify extension for Scratch

December 17th, 2022

In this post, I want to share a new Scratch extension that I made this week, explain what it does, and suggest a few ideas for the sorts of ways that it could be used.

Overview

The extension makes some of the data from the Spotify Audio Features API available as blocks in Scratch.

It means you can get numeric values representing different characteristics of songs, directly into a Scratch project.

Read the rest of this entry »

What is IBM Client Engineering?

December 17th, 2022

I’ve been working in Client Engineering since last summer.

This video is a great description of the aspiration of the team, and the vision of the sort of work we want to do with our customers. (Plus you get a few glimpses of our office in York Road where I worked this year).