Posts

Efficient Bulk Hash Insertion with Redis 8.10’s HIMPORT

I’m not a Ruby developer, and my code samples might make that clear. However, there are two reasons I’m using Ruby for the examples in this article: 1. A new release of [redis-rb](https://github.com/redis/redis-rb). 2. Its support for a new Redis command: `HIMPORT`. ## Getting started Establishing a Redis connection in Ruby is straightforward. All you need is the redis gem and a Redis OSS server. **Fun fact**: A ruby is a gemstone, which is why software packages in Ruby are called gems. It’s a charming way to highlight the value of every package contributed by the community. ```ruby redis = Redis.new( host: options[:host], port: options[:port], username: options[:user], password: options[:password], himport_auto_prepare: true ) ``` The `himport_auto_prepare` option defaults to `true`. I included it here for reference. We’ll revisit it later. For now, just bear with me. ## Why another way for importing hashes? Why not just use...

Sicherer Umgang mit dem Smartphone

Als Dozent für digitale Sicherheit freue ich mich über die Zusammenarbeit mit der AWO Thannhausen, die mit ihrer kostenlosen Smartphone-Sprechstunde bereits wertvolle Arbeit leistet. In unserem Vortrag ging es darum, Senioren und Interessierten praktische Tipps für den sicheren Umgang mit dem Smartphone an die Hand zu geben. Mehr dazu gibt es im Artikel der Augsburger Allgemeine hier: https://www.augsburger-allgemeine.de/krumbach/thannhausen-vortrag-ueber-sicherheit-am-smartphone-114173390 .

How to use Redis as a Vector Database for Recommendations

Introduction This blog post is the result of some preparation work for a recent meetup, where I introduced a bunch of recommendation engine algorithms. The idea of using vector similarity search for recommendations is quite simple: The interests of a user are expressed as a vector. Each component of the vector is associated with one category of interest. If we know the interests of a specific user, we can search for the K - N (earest) N (eighbours) to find other users that share the same interests. We can then inspect the behavior of these users (e.g., the purchase history) to recommend our user specific products. The following table shows the vector  [0.9, 0.7, 0.2] : books comics computers 0.9 0.7 0.2 Let's assume that a user is only interested in a specific category if the interest value is larger than the threshold of 0.4 , which means that our user is interested in 'books' and 'comics' but not in 'c...

Gemeinsames Projekt zu 'AI-gestütztes Tool zur vereinfachten Erfassung von Objekten im Museum' mit der Hochschule Augsburg

Wir bei NoSQL Geeks freuen uns über eine weitere Zusammenarbeit mit dem Fachbereich Datenbanken der Fakultät für Informatik der Hochschule Augsburg . Wir wissen die Resonanz zu unserem Projektvorschlag ' AI-gestütztes Tool zur vereinfachten Erfassung von Objekten im Museum ' zu schätzen und blicken der Zusammenarbeit mit den Studierenden entgegen. Außerdem konnten wir das Mittelschwäbische Heimatmuseum Krumbach als Anforderungsgeber, und Ansprechpartner zu fachlichen Fragen rund um die Dokumentation im Museum, gewinnen. Hier eine kurze Projektbeschreibung: Museen jeder Größe stehen vor der Herausforderung, mit begrenzten personellen Mitteln Objekte aufzunehmen und zu dokumentieren. Die Beschreibung eines Objekts umfasst die Klassifizierung (z.B. Doppelhenkelvase), das Material (z.B. Porzellan), die Farbe, das Alter, die Herkunft, und viele weitere Eigenschaften.  Ziel des Projekts ist somit die Erstellung eines Open-Source-Tools zur Dokumentation im Museum, welches Merkmale w...

Azure DevOps im Überblick

Image
Am 17.03.2023 treffen wir uns um 21:00 im Stückwerk . Der Vortragende, Christian Linke, wird uns einen Überblick zum Thema 'DevOps mit und in der Azure Cloud' geben. Nähere Informationen zum Event findet ihr in unserer Meetup-Gruppe hier: https://www.meetup.com/de-DE/nerdkram-mittelschwaben/events/292046891/

Codecamp for Kids

Image
NoSQL Geeks wird im Januar ein Codecamp für Kinder zwischen 12 und 16 Jahren organisieren. Nähere Details findet ihr hier:  https://www.meetup.com/codecamps-by-nosql-geeks/events/290042192/ . Bei Fragen könnt ihr uns auch direkt kontaktieren. Alle Kontaktdaten finden ihr auf  https://www.nosqlgeeks.de .

New meet-up group in Mittelschwaben

Image
Wir freuen uns mitteilen zu können, dass wir eine Meet-up-Gruppe in Mittelschwaben organisieren werden. Themen sind u.a. IT, Softwareentwicklung und Datenverwaltung. Dazu werden wir uns regelmäßig in Krumbach (Schwaben) treffen. Nähere Informationen erhaltet ihr auf  https://www.meetup.com/nerdkram-mittelschwaben/ . Lebt oder arbeitet Ihr nahe Mittelschwaben? Wollt ihr den Vorträgen zuhören, oder selbst präsentieren? Dann tretet doch einfach unserer Gruppe auf meetup.com bei! / We are happy to share that we will participate and sponsor a meet-up group around IT, Software Development, and Data Management in Mittelschwaben. The idea is to meet frequently in Krumbach (Schwaben). Further details can be found here:  https://www.meetup.com/nerdkram-mittelschwaben/ .  Are you located in this area of the world? Do you want to participate, either as guest or as presenter? Then please join our group on meetup.com!

Talk at the University of Applied Sciences in Augsburg about practical use cases of NoSQL

Image
It was a pleasure visiting the University of Applied Sciences in Augsburg last week. Prof. Dr. Michael Predeschly invited me to give a talk about practical uses cases of NoSQL. It was amazing to see all those interested students and to answer their questions about polyglot persistence, the right usage of NoSQL databases, and practical use cases. Do you want to know more? Then reach out to me. My contact details can be found here: https://www.nosqlgeeks.de .

NoSQL Geeks is part of the Stückwerk Community

The Stückwerk Community is a project of the "Kult E.V." in Krumbach (the home town of the company NoSQL Geeks). The idea is to create a place where culture meets social initiatives. There are frequent events like art exhibitions or intercultural meet-and-greet-s. NoSQL Geeks will present during this year's XMas market that happens in the Stückwerk building in the town center. More about NoSQL Geeks can be found here: https://www.nosqlgeeks.de . / Das Stückwerk ist ein Projekt des Kult-Vereins in Krumbach (der Firmensitz der NoSQL Geeks). Die Idee ist es einen Platz der Begegnung von Kultur und sozialen Initiativen zu schaffen. So gibt es z.B. Veranstaltungen wie Kunstaustellungen oder interkulturelle Treffen. NoSQL Geeks wird sich wärend des diesjährigen Weihnachtsmarkts im Stückwerksgebäude im Stadzentrum vorstellen. Mehr über NoSQL Geeks erfahren Sie hier: https://www.nosqlgeeks.de .   https://vimeo.com/773013927

So what exactly is an Event Loop?

Introduction Most of you are knowing that I am working a lot with Redis. And some of you might also know that Redis OSS 'standalone' is mainly single-threaded. The reason why it can achieve that high throughputs on a single instance is that it uses an event loop. But what the hell is an event loop and how does it work? First of all, let me tell you the story behind this article. It all started last weekend. For some reason, I found the time to read a Kotlin book. Not sure why I did, guess I just had the feeling that I am too long disconnected from actual development tasks and wanted to explore one of the comparable new programming languages. The book was great and I had the impression that Kotlin is actually quite nice. Then I went back to my main task (helping to enable the Technical Field at Redis Labs) and had to work on a slide about the Redis event loop. A look at the source code (and the following article https://redis.io/topics/internals-rediseventlib), raised a ques...

A simple but special Redis Web Client

Image
It was a while ago when I wrote my last blog post. So let me take the chance to write something about a very simple piece of software which started as a fun project of mine. Let's do it a bit different this time. I will show you the results first and then I will explain what's special about this application: This looks very basic, right? What's special about it? So here is the story behind it: It all started a few weeks ago when I decide to buy an iPad Pro (11 inches). The motivation was indeed not to use it as a development machine. My current role requires to draw some diagrams and to explain stuff a bit more vizually. So the iPad Pro seemed to be a nice device for such a purpose. Being a techie, I wondered a bit which kind of development can be done on it and I started to install some tools for experimenting with them: Working Copy: A Git client Pythonista: A Python IDE StaSh: A shell for Pythonista which allows you to use packages via 'pip' Blink: ...

Building a Recommendation Engine with Redis

When I was asked which topic I would like to present at this year's OOP conference, I was out of the box thinking about 'Something with Machine Learning' involved. It was years ago at the university when I had a secondary focus on 'Artificial Intelligence and Neural Networks' and I think that's fair to say that the topic was not as 'hot' as it is today. The algorithms were the same as today but the frameworks were not that commodity and calculations happened either on paper, with MatLab or with some very specialized software for neural network training. However, the actual discipline stayed fascinating and even if I would not call myself a Data Scientist (I sticked more with my primary focus which was Database Implementation Techniques - so I am more a database guy :-) ) I am really amazed of the adoption and number of arising frameworks in the field of Machine Learning and Artifical Intelligence. Machine Learning or Artificial Intelligence is quite a ...

Asynchronous Operation Execution with Netty on Redis

Netty got my attention a while back and I just wanted to play a bit around with it. Given the fact that I am already fallen in love with Redis, what would be more fun than implementing a low level client for Redis based on Netty? Let's begin to answer the question "What the hell is Netty?". Netty is an asynchronous (Java based) event-driven network application framework. It is helping you to develop high performance protocol servers and clients. We are obviously more interested in the client part here, meaning that this article is focusing on how to interact with a Redis Server. Netty is already coming with RESP  support. The package 'io.netty.handler.codec.redis' contains several Redis message formats: RedisMessage : A general Redis message ArrayRedisMessages : An implementation of the RESP Array message SimpleRedisStringMessage : An implementation of a RESP Simple String message ... So all we need to do is to: Boostrap a channel : A channel is...

Data Encryption at Rest

Data security and protection is currently a hot topic. It seems that we reached the point when the pendulum is swinging back again. After years of voluntary openness by sharing personal information freely with social networks, people are getting more and more concerned about how their personal data is used in order to profile or influence them. Social network vendors are getting currently bad press, but maybe we should ask ourself the fair question "Didn't we know all the time that their services are not for free and that we are paying them with our data?". Maybe not strictly related to prominent (so called) 'data scandals' but at least following the movement of the pendulum is the new European GDPR regulation around data protection. Even if I think that it tends to 'overshoot the mark' (as we would say in German) and leaves data controllers and processors sometimes in the dark (unexpected rhyme ...), it is a good reason for me address some security topics...

To PubSub or not to PubSub, that is the question

Introduction   The PubSub pattern is quite simple: Publishers can publish messages to channels Subscribers of these channels are able to receive the messages from them There is no knowledge of the publisher about the functionality of any of the subscribers. So they are acting independently. The only thing which glues them together is a message within a channel. Here a very brief example with Redis: Open a session via 'redis-cli' and enter the following command in order to subscribe to a channel with the name 'public'  In another 'redis-cli' session enter the following command in order to publish the message 'Hello world' to the 'public' channel: The result in the first session is: BTW: It's also possible to subscribe to a bunch of channels by using patterns, e.g. `PSUBSCRIBE pub*`    Fire and Forget  If we would start additional subscribers after our experiment then they won't receive the previous message...

Indexing with Redis

If you follow my news on Twitter then you might have realized that I just started to work more with Redis.  Redis (=Remote Dictionary Server) is known as a Data Structure Store. This means that we can not just deal with Key-Value Pairs (called Strings in Redis) but in addition with data structures as Hashes (Hash-Maps), Lists, Sets or Sorted Sets. Further details about data structures can be found here: https://redis.io/topics/data-types-intro Indexing in Key-Value Stores With a pure Key-Value Store, you would typically maintain your index structures manually by applying some KV-Store patterns. Here some examples: Direct access via the primary key: The key itself is semantically meaningful and so you can access a value directly by knowing how the key is structured (by using key patterns). An example would be to access an user profile by knowing the user's id. The key looks like 'user::<uid>'. Exact match by a secondary key: The KV-Store itself ca...

Kafka Connect with Couchbase

Image
About Kafka Apache Kafka is a distributed persistent message queuing system. It is used in order to realize publish-subscribe use cases, process streams of data in real-time and store a stream of data safely in a distributed replicated cluster. That said Apache Kafka is not a database system but can stream data from a database system in near-real-time. The data is represented as a message stream with Kafka. Producers put messages in a so called message topic and Consumers take messages out of it for further processing. There is a variety of connectors available. A short introduction to Kafka can be found here:  https://www.youtube.com/watch?v=fFPVwYKUTHs . This video explains the basic concepts and how Producers and Consumers are looking like. However, Couchbase supports 'Kafka Connect' since version 3.1 of it's connector. The Kafka documentation says "Kafka Connect is a tool for scalably and reliably streaming data between Apache Kafka and other systems. It makes i...

Visualizing time series data from Couchbase with Grafana

Image
Grafana is a quite popular tool for querying and visualizing time series data and metrics. If you follow my blog then you might have seen my earlier post about how to use Couchbase Server for managing time series data: http://nosqlgeek.blogspot.de/2016/08/time-series-data-management-with.html This blog is now about extending this idea by providing a Grafana Couchbase plug-in for visualizing purposes. After you installed Grafana (I installed it on Ubuntu, but there are installation guides available here for several platforms), you are asked to configure a data source. Before we will use Grafana's 'SimpleJson' data source, it's relevant how the backend of such a data source looks like. '/' : Returns any successful response in order to test if the data source is available '/search ': Returns the available metrics. We will just return 'dax' in our example. '/annotations' : Returns an array of annotations. Such an annotation h...

Time series data management with Couchbase Server

Image
Couchbase Server is a Key Value store and Document database. The combination of being able to store time series entries as KV pairs with the possibilities to aggregate data automatically in the background via Map-Reduce and the possibility to dynamically query the data via the query language N1QL makes Couchbase Server a perfect fit for time series management use cases. The high transaction volume seen in time series use cases is meaning that relational database systems are often not a good fit. A single Couchbase Cluster on the other hand side might support hundreds of thousands (up to millions) of operations per second (indeed dependent on the node and cluster size). Time series use cases seen with Couchbase are for instance: Activity tracking : Track the activity of a user whereby each data point is a vector of activity measurement values (e.g location, ...) Internet of things: Frequently gathering data points of internet connected devices (as cars, alarm systems, home ...