Hey! Learn Databases. And Data Structures and Algorithms.

Agnes Muita
6 min readOct 10, 2022

A Self-Taught Programmer’s Guide

Okay! Before we dive into the agenda of my article, I took some time to prepare a short lesson for you. (Short “story” sounds much better if you think about it). I started coding 2 years ago, but it was not until 2 weeks ago when I finally had a technical interview for a part-time remote job. It didn’t exactly turn out to be the experience I had visualized for my first technical interview;(I genuinely thought I’d freak out and bail). But well, good news is, I didn’t bail; Though I did freak out when my interviewer came on! He was kind enough to repeatedly reassure me to be comfortable and be myself. We moved from questions on Git, Docker, CI/CD, and system design(which by the way, with a Bachelors in Economics, your girl ate this section up), to Databases, Data Structures and Algorithms. Now let’s pause for a moment…and allow me to take you back to 2020 when I first started coding.

Like many self-taught programmers, I joined the good ol’ bootcamp where we were immediately immersed into HTML, CSS, and JavaScript. Also, a disclaimer here, this turned out to be a “beginner friendly” bootcamp for non-beginners(story for another day but IYKYK). Unlike developers with computer science degrees, most self-taught developers tend to jump right into learning a language (“…go where the money at. It’ll be fun…”, they said). Now allow me to play the devil’s advocate here. Many developers have succeeded by following this path before; where they learn a language and completely eat it up! But if you ask around, majority will admit that somehow somewhere along the way, they needed to visit the basics and the heart of programming: Data Structures and Algorithms(DSA). And another one, Databases! Now back to my interview where I aced my system design questions, remember?…Well, I cannot say the same for my Databases and DSA part of the interview…..

Programming is all about data structures and algorithms, and the sooner we understand this, the better! The data structure isn’t a programming language like C, C#, Python etc. It is a set of algorithms that can be used in any programming language to organize the data in the memory. As a software developer(especially a backend developer), databases are equally as important and this fact was echoed by my interviewer. Using databases is inevitable; and you will eventually want to store data for long term usage. A huge part of programming requires you to obtain, process, and store data. You’ll need database knowledge including SQL to manipulate and retrieve this data. And by the way, you do not have to be a full blown database administrator, but the more you know, the better. It allows you to write better code and equips you with more skills for marketing to potential employers.

Now that we’re here, let me quickly(or not so quickly) convince you why you should learn databases as a programmer:

  1. Performance Optimization

Let’s assume that you’ve written good code for your application that was built using one of the popular frameworks. Now reaping performance gains out of the front-end and application layers of your app’s performance can be tricky. The storage layer(your databases) is often the easiest place to find real performance improvements. For instance in an SQL database, something as simple as adding an index can have impactful performance benefits. But the identification of that opportunity and making the improvements requires you to know SQL.

2. Object Relational Mapping won’t always handle everything.

We can all agree that ORMs are remarkable tools that make work easier when connecting applications to the database. Practically though, they are not perfect and one may encounter edge cases that the ORM was not particularly designed to handle. While this doesn’t happen all the time, it would be helpful to understand how to handle it yourself using SQL.

3. Understanding when not to use Databases.

Learning SQL and consistently working with it gives you a better understanding of how databases function, and what should and shouldn’t be handled there. For instance, will a specific type of data validation exhibit performance if it occurs in the application layer or when its enforcement is done on the database? The response to this will depend on the specifics. However, you will be in a much better place to answer if you are familiar with SQL and have a better grasp of how relational databases operate.

4. Debugging made easier(*smile, friend).

Encountering a bug in an application can leave you stranded for hours or even days. This is especially the case because it is not always easy to know which layer it is originating from. Having adequate database skills allows you to query the database directly, making it easier to diagnose problems there or simply to rule the database out as the source of the bug. Also, think of a situation where you get requests of data from stakeholders like partners, customers or your boss. Sometimes the application is not built to serve such requests. Being able to query the database manually with SQL will help you resolve these kinds of requests quickly when they arise.

Learn Data Structures and Algorithms Too!

Databases aside, allow me to sell you on the importance of learning data structures and algorithms too. Well, two words: Problem Solving!

Now, remember when I painted majority of beginner self-taught programmers as a bunch that easily gets carried away by the “learn a new fancy language right off the bat” wave? Well, I was very much talking about myself! And a whole army of soldiers matching beside and behind me. Learning data structures and algorithms is instrumental in understanding problems and solving them logically.

Newsflash, syntax is not enough. Well, one would argue that a normal web developer is just handling simple applications with issues like routing and CRUD operations. Another would argue that most back-end libraries like Express.js are rich with built-in functions, and hence may not find much need for applying apply data structures and algorithms. But then you land a gig or job where you work with complex applications! For example, with finance and banking apps, web-based Algo-trading platforms come into play especially trees, heaps, dynamic programming and the likes. Obviously, no one will really ask you to make a heap and get the minimum element. It is just that the more natural you are with DSAs, the greater the efficiency of your application since you can select the right approach for tackling a problem rather than a rookie approach that ends up consuming time. Understanding the problem and the journey towards solving it logically, is the key to being a good programmer. Learning stacks and queues, for example, will come in handy when solving a simple”Valid Parenthesis” challenge on LeetCode! It will also be rewarding when developing solutions for your application especially when it starts to scale and performance becomes an issue.

Article’s done! It’s not too late to work on your databases and DSAs. Remember, you don’t have to become a full blown database administrator, but the more you know, the better you are as a programmer. You will write better code and you will have more skills to market to potential employers. Data Structures and Algorithms are fundamental for a successful career in programming. In fact, most companies will ask you DSA questions in interviews. Jumping into writing the code won’t be as effective as actually thinking through the problem and coming up with a course of action. Learn databases today. Learn Data Structures and Algorithms.

Originally published at https://agnesmuita.hashnode.dev.

--

--