Category Archives: Databases

Redis Day Comes Again

Well, it’s that time of year again, where Redis Day storms the ports of New York, brandishing corporate video that implies Redis is the only hope for humanity’s salvation. I don’t know if that’s necessarily true, but like last year, they do know how to pick a location. In any case, the first of the 2-day event was an introductory session to Redis, not really necessary for those already familiar with the platform. I opted to go out of curiosity, and I’m glad that I did.

Even though most of the day was a rehash of what I already knew, the intro did point out to me some features that had been added with the most recent version, like the UNLINK command. (I’m not known for always reading release notes.) I also learned that the “master-slave” terminology has now fallen under, as Jacobins would probably describe it, the guillotine of progress:

Actually, I’m not sure if the new “master-replica” terminology is a better set of terms. If you still use the term “master” in this scenario, doesn’t it imply that the other party is a slave? And when I think of replica in this situation, the term replicant comes to mind, and that doesn’t really sound all that much better. But I digress…

The second day of the event was more interesting. To a small extent, some of that could be attributed to the general speakers. We heard from a few people about certain business cases, as they described how Redis was used beneficially in their work. But for me, the best parts of the day were the beginning and end, when we got to hear from the brilliant creator of Redis: Salvatore Sanfilippo (a.k.a., Antirez).

Since most of the time was spent more towards the corporate pitch, it was refreshing to hear Antirez talk about all of the technical features in the newest version of Redis and how the need and implementation for these features came about. All of which was told using his interesting drawing style, which I had never seen a presenter do before. But I definitely appreciated it, since I tend to do the same thing whenever I describe anything with precision. (Even how to properly build a sandwich.) I also appreciated it since he and I probably have the same skill level of drawing:

Even though some people might tune out during these kinds of events (especially at the end, when people are looking to beat the crowd by leaving early), I enjoy the technical presentation as a breath of fresh air. Who knew that a detailed explanation on the evolution of the Redis EXPIRE command could wake me up from my imminent coma? I was just as surprised…almost as much as Antirez was when I approached him later, to thank him for leaving Sicily to speak and to ask him some questions. (Note to self: pay attention to your surroundings and never ask questions of someone when they’re waiting to use the bathroom, especially a database guru. You may not get the best answers, and you will feel a tad awkward when you realize your mistake.)

So, what did I take away from that day? Well, I could say that Redis is definitely growing its user base. Just from a glance and a shoddy memory, I’d say that the crowd was nearly double the size of last year’s event. Plus, I heard about a more diverse set of projects using Redis than ever before. From all that, I would say that it’s becoming a bigger fish in the DB sea.

So I guess the ultimate question is: who’s going to try and eat the growing fish before it gets too big? My money is on Oracle.

Advertisements

Galvanize This: Hanging Out with Redis

So, I attended a Redis workshop a few days ago, at the New York “campus” (which is a buzzy, DB-esque industry word that I loathe) of Galvanize. Even though I usually don’t go for these meetup/workspace type of places, I’ll admit that this one was rather pleasant. Unlike other places, it did a good job of finding that fine line between casual and professional. For example, no beanbags anywhere. Because as much as I love beanbags myself (i.e., I have two at home), we can’t look at your screen together unless I get on my knees or I crawl onto the beanbag with you…which might be uncomfortable in many ways for the both of us. Plus, the space had reliable WiFi for most of the time I was there, unlike some other places.

Even though I’ve already been dealing with Redis at work for a little while now and generally impressed with its performance, it never hurts to try and learn something from the masters. (Unfortunately, AntiRez himself did not leave Sicily and fly over to teach us.) I was curious how they were going to showcase the tech and if we were going to just sit there and watch, when they instructed us to download Docker. As it turned out, we were going to learn the lesson via containers with Jupyter Notebooks, which I had never heard of before. And since I yearn for the era of interactive documentation, I couldn’t have been happier. (On a side note, I only recently learned about KataCoda, which I love just as much, if not more.)

Even though the second half of the day was your familiar salespitch for Redis Enterprise and Redis Cloud (which did seem to be an appealing purchase), the first half of the day was when they taught about the product itself. For the most part, it wasn’t anything new to me, aside from the occasional bit of trivia. (Lua is the language used by the Redis CLI? Huh. It’s come a long way since being just the scripting language for WoW skins.) I did learn a few tidbits about the data structures (like the existence of HyperLogLog), but since I use Spring Caching in our microservices, we don’t pay that much attention to them.

Instead, it was interesting to learn about the features of Redis that we weren’t even leveraging yet at work. For example, you can write your own extensions to Redis using C. Which I’d be tempted to do just because, since I miss writing in C…Also, it was interesting to learn about the various modules that were already available for Redis, with functionality ranging from machine learning to bloom filters. And that’s when I recognized a pattern seen before. Much like every other tech company, there seems to be the desire to get into whatever is hot, to survive as a company by being more horizontal. However, I would implore Redis to be careful and to never neglect your core mission. I, for one, don’t really need machine learning, but I’d like Redis to work with Spring (i.e., Pivotal) to further develop the Spring Data Redis layer and make it configurable, so I can easily direct reads to slave nodes. I need that, not machine learning. So, even though I didn’t learn a great deal about Redis by attending, I got to see the general direction of the company. In that way, I’d say that the trip to Galvanize was worth it.

That, and spears of fresh fruit.

You just can’t argue with fresh fruit spears, where the fruit is cut into various geometrical shapes. It just plucks the right strings of geeky hearts.

And While I’m Asking For Things

Speaking of requests, I have another quick one. My department has used the Oracle.ManagedDataAccess.dll for quite a while now in our C# (i.e., .NET) deployments, and even though we’ve had some performance issues at times, we’ve created some workarounds and eventually achieved harmony with this miscreant spawn of Oracle (who has been known to be developer-unfriendly). However, we came across a new one the other day:

Value cannot be null.
Parameter name: byteArray
Server stack trace:
at System.BitConverter.ToString(Byte[] value, Int32 startIndex, Int32 length)
at OracleInternal.TTC.TTCLob.GetLobIdString(Byte[] lobLocator)
at OracleInternal.ServiceObjects.OracleDataReaderImpl.CollectTempLOBsToBeFreed(Int32 rowNumber)
at Oracle.ManagedDataAccess.Client.OracleDataReader.ProcessAnyTempLOBs(Int32 rowNumber)
at Oracle.ManagedDataAccess.Client.OracleDataReader.Read()

Basically, if you have a null value in the CLOB column of an Oracle table, you might get this error when you attempt to access that row in the result set. After trying the most recent version of the library (as recommended by Oracle), it became obvious that they still haven’t fixed it. Strangely, the error seems to occur randomly, since it won’t always happen when running the executable against the same data. After spending some time in an effort to diagnose the error, I eventually capitulated, accepted Oracle’s foibles, and simply set all CLOB columns to EMPTY_CLOB(). Problem solved.

But for posterity and all those after me, I implore you, Oracle: can you address this simple problem in your library? I’d ask you to open-source that library, but we all know that’s not gonna happen. So, please go ahead and fix the bug for us. It’d probably take you a whole 15 minutes, the same amount of time that Ellison needs to check the rigging on one of his catamarans. We’d all appreciate it!