Skip to main content

17 posts tagged with "database"

database tag description

View All Tags

Fix Firestore Error: A Document Must Have an Even Number of Path Elements

· 5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

If you are working with Firebase and suddenly see the error fatal: A document must have an even number of path elements, don't worry-you haven't broken your database. This is Firestore's way of telling you that you've gotten lost in the "Map" of your data.

In Firestore, there is one unbreakable rule: Collections and Documents must always alternate.

Python Barcode Processing: Export Data, Generate 2D Codes, and Database Integration

· 6 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation
  • tooling image: /img/blog/thumbnails/exporting-python-barcode-scan-data-csv-excel.png

Exporting your scan data is the final piece of the puzzle. While a database is great for storage, most team members prefer to see results in a spreadsheet.

In Python, the pandas library is the gold standard for this. It can read directly from your SQLite database and convert that data into a professional-looking Excel or CSV file in just a few lines of code.

Python Typeguard Performance Considerations for Database I/O Wrappers

· 6 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

When implementing runtime checks like Typeguard, the primary concern is the performance overhead it adds to production code, especially in high-throughput applications that rely on fast I/O operations (like database queries).

The short answer is: Typeguard adds a measurable execution overhead, but it is often negligible compared to the time spent on I/O (Database operations).

Here is a breakdown of the performance implications and when you should be concerned.

SQLAlchemy joinedload vs. join()

· 7 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

In SQLAlchemy, both the relationship loading option (.options(joinedload(...))) and the query builder method (.join(TableClass)) result in a SQL JOIN clause. However, they serve fundamentally different purposes and lead to distinct results in the ORM (Object Relational Mapper) layer.

Understanding this difference is crucial for avoiding the common "N+1 problem" and correctly shaping the data returned by your queries.

SQLAlchemy Relationships Without Database Foreign Keys

· 7 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

This pattern is often used for:

  1. Legacy Databases: Working with existing schemas that lack proper constraints.
  2. Performance: Avoiding the overhead of transactional foreign key checks.
  3. Data Warehousing: Dealing with schemas where relationships are semantic, not structural.

The key to achieving this is the relationship() function combined with the primaryjoin argument. This allows SQLAlchemy to define the join condition required for the relationship, enabling essential features like eager loading (joinedload, selectinload).

Supabase Pitfalls: Avoid These Common Mistakes for a Robust Backend

· 13 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Supabase Pitfalls: Avoid These Common Mistakes for a Robust Backend

Supabase offers a powerful open-source alternative to Firebase, built around PostgreSQL. Its ease of use makes it a favorite for rapid development, but this very convenience can lead developers down paths that introduce technical debt, performance bottlenecks, and security vulnerabilities. Understanding and avoiding these common pitfalls is crucial for building a robust and scalable application.

Vercel migrations

· 5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Vercel doesn't have a single, built-in migration system but instead relies on standard, database-specific tools. For relational databases like Vercel Postgres, you use traditional ORMs or migration libraries. For key-value stores like Vercel KV, migration is typically a manual process of data transformation.

Vercel Data Storage: Integration Guide and Storage Options Comparison

· 6 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Deploying application servers in a serverless environment like Vercel requires a shift in how we handle database connections. Traditional relational databases expect long-lived, persistent TCP connections. In a serverless or edge runtime, functions spin up on demand and shut down immediately after returning a response.

To prevent database connection exhaustion, Vercel leverages a specialized suite of serverless and edge-compatible storage services. This guide explains how database integration works on Vercel, details first-party storage options, and provides a decision matrix to help you choose the right tool for your project.

Use this Instead of SQlite on Vercel

· 5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Is SQLite Supported on Vercel?

No, SQLite is not officially supported by Vercel for production applications because of its reliance on the local filesystem. Vercel's serverless functions are stateless and run in a read-only environment, meaning any changes to the local filesystem are discarded after the function's execution. This makes it impossible to persist the SQLite database file between function invocations. Vercel source

While you might be able to get a read-only SQLite database to work by including the database file in your deployment bundle, any attempt to write to it will fail. This limitation makes SQLite unsuitable for most dynamic web applications on the Vercel platform.

Supabase Architecture: Integration, Portability, and Advanced Database Patterns

· 8 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Supabase is a popular open-source alternative to proprietary Backend-as-a-Service (BaaS) platforms like Firebase. By building on top of standard technologies-primarily PostgreSQL-Supabase provides the convenience of a managed platform without locking you into a proprietary ecosystem.

This guide provides an architectural overview of Supabase, detailing its database portability, connectivity options, server-side execution methods, scalability limits, enterprise compliance (HIPAA/GDPR), and advanced PostgreSQL patterns.