Tag: Database

  • Spring @Transactional is Not Magic: The Proxy Trap and Why Your Data Isn’t Safe

    Spring @Transactional is Not Magic: The Proxy Trap and Why Your Data Isn’t Safe

    **Most developers treat @Transactional like a magic wand, but it is actually a proxy-based abstraction that is remarkably easy to break.** If you do not understand Java AOP, you are likely creating “zombie data” and performance bottlenecks without even knowing it. This post deconstructs the **self-invocation trap**, the **rollback myth of checked exceptions**, and why…

  • Advantages and Disadvantages of Alembic

    Advantages and Disadvantages of Alembic

    In this article, I compare Alembic to other database migration tools like Flyway and Liquibase. Alembic excels in handling parallel migrations and enforcing rollback actions but lacks checksum validation, posing risks for schema consistency. While not perfect, it offers advantages, particularly for team development, using SQLAlchemy for ORM migrations.

  • SQLAlchemy and JSON values

    SQLAlchemy and JSON values

    Storing JSON in a relational database? Sounds like a contradiction, but sometimes, it’s the best solution. SQLAlchemy makes it easy to use a JSON column in Postgres—until you try to update a single value inside it. Turns out, SQLAlchemy doesn’t track those changes by default, leading to silent failures. The fix? Marking the column as…

  • GCP Cloud Functions with SQL Access

    GCP Cloud Functions with SQL Access

    I’ve created a Google Cloud Function for a weekly task to streamline backend dependencies but faced complications with database connectivity. GCP requires a proxy, which undermines the initial goal of simplicity. Ultimately, I’ve moving all back into an existing backend to save extra fees from having a proxy up and running.

  • Microservices Communications

    Microservices Communications

    Here is a list of the most used communictions protocols in microservices architecture. REST, a commonly used protocol, is simple and synchronous. SOAP uses XML and is often more verbose. RPC uses binary format, offering fast and compact communication. Messages or queues allow asynchronous communication, but require a message broker. Lastly, database communication uses a…

  • My Problems with Flyway

    My Problems with Flyway

    How I’ve created a framework to solve the most common problems with the Flyway migrations. I must first identify the problem from the log files. Then apply the solution depending on the problem. It can go from a simple changeset rollback to stop the production.

  • Stop Using Null on Database Rows

    Stop Using Null on Database Rows

    Stop Using Null on Database Rows. In this article I show why it’s a bad idea, what problem I’ve encountered and what is the solution I used.

  • The Hardest Bug I’ve Faced

    The Hardest Bug I’ve Faced

    In this article, I will describe some of the worst bugs that happen in an application. Let’s start by splitting them into two main categories: those which I can reproduce on my laptop, and those I can’t reproduce on my laptop.

  • PostgreSQL’s Deadlocks

    PostgreSQL’s Deadlocks

    Have you ever faced a database deadlocks in Postgres? In this article, I will tell a story about the deadlocks, A Journey Through PostgreSQL’s Conundrums.

  • Connect a Database to a Spring Boot Application

    Connect a Database to a Spring Boot Application

    In this article, I will connect my Spring Boot Application to a PostgreSQL database. Adding the dependencies, configuring the application and creating the entities and repositories.