Best of DatabaseNovember 2024

  1. 1
    Article
    Avatar of dailydevworlddaily.dev World·2y

    We made daily.dev faster ⚡️ See how we did it

    Over the last two weeks, daily.dev optimized its performance, focusing on improvements for low-end mobile devices, upgrading infrastructure with newer CPUs and spot nodes, and refining content pipelines and ML models. Enhancements included reducing JavaScript bundle sizes, optimizing image loading, and reducing fields in feed requests. These changes resulted in up to 50% faster page load times, especially on mobile devices.

  2. 2
    Article
    Avatar of communityCommunity Picks·2y

    7+ Free PostgreSQL Hosting Platforms for Developers in 2024

    Several cloud providers offer free tiers for PostgreSQL hosting, ideal for developers working on small projects, personal experiments, or startup MVPs. Notable platforms include Neon, Supabase, EdgeDB, Xata, Tembo, Vercel Postgres, Koyeb, Aiven, and Nhost. These options provide scalable, fully managed databases with features like autoscaling, database branching, and integrated authentication, allowing developers to focus on development without worrying about infrastructure costs.

  3. 3
    Article
    Avatar of platformaticPlatformatic·2y

    Building a Reliable Node.js Application

    Ensuring stable uptime and handling traffic spikes in a Node.js application requires understanding user behavior and having robust monitoring in place. Emphasize stability by making your application predictable and minimizing errors. Monitor failure rates closely, understand data access patterns, manage query complexity effectively, ensure proper indexing, and pool database connections to maintain consistent performance. These practices help in building a stable and reliable Node.js application.

  4. 4
    Article
    Avatar of communityCommunity Picks·1y

    How Distributed Systems Avoid Race Conditions using Pessimistic Locking

    Pessimistic locking is used in distributed systems to prevent race conditions by ensuring that only one process can access shared data at a time. This involves using a cluster-wide lock database to manage locks and employing leases to release locks if a node fails. Fence tokens further ensure that stale updates are prevented by rejecting writes from nodes with out-of-date tokens.

  5. 5
    Article
    Avatar of communityCommunity Picks·2y

    PostgreSQL Performance Optimization Techniques Quiz

    Test your skills and enhance your knowledge of PostgreSQL performance tuning through this quiz. It covers crucial topics like optimizing queries, selecting appropriate indexing strategies, configuring parameters, and improving efficiency for high-performance workloads. Suitable for both aspiring database specialists and experienced DBAs.

  6. 6
    Article
    Avatar of systemdesigncodexSystem Design Codex·2y

    The Journey of a SQL Query Through a Database

    An SQL query undergoes several steps through a database before returning results. Starting with the Transport Subsystem for authentication, it moves to the Query Processor for parsing and optimization. The Execution Engine then executes the query plan by coordinating with the Storage Engine, which manages data consistency, locking, buffering, and recovery.

  7. 7
    Article
    Avatar of awegoAwesome Go·2y

    fmt.Sprintf vs String Concat

    String concatenation in Go is significantly faster than using fmt.Sprintf for formatting, particularly in performance-critical applications such as local server queries. This post explains the performance benefits with benchmarks, discusses how fmt.Sprintf works internally, and explores why string concatenation is more efficient. The author suggests opting for string concatenation in performance-sensitive paths to achieve noticeable improvements.

  8. 8
    Article
    Avatar of detlifeData Engineer Things·2y

    I spent 8 hours learning the ClickHouse MergeTree Table Engine

    The post provides an in-depth exploration of the ClickHouse MergeTree table engine, covering its data organization, write/read processes, merging and mutation mechanisms, and data replication methods. Key concepts such as wide and compact formats for column storage, primary and mark files, and idempotent inserts are discussed. The author explains how rows are inserted and managed within the MergeTree engine, including the handling of background merges to optimize performance. Additionally, the post addresses how data replication is utilized for high availability and increased read throughput.

  9. 9
    Video
    Avatar of communityCommunity Picks·1y

    Implementing the Transactional Outbox Pattern from Scratch

    The post discusses the implementation of the transactional outbox pattern, demonstrating how to reliably update the database and publish messages to a queue using an orders API and a shipping API. It explains potential issues with traditional methods where a transaction could leave the system in an inconsistent state. The outbox pattern is proposed as a solution, which involves persisting messages in the database as part of the same transaction and processing them later. The post thoroughly explains how to set up and implement this pattern, highlighting key considerations and potential improvements for reliability.

  10. 10
    Article
    Avatar of supabaseSupabase·2y

    Executing Dynamic JavaScript Code on Supabase with Edge Functions

    Supabase allows developers to execute dynamic JavaScript code in Edge Functions, enhancing flexibility and reducing the need for redeployments. Edge Functions execute at the edge for faster response times. Users can modify and run JavaScript code on the fly, supported by SQL scripts and helper functions like `edge.http_request`, `edge_wrapper`, and `edge.get_secret`. This setup increases the versatility of applications, enabling tasks like generating embeddings or creating users via the admin API.

  11. 11
    Article
    Avatar of detlifeData Engineer Things·2y

    I spent 3 hours learning the overview of ClickHouse

    ClickHouse is a high-performance, column-oriented SQL OLAP system developed initially for Yandex Metrica. It supports high ingestion rates, low-latency queries, and is adaptable for various data architectures. The system's architecture includes a query processing layer with vectorized execution, a storage layer with diverse table engines, and an integration layer for extensive external connectivity. ClickHouse uses sharding and replication to handle large-scale data efficiently.

  12. 12
    Article
    Avatar of selfhstselfh.st·2y

    This Week in Self-Hosted (15 November 2024)

    A roundup of the latest updates and news in self-hosted software from November 15, 2024, including new releases and notable changes. Highlights include updates to Baserow, ByteStash, ChartDB, Formbricks, Hoarder, Immich Kiosk, Linkwarden, Listmonk, lldap, Mealie, NocoDB, Ryot, Swetrix, ToolJet, and 'What's Up Docker?'. Additionally, PostgreSQL 12 has reached end of life, requiring migrations for users. New software releases and a spotlight on self-hosted tools and applications are also featured.

  13. 13
    Article
    Avatar of mercariMercari Engineering·2y

    Designing a Zero Downtime Migration Solution with Strong Data Consistency – Part V

    This post details the final steps in designing a zero downtime migration solution with a focus on architecture transitions, rollback plans, and the overall migration process. It covers development tasks, such as updating batch applications, accounting code processing, historical data handling, and modifying queries for BigQuery. The importance of monitoring mutation counts in Cloud Spanner is also addressed, along with a summary of key takeaways and future work.

  14. 14
    Article
    Avatar of communityCommunity Picks·2y

    Prisma + Postgres

    This guide provides step-by-step instructions on how to set up Prisma with Postgres using Supabase. It covers prerequisites, setting up a new Supabase project, configuring Prisma in a Node.js project, defining data models, and using Prisma Client to interact with the database. The tutorial uses real-world examples involving books and authors to illustrate the process.

  15. 15
    Video
    Avatar of nickchapsasNick Chapsas·1y

    The Fix For Your Database Performance Issues in .NET

    Nick demonstrates a method to enhance database performance in .NET applications using the Delta package. The solution involves adding a new 'Row Vision' column to the database, enabling efficient caching via ETags and the 304 mechanism, significantly reducing slow query times. The Delta package seamlessly integrates with existing APIs and supports heavy read scenarios, offering customization through open-source features.

  16. 16
    Article
    Avatar of redislabsRedis·2y

    JSON and search support in Go

    The go-redis client library now supports advanced data modeling features including secondary indexing, JSON documents, and enhanced search capabilities. These additions bring the library closer to the full capabilities of Redis Community Edition, Redis Software, and Redis Cloud. Users can explore advanced examples like JSON document creation, selective reading and writing, as well as sophisticated search functions including vector search for AI applications.

  17. 17
    Article
    Avatar of devtoDEV·2y

    AI-Driven Content Retrieval with PostgreSQL, Ollama and Open-Source models

    The platform utilizes advanced semantic search algorithms such as Ollama LLM, Langchain, and LangGraph to analyze and retrieve relevant data from various content types, including images, YouTube links, and PDF files. It performs a semantic search using pgvector, summarizes video metadata through the YouTube API, and generates images using the Stable Diffusion algorithm. The system stores generated images securely and maintains chat history, enhancing user experience with robust, multimedia processing and seamless interaction continuity.

  18. 18
    Article
    Avatar of hnHacker News·2y

    BemiHQ/BemiDB: Postgres read replica optimized for analytics

    BemiDB is a Postgres read replica optimized for analytics, featuring a single binary that replicates data in a compressed columnar format. It boasts up to 2000x faster query performance than Postgres, supports seamless integration with Postgres-compatible tools, and stores data either locally or on S3. BemiDB utilizes the DuckDB query engine and the Iceberg table format for efficient data handling and is available as an open-source project under the AGPL-3.0 License.

  19. 19
    Article
    Avatar of crunchydataCrunchy Data·2y

    8 Steps in Writing Analytical SQL Queries

    Writing complex SQL queries involves starting with simple queries and progressively adding complexity while verifying accuracy at each step. Key steps include defining desired data, investigating and sampling data, confirming simplicity, adding joins cautiously, performing summations, and rigorously debugging. SQL's power lies in its ability to utilize simple, standardized logic blocks to extract accurate data from complex structures.

  20. 20
    Video
    Avatar of nickchapsasNick Chapsas·1y

    When You Shouldn't Use Await Async in .NET

    The post discusses scenarios where synchronous methods can outperform asynchronous ones in .NET, particularly with large datasets and very long strings in Entity Framework Core. A demonstration using a Docker-hosted SQL Server shows the sync version running faster and using less memory than the async version. A profiling tool, Ultra, is used to analyze and visualize the performance. Although a specific bug impacts async performance in some cases, async methods generally scale better and should typically be preferred for their non-blocking nature.

  21. 21
    Article
    Avatar of duckdbDuckDB·1y

    DuckDB Tricks – Part 3

    This blog post delves into various advanced features and performance optimization techniques for DuckDB, particularly focusing on convenient methods for handling table operations and improving the processing speed of Parquet and CSV files. It includes practical examples using the Dutch railway services dataset, demonstrating column renaming with pattern matching, data loading with globbing, reordering Parquet files, and employing Hive partitioning to speed up queries significantly.

  22. 22
    Article
    Avatar of singlestoreSingleStore·1y

    Mastering MongoDB Array: Efficient Queries and Filtering Techniques

    Queries involving arrays in MongoDB can be complex but efficient with the right techniques. This guide covers methods such as dot notation, $elemMatch, and $all for querying arrays. It also dives into indexing, using efficient operators, and optimizing query performance. Advanced methods using the aggregation framework are discussed, including $unwind and $slice operators. Additionally, SingleStore Kai is introduced as a tool for significantly improving array query performance through features like enhanced indexing and SQL integration.

  23. 23
    Video
    Avatar of communityCommunity Picks·2y

    SQLite vs PostgreSQL

    The post compares SQLite and PostgreSQL regarding their performance in various operations such as inserts, updates, deletes, and joins. It highlights the differences in architecture, with PostgreSQL being a traditional client-server database and SQLite functioning as a library integrated into the application. Tests are conducted to measure latency, throughput, CPU usage, and disk write operations, emphasizing how network interactions impact PostgreSQL's performance compared to SQLite's local file interactions.

  24. 24
    Article
    Avatar of collectionsCollections·1y

    How LinkedIn Scaled Their System to 5 Million Queries Per Second

    LinkedIn scaled their Restrictions and Enforcement System to handle 5 million queries per second by using advanced techniques such as BitSets, Bloom Filters, and full refresh-ahead caching strategies. The architecture includes components like the Venice Database and Kafka for real-time data streaming, ensuring high availability, low latency, and efficient memory usage.

  25. 25
    Article
    Avatar of communityCommunity Picks·1y

    Support for many missing PostgreSQL specific features

    The tpetry/laravel-postgresql-enhanced package significantly extends Laravel's support for PostgreSQL features, adding capabilities such as zero-downtime migrations, advanced indexing options, and various PostgreSQL-specific data types and functions. This extension addresses the limitations of Laravel's default database abstraction by leveraging PostgreSQL's full functionality, including enhanced query capabilities and schema management tools.