Development notes

Thoughts, notes and ideas about development

How to run Spring Boot and MongoDB in Docker container

2016-12-11 5 min read Development Alexey Bogdanov
Introduction This tutorial describes how to run Spring Boot application and Mongo DB in Docker containers. For a demo purposes we’ll use the following project: spring-mongo-demo. All sources can be found on Github. Our goal is to run our Spring Boot application and MongoDB in its own containers. Some words about Demo project Demo project (spring-boot-demo) is very simple and does the following: it saves the users into Mongo DB. A new added user is displayed in the Users table on the bottom of the page: Requirements We need: Continue reading

How to install Docker on Ubuntu 16.04

2016-12-10 3 min read Development Alexey Bogdanov
Introduction Docker is software containerization platform which makes it easier to create, deploy, and run applications by using containers. It’s the most popular containerization platform in our days. More details about Docker could be found on Docker official web site or Wikipedia. This tutorial describes only how to install Docker on Ubuntu 16.04. Installation process on other distribution looks very similar but can have some differences. How to use Docker will be described into future tutorials. Continue reading

SQL Query explain plan and Optimization

2016-12-05 4 min read Development Alexey Bogdanov
Query optimization is determination by relational database the most efficient way to execute a given query by considering the possible query plans. Mostly query optimizer is used by databases for optimizing the query in the best possible way. User doesn’t work directly with query optimizer. But some queries can be optimized by exploring its execution plan. Prepare test data Before we dive into queries optimizations and explain plan, let’s prepare a table with test data. Continue reading

Indexes into Relational Databases

2016-11-29 7 min read Development Alexey Bogdanov
A database index is a data structure that improves the speed of data retrieval operations on a database table (increase database performance). But such performance has a cost of additional writes to hard drive and storage space to maintain the index data structure. In nutshell, index is a quick path to a single row into database. Indexes allow us to go directly to he required column without scanning the entire database table. Continue reading

How to start Ghost as a service on Ubuntu 16.04

2016-11-29 2 min read Blogging Linux Alexey Bogdanov
Official Ghost documentation Deploying Ghost describes how to start Ghost as a service using script for /etc/init.d. This approach work well only for Ubuntu prior version 16.04. In this tutorial I’ll describe how to start Ghost as a service using new systemd service manager. Requirements Ghost should be already installed. *How to install Ghost described here: How to install Ghost on Ubuntu 16.04. Ghost is installed in /var/www/ghost Create systemd script Open terminal as root (or sudo user). Continue reading

SQL Transactions and ACID

2016-11-27 6 min read Development Alexey Bogdanov
Transaction is a sequence of one or more SQL operations treated as a logical unit. Transaction could be completed either entirely successfully or not executed at all. Transactions and locking are important aspects of database for supporting multiple users. Into this tutorial we’ll take a look atTransaction, ACID, Isolation Levels. ACID Transaction must have the following properties called ACID, which means the following: Atomicity: means that transaction must happen as a single unit and exactly once. Continue reading

PostgreSQL functions

2016-11-23 4 min read Development Alexey Bogdanov
PostgreSQL has a lot of built-in functions, such as Trigonometric Functions, String Functions, IP address functions, etc. But we’re not limited by built-in functions. PostgreSQL (as well as other RDBMS) allows creating custom functions. In this tutorial we will take a look at user-defined functions. PostgreSQL supports the following programming languages for writing functions: SQL PL/pgSQL C PL/Python PL/Tcl some other languages Create functions with PL/pgSQL Functions written in PL/pgSQL can contain a variable declaration, conditional and looping constructions, exception handling and so on. Continue reading
Older posts Newer posts