The Full-Stack Developer’s Roadmap Part 3: Databases

by | 09.12.2020 | Personal Development, Engineering

Whether it’s eye-catching front-end or snappy back-end, we want users to use our website. Here comes a need for an electronic storage system or database to store product catalogue, user credentials, transaction receipts, etc.

In this post, we’ll walk through these key areas:

  • What is Database?
  • What is a Relational Database?
  • What is a Non-Relational Database?
  • When should you use SQL or NoSQL?
  • Where to go from Here ?

There are a lot of options to store your data optimally. My purpose for this post is to simplify what database are and help you decide the best database to avoid any technical debt. By the end of this piece, you won’t be sitting in the dark when you have to find an optimal database for your project.

So, let’s dive in! ?

What is Database?

The best way to understand database is to understand what it does. We can use the 3-tier model; a simplified and standard architecture to understand what a database does. This architecture is composed of a presentation tier, a logic tier and a data tier.

Presentation Tier – This is the face of the application which a user interacts to carry out necessary tasks. This tier is built on HTML, CSS, JS or other front-end technology.

Application/Logic Tier – This layer carries out all of the computational tasks which drives an application’s core capabilities. The tier is built on Java, Python, C++ or other back-end technology.

Data Tier – This is the layer where the database management system (DBMS) exists, i.e. the system which manages the database. The data tier is responsible for storing the results produced by the application layer (e.g. transaction id’s after a transaction) or providing pre-stored information (e.g. user’s current balance) to the logic tier to compute.

A database is an electronic system that allows data to be easily accessed, manipulated and updated. – Techopedia

What is a Relational Database?

Relational database focuses on a pre-defined relationship between the elements. The items are stored in rows and columns. For visual representation you can think it as Microsoft Excel but with a pinch of salt. We need a tool to manage the relational database. Therefore, we use SQL.

Visual representation of relational database

SQL or Structured Query language is a standard language to deal with the relational database. The language is used to carry out CRUD operations, i.e. Create, Read, Update, Delete on tabular data.

Popular SQL databases

MySQL

MySQL is an open-source DBMS (some proprietary code is in its enterprise edition) which was released in 1995. The relational database is very well documented alongside having enormous support.

The C and C++ written DBMS has become a critical component of open-source web dev stack so much that it’s part of the web archetype known as LAMP (Linux, Apache, MySQL, Perl/PHP/Python).

  • Pros: high performance for large databases, open-source
  • Cons: incremental backups are uneasy about implementing, no support for XML or OLAP
  • Companies: Google, Facebook and Twitter, to name a few

MariaDB

MariaDB, a fork (a project based on source code) of MySQL is maintained by developers who were unhappy with the acquisition of MySQL by Oracle.

Because it is a fork, both the database have similarities like of architecture, and it’s effortless to migrate from one to the another.

  • Pros: high speed, scalable architecture and plug-ins, encryption at different levels
  • Cons: interfaces on MariaDB ****is not so user-friendly and hard to handle, hard to implement relational queries
  • Companies: Google, Mozilla, and the Wikimedia Foundation, to name a few

PostgreSQL

PostgreSQL is a free and open-source object-relational DBMS, which is built on C language has an emphasis on efficient scaling. The following DBMS is said to very developer-friendly and caters to a wide range of load.

Easy and efficient scaling has made it one of the most popular relational databases in use today. Apple, for example, uses PostgreSQL by default on the MacOS Server operating system.

  • Pros: highly scalable, predefined functions, support for JSON
  • Cons: uneasy about configuring, lack of performance for high-load operations

What is a Non-Relational Database?

NoSQL or “non-relational” database is explicitly optimised for applications that require large data volume, low latency, and flexible data models. The data is not present in the tabular form and is build for specific data models with flexible schema (no specific structure).

NoSQL is an umbrella term, one which encompasses several different technologies tackling different user demand.

An overview of the NoSQL database space.

The storage solution is designed with keeping the user in mind, and the information is stored in one JSON (JavaScript Object Notation) document.

{
	"Name": "Julie",
	"Hometown": "Los Angeles, CA",
	"Age": 28
}

MongoDB

MongoDB is an open-source and one of the most popular non-relational storage solution, despite its release in 2009. Being a NoSQL database it is primarily a document-oriented database, intended for use with JSON files.

The C, C++ and JavaScript written database has become a students first choice when they start learning web development so much that it’s part of popular and extensively used web stacks known as MEAN (MongoDB, Express(.js), Angular(.js), Node(.js)) and MERN (MongoDB, Express(.js), React(.js), Node(.js)).

  • Pros: high speed, high performance, easy configuration, support for JSON
  • Cons: high data size, high memory usage, limited nesting of files, security is not set by default

When should you use SQL or NoSQL?

When to pick a SQL database?

A SQL database will be the ideal choice when you want to store structured data with a relationship in it, and data integrity is critical. The database is generally designed for transactional and strongly consistent online transaction processing (OLTP).

So, it’s an ideal choice for stock trading, banking or any social media application like Facebook.

Summary for when should you use SQL or NoSQL

When to pick a NoSQL database?

NoSQL will be the ideal choice when you want to carry you a large amount of read-write operations on an enormous data set. They are very low in latency even with a large amount of data and can handle more traffic with ease in comparison to SQL database.

So, it’s an ideal choice for data analytics and also when you want to develop an application rapidly.

AWS explains this in a very well made table.

Where to go from Here ?

We’ve covered a lot in this piece, but we’ve only touched the surface of this topic. We haven’t discussed on intention about another alternative as this article is for beginners. Too many choices often force decision fatigue, and I don’t want you to keep on deciding and not to start learning.

As you have read no single database solves every problem. So, I would recommend you to learn both SQL and NoSQL database (one at a time) according to your needs. to become an exceptional web developer.

You can check 15 days of Learning SQL at Hackerrank; it’s incredible 🙂

Once you get familiarized with both the database, it will be easy for you to choose the best one according to your requirements and build your projects.

Happy Learning! ?

Join the Community

The DevOps Awareness Program

Subscribe to the newsletter

Join 100+ cloud native ethusiasts

#wearep3r

Join the community Slack

Discuss all things Kubernetes, DevOps and Cloud Native

More stories from our blog

Linkerd: Looming on Service Meshes

Linkerd: Looming on Service Meshes

Microservices and service meshes have become a staple of the industry as companies realize the full potential of creating an independent architecture that allows for easier scale up, agile development, resilience and streamlined deployment. Many of these applications...

What’s new in Flux v0.17.0?

What’s new in Flux v0.17.0?

Flux2 came with its new update a while ago, and it is sheer exciting for the users because it brought a lot of new features. It also made a lot of new enhancements and updates. We will take a look at the entire catalogue in this article. So, without further a due,...

What’s new in Portainer v2.7.0 BE?

What’s new in Portainer v2.7.0 BE?

A few days ago, Portainer Business Edition came up with their new update. It is quite a massive update with many new features, bug fixes, enhancements and much more. In this article, we will see all of those in a nutshell. Let's start What is Portainer? Portainer is...

DVC (Git For Data): A Complete Intro

DVC (Git For Data): A Complete Intro

As a data scientist or ML engineer, have you ever faced the inconvenience of experimenting with the model? When we train the model, the model file is generated. Now, if you want to experiment with some different parameters or data, generally people rename the existing...

Recap of the Cloud Native Meetup Saar #3

Recap of the Cloud Native Meetup Saar #3

We are looking back on a very successful third edition of our Cloud Native Meetup Saar #3! Togetherer with our co-host anynines, we enjoyed a fun afternoon filled with great speakers, intriguing topics and thoughtful conversations! We welcomed a total of three...

Portainer Ambassador Series ft. Fabian Peter

Portainer Ambassador Series ft. Fabian Peter

Portainer arranged a fun and informative discussion through a one-hour special named “Ambassador Series” on 1st July 2021. It was pretty amazing to see Savannah Peterson as the host and two other guests. One is our very own CEO of p3r.one, Fabian Peter and the other...

What’s new in Longhorn v1.2.0?

What’s new in Longhorn v1.2.0?

Longhorn came with their new update. It is full of surprises. We will peel off one by one to see all the latest updates, features, bug fixes and much more. This one is a much-awaited update, and we will see all of it in a moment. So, without further a due, let's...

Kubernetes Stateful Friend: What’s more to etcd?

Kubernetes Stateful Friend: What’s more to etcd?

The Kubernetes control plane consists of various components, and one of such components is etcd. Anyone starting to learn k8s come across it and memorizes quickly that it’s a key-value pair for Kubernetes with persistence store. But, what’s more to it? Why do we need...

What’s New in Flux 1.24.0?

What’s New in Flux 1.24.0?

Flux 1.24 is out this month with couple of updates and Important notices. Let’s get around what are the updates in the new release. But, first, let’s do a quick intro on Flux. What is Flux? Flux is a tool that checks to see if the status of a cluster matches the git...

Event Driven Architecture Demystified (For Pros)

Event Driven Architecture Demystified (For Pros)

Event-Driven Architecture or EDA is talked about with pride inside any organization. But, through last few months, I have noticed a trend that the definition of EDA is not consistent across people and organizations. It’s vague. EDA is something where you have events...

Interested in what we do? Looking for help? Wanna talk about software strategy?