Posts by Muhammad Haroon
Author: Muhammad Haroon
Haroon .: Smart R2DBC Repositories for PostgreSQL Databases

Feed: Planet PostgreSQL. Continuing on from the Reactive Spring Boot application development blogs we authored and provided samples for in the last two blogs (part 1 and part 2), we will now move on and discuss how to design and deploy “intelligent” repositories for R2DBC project for PostgreSQL. The purpose of this post is to show you an amazing feature of R2DBC ORM for PostgreSQL database engines that translates your Java methods (using their signature) to PostgreSQL queries. These queries can perform all sort of actions: Applying the suitable WHERE clause in the queryTranslating the Java method parameters to SQL ... Read More
Haroon .: Building Reactive PostgreSQL Repositories for Spring Boot Applications – Part 2

Feed: Planet PostgreSQL. Continuing the discussion from Part 1, Java applications provide a modular interface to the PostgreSQL databases, regardless of how you access them; via a JDBC or R2DBC. R2DBC repositories provide a rapid prototyping support for development, since they are lightweight and provide just-enough wrapper to perform database queries. When you mix the R2DBC with PostgreSQL’s SQL constructs, you can provide a suitable data-access layer in a web application. In the previous post, we wrote the Java application that utilizes PostgreSQL database and R2DBC repositories to boot up a Spring Boot application. Our core focus was:To enable a ... Read More
Haroon .: Building Reactive PostgreSQL Repositories for Spring Boot Applications – Part 1

Feed: Planet PostgreSQL. Overview Developing a frontend for a database can be a challenging task, especially when there are multiple runtimes / frameworks available for the language of your choice. We have been dealing with Java and the Spring Boot framework and have showcased how to develop RESTful APIs, how to manage migrations etc. We dealt with the “go-to” Java development practices, with a thread-per-connection model of web applications. Spring Boot Reactive is a new model of development your database-frontends that supports non-blocking operations. When you are developing web apps that rely heavily on databases (such as PostgreSQL) or APIs ... Read More
Haroon .: Generating and Managing PostgreSQL Database Migrations(Upgrades) with Spring Boot JPA

Feed: Planet PostgreSQL. If you are building a Spring Boot application for your next project, you would also be preparing and planning for the PostgreSQL database to store the data generated by your customers. In some previous posts on the topic of RESTful services in Spring Boot, we discussed how we can use JPA to automatically create and automatically apply the schema to the PostgreSQL database. In this post, we will see why letting Hibernate control the schema changes is not best approach, and how to manage the schema, apply it to PostgreSQL database, synchronize your Java objects and PostgreSQL database ... Read More
Haroon .: Bulk transactions with RESTful CRUD API using PostgreSQL and Spring Boot
Feed: Planet PostgreSQL. A typical database-oriented application setup only must work with single operation SQL or RESTful execution. Your customers might only be sending the INSERT or UPDATE queries one at a time. We have covered this approach in part 2 for our series and have created a simple RESTful API that allows users to perform CRUD operations on a PostgreSQL database. More advanced and high-velocity solutions require an efficient solution that can handle thousands of database operations per second, per client. Bulk or batch operations make sense when you are handling loads of data from a single origin—say, IoT or ... Read More
Haroon .: RESTful CRUD API using PostgreSQL and Spring Boot – Part 2
Feed: Planet PostgreSQL. This article is an extended version atop of the previous article which was a kickstart for building an application using Spring Boot and PostgreSQL. There is no internal feature supported by Java which offers mapping between class objects and database tables; therefore, we use Object Relational Model (ORM). JPA is an abstraction above JDBC and works as an ORM to map Java Objects with the entities in database using metadata. Querying database for all the user operations is another task of JPA for which it uses the concept of “repository”. Consequently, with JPA the development of your ... Read More
Haroon .: RESTful CRUD API using PostgreSQL and Spring Boot – Part one

Feed: Planet PostgreSQL. Spring Boot is a framework that is used to build stand-alone Java applications following the Spring framework but with less hassle and minimal configuration. Learning by practical examples is always great; therefore, this article will walk you through the creation of a RESTful CRUD (create-read-update-delete) application using Spring Boot and its connectivity with PostgreSQL. Though Spring Boot presents a complete application development framework with backend as well as the front-end, the greater emphasis in this article will be on a RESTful API, database connectivity and its injection and integration with other components in the application. Pre-requisites In ... Read More
Haroon .: PostgreSQL: Regular expressions and pattern matching
Feed: Planet PostgreSQL. A regular expression is a special text string used to describe a search pattern. PostgreSQL’s regular expressions supports three separate approaches to pattern matching:POSIX-style regular expressions (BREs and EREs) SIMILAR TO operator added in SQL:1999 SQL LIKE operator There are some more advanced techniques for advanced pattern matching requirements but those will very likely involve writing some user defined functions using Perl or Tcl. POSIX regular expressions provide a more powerful means for pattern matching than the LIKE and SIMILAR TO operators. This post is first in the series of blogs I plan to write on the ... Read More
Haroon .: PostgreSQL for IoT Data Retention and Archiving
Feed: Planet PostgreSQL. We do understand that IoT revolution is resulting in enormous amounts of data. With brisk data growth where data is mostly time series append-only, relational databases and DBAs have a rather tough task to store, maintain, archive and in some cases get rid of the old data in an efficient manner. In my previous posts, I talked about various strategies and techniques around better scalability for data storage using PostgreSQL and Postgres-BDR extension. Data retention is becoming ever so important. So let’s see what PostgreSQL 10 and above have to offer to efficiently manage your data retention ... Read More
Haroon .: PostgreSQL and IoT Data Localization, Integration, and Write Scalability

Feed: Planet PostgreSQL. In my previous post we looked at various partitioning techniques in PostgreSQL for efficient IoT data management. We do understand that the basic objective behind time based partitions is to achieve better performance, especially in IoT environments, where active data is usually the most recent data. New data is usually append only and it can grow pretty quickly depending on the frequency of the data points. Some might argue on why to have multiple write nodes (as would be inherently needed in a BDR cluster) when a single node can effectively handle incoming IoT data utilizing features ... Read More
Recent Comments