Docker - Docker Compose

Docker-compose is a tool that helps us define and run multiple services together. We declare the services and their attributes in a configuration file and the docker-compose tool reads it and issues the command to docker CLI in order to start and run the services. It helps us abstract all the creation of different components, building or pulling images etc… To run multiple services for a project. Once a compose-file is declared, we can run everything all at once with a single run command, we can also manage them via the docker-compose interface. ...

Docker - Building an image

Docker images are built from a Dockerfile, which is a blueprint for how to prepare a ready-to-run image. We can relate it to steps we perform in a computer to get something installed and running. We can start with a base image that corresponds to an OS (like ubuntu, alpine, Debian etc…) or we can even start from essentials installed in an OS. Basic steps are Start from the base image Run commands Specify default run command Here’s a basic example from nodejs ...

Docker - Overview

Docker is a platform that provides lightweight isolated runtimes for software. It helps us to package the software and its dependencies in a ready to run format. We can say its sort of works like VMs except, docker uses the kernel of our base OS. This is achieved by few techniques done with docker, File system snapshot - Dockerfile is used to build a filesystem snapshot that contains all the required files to run the software. Namespacing - Docker isolates the resources for the running processes using the Namespacing feature. It is a linux feature which partitions resources and control access between processes on resources. Control groups - The volume of resources used by a process can also be limited by docker. It is achieved by cgroups features which is another linux feature that helps define resource limits for a process. Why use Docker? As docker enables packaging and running software in a lightweight way, It solves the problem of setting up and configuring an environment to run the software. ...

DBMS - Indexing data

Indexing data in DBMS Indexing in the database can be similar to an index in front of a book that shows the title and its page number, DB stores these in B-Tree or LSM Tree structures to search through them as fast as possible. Indexing improves the data lookup speed but not always. An index is the fastest when it requires lesser random disk access. We know that the data is stored on disk and therefore, Fragmentation of data is more important in performance. If the required data is scattered in different sections of a disk, it will be slower. ...

DBMS - Persistence

Database data storage on disk Database persists information on disk in different forms like flat files, ISAM, heap files etc.. Depending on the Database Engine. In a common scenario, we store some information typed into a text editor by clicking save and choosing a location. Similarly, database saves our data into a configured location, mostly in a bit complicated structure than a text file. Database engines will structure the data and files in different ways to be able to retrieve them faster. ...

Managing tasks

Managing tasks Managing something can primarily involve Analysis and Decision making, mostly for getting things done for achieving something. Everyone derives their own steps to reach goals, There are no fixed steps to achieve something. Good management will help us get things done with minimal effort or cost. In simple terms, good management is to find the shortest and precise answer to the question. How can I do this task? ...

Learning something new

Learning something new Learning is a process that improves ourselves in something, we learn to use the knowledge to achieve something. The achievement can be productive or non-productive… We learn programming to be able to make software We learn trends and meme formats in social media to entertain ourselves and keep up with the society We learn the sport to be good at the game probably entertainment. Learning something new can always be difficult especially for people with procrastination habits, but everyone can achieve things by following some steps. ...

Authentication in Software Systems

Authentication in Software Systems As we know that, the concept of Authentication is simply identifying an entity (user). So, in a software system how do we manage the process? There are mainly two strategies and their combination when it comes to authentication Username and Password (Knowledge-based strategy) Passwordless (OTP, Login URL) (Possession-based strategy) Multi-factor (Combination of both, has to provide a password and also OTP) Authentication can be simplified into 4 parts ...

Introduction to Auth

Authentication and Authorization Authentication and Authorization is the identification and access control of a user within a service. It is a way to provide security and privacy to users. 1. Authentication Authentication is the process of validating or identifying a user. Example: We keep an ID card to identify ourself as member of a company and as proof, A security will identify us using that ID card (this identification process is authentication). ...

DBMS - ACID Properties

ACID Properties in DBMS The concept of transaction enables the correctness of data in a database, it is achieved by maintaining ACID properties. 1. Atomicity Atomicity is the assurance of DBMS that a transaction will always be either done or not done. Duh… But wait, there are situations where the transactions won’t reach the COMMIT / ROLLBACK, Database program crashes Your OS crashes Computer got restarted etc… In these conditions, the Database ensures that the existing data is not at all affected. This is something RDBMS like Postgres gives us by default, we don’t need to specify anything by means of code. ...