Sign in

Irtiza Hafiz
Photo by Ahmed Adly on Unsplash

Tombstones are created in Cassandra whenever you delete some data. In simple terms, tombstones are pretty much the same as the row of data you just deleted with the addition of a special “delete” marker that tells the database that the data has been deleted.

So let’s say you have row A in your table and you delete the row like you would delete any rows in relational or non-relational databases. Instead of actually removing this data immediately, Cassandra just adds a “delete marker” to this data and tells you that the data has been removed.

The “delete marker” includes…


Photo by Jake Givens on Unsplash

Cassandra is a distributed database that support incredible write throughout and is known for its scalability and availability. It’s great at supporting applications with very high write throughput.

To achieve this high performance, Cassandra has a unique write pattern. Cassandra has a few different data structures that it uses:

  • Commit Log (Disk)
  • Memtable (Memory)
  • SSTable (Disk)

All three of these data structures are involved in every write process.

Step 1: Write to Commit Log

The first thing Cassandra does when a write comes in is write it to its commit log. The commit log is an append only log of records for durability purposes. …


Photo by Vista Wei on Unsplash

At the beginning of 2020, I set myself a goal to use my phone more mindfully. The goal was the result of analyzing my screen time and how that is divided between all the apps that I had installed.

Turned out I was suffering from the “infinite scroll syndrome” like most people in today’s world. I was logging two to three hours on apps like Facebook, Instagram and Google News even though I cannot recall much value that I got out of them.

It seemed like instead of using my phone as a tool to get things done, I was


Photo by Bernard Hermant on Unsplash

As software engineers, the first thing we ever learn when learning a new programming language is how to print out “Hello World” in the console.

Fast forward a few months from that day, and now that we are so familiar with the language and we know all of its intricacies and different conventions, one thing that we still do is “print” things to the console when we are debugging.

It’s just too easy to just throw a print statement when we are unsure about anything. It’s too convenient! …


Photo by Luke Chesser on Unsplash

Python gives you some very handy functions that you can use to sort efficiently. You can even chain sorts so that for the same data, you have a primary sort and then a secondary sort within that.

So, without further ado, let’s get started.

Sorting Fundamentals

The two primary ways you can sort in Python are:

  • sort method that comes with lists
  • sorted function which takes in any iterable

Both will sort your data in ascending order by default. But there is a crucial difference between these two approaches:

  • sort performs the sorting operation in-place. …

Photo by Emile Perron on Unsplash

Python is one of the most versatile programming languages that are out there. From declarative programming to object-oriented programming to functional programming, Python incorporates approaches from multiple programming languages. In this article, I will focus on writing functional code using Python.

When people think about functional programming using Python, they mostly think about three functions: map filter reduce. However, there are many more functions that go under the radar that you can use for various use cases. Not only these functions make your code more functional, they also let you utilize and manipulate data structures in the most efficient ways.


Photo by Sidorova Alice on Unsplash

Designing data models in Cassandra can be tricky if you are coming from a Relational Databases background. Even though Cassandra tries it best to draw parallels to relational databases when it comes to terminologies, I feel like it becomes more misleading. Of course CQL (Cassandra Query Language) being so similar to SQL doesn’t help either.

Fundamentally, Cassandra (a NoSQL database) and other relational databases (MySQL, PostgreSQL) are very different from each other. Cassandra is not a drop-in replacement of relational databases. You have to design your schema with an entirely different way of thinking.

To get you started with designing…


Photo by Sidorova Alice on Unsplash

There are multiple types of keys in Cassandra. Namely:

  1. Primary Key
  2. Partitioning Key
  3. Clustering Key

Let’s go over each of these to understand them better.

Primary Key

Each table requires a primary key. A primary key can be either one field or multiple fields combined. The primary key has to be unique for each record. Otherwise, Cassandra will do an upsert if you try to add records with a primary key that already exists.

Let’s look at an example of a real-life Cassandra table:

CREATE TABLE player ( name text, club text, league text, nationality text, kit_number text, position text, goals int…

Photo by Clément H on Unsplash

I started developing React applications about two years ago. It all started with a classic todo application and soon followed by another classic, a web-based weather application. Soon I realized why React was gaining in popularity co much and I started loving its simplicity.

Since then I have developed more than a dozen of web applications using React JS. From pet projects to explore different aspects of the framework to more sophisticated applications with almost a million daily users, I used React to develop projects of all sizes.

Independent of the size of the project, there were always a set…


Photo by Luca Bravo on Unsplash

Building a production grade web application from scratch is no easy feat. Not only do you have to make sure that the programming language, framework and database you chose fits your type of application, you also have to worry about deploying and maintaing the application.

In my short software engineering career so far, I have built and deployed multiple small projects. Some were just client side rendered React applications that I could host in S3 for free, some were small backend APIs that I just hosted locally. However, I never really had to think about a proper full stack application…

Irtiza Hafiz

Software Engineer @ Yelp writing about all things programming and productivity

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store