r/Database 1h ago

MariaDB plugins beyond C++: Python and Rust lead our poll, but should we look at WebAssembly?

Thumbnail
Upvotes

r/Database 1d ago

When does database complexity become a bigger problem than database performance?

16 Upvotes

I’ve noticed that database discussions often focus heavily on performance—indexes, query plans, partitioning, caching, etc. But there seems to be a point where adding more optimization techniques makes the system harder to understand and maintain.

For example, a relatively simple schema with slightly slower queries might be easier to operate than a highly optimized design with multiple layers of caching, indexes, partitions, and materialized data.

I’m starting to think that predictability and maintainability should be treated as performance requirements too, especially for smaller systems.

Curious to hear how others have seen this trade-off play out in production.


r/Database 18h ago

The tenth correct AI-generated query is when people stop checking the eleventh

0 Upvotes

Noticed this pattern reviewing how people actually use AI tools for writing transformation queries. First few outputs get checked carefully, run against a sample, compared to expected results. After enough of those come back correct, the checking quietly stops. Not a decision anyone makes on purpose, it just fades, because checking something that's been right nine times in a row feels like wasted effort in the moment.

The problem is that correctness on the first nine doesn't predict correctness on the tenth. Nothing about the model improved or built trust in a way that actually reduces its error rate on the next query, it's still working from the same context window, same limitations, same chance of misreading an edge case in the schema. What changed is the human's willingness to look, not the model's actual reliability.

This shows up worse on queries that produce plausible wrong numbers instead of obvious failures. A query that returns zero rows gets noticed immediately. A query that silently double-counts something due to a join issue produces a number that looks completely reasonable, and by the point someone's stopped spot-checking, that's exactly the kind of error that gets through.

Don't have a clean fix for this beyond forcing some kind of check that doesn't rely on remembering to be suspicious, a fixed row-count sanity check that runs regardless of how many previous queries were correct, something that doesn't degrade as trust builds the way manual vigilance does.


r/Database 1d ago

Database schema changes guide for : PostgreSQL, MySql / MariaDB, Oracle, SQL Server.

Thumbnail
stackrender.io
2 Upvotes

Hey Engineers

We've all been through this. When the project you're working on starts scaling, you'll find the need to scale your database too, adding new columns, creating new tables, or trying to improve performance by adding new indexes. All of this comes with the risk of losing your users' data.

For this, I crafted a simple guide showing the schema change operations that you'll need on a day-to-day development basis for PostgreSQL, MySQL, MariaDB, Oracle, and SQL Server.

It also covers some additional potential risks you need to keep in mind when performing schema changes on a production database.

Hopefully, it can help you along your database learning journey.

Good luck!


r/Database 2d ago

We benchmarked CtrlB against ClickHouse on ClickBench and on 5 TB of logs

3 Upvotes

Most infra teams run one system for dashboards and a second one for log search because one engine is never good at both. That never felt right to us, so we set out to build a unified platform that could offer the fastest search possible on large volumes of logs, traces and metrics.

We put our results up on the ClickBench leaderboard. The process was easy and we were curious how we compared to ClickHouse.

In analytical search, across all 43 standard queries on a 100 million row unpartitioned web analytics dataset, CtrlB scored ×1.43 and took the #1 spot on the single node Parquet leaderboard, ahead of DuckDB (×1.49), DataFusion (×1.71) and ClickHouse itself (×1.72).

But ClickBench is an analytics benchmark. It tells you nothing about finding one trace id in a haystack, so we ran the other half ourselves: 8 lookups and substring matches over 5 TB of raw logs against ClickHouse v26.2, cold cache, plain SQL with a LIMIT 100. CtrlB was faster on all eight, from 2.2× on the double substring query to 98.9× on the span_id lookup.

Full methodology, per query numbers and the public leaderboard links: https://ctrlb.ai/blogs/ctrlb-vs-clickhouse

https://benchmark.clickhouse.com/#system=+Hoaus|Ctul|Dfs|Dusas|oius|ucqs|Gs|vre|m%20i|PB%20|etrs|Sr%20%20Ps|nfe|w%20en|SIt|iSs|akqg|Tuts&type=-&machine=+ca2&cluster_size=-&opensource=-&hardware=+c&tuned=+n&metric=combined&queries=-

TLDR: we topped ClickHouse’s own analytical benchmark at ×1.43 and in a separate full-text search test over 5 TB of logs we were faster on every query.

Disclosure: I work at CtrlB.


r/Database 3d ago

Recommendations for light use, good UI?

6 Upvotes

I've searched the sub, but I haven't been able to find information for my use case. I appreciate any suggestions for how to proceed!

Situation: I have a table in Google sheets with several hundred entries. Each line is an information source, with dates, tags, categories, links, description, etc... I use this for teaching. Students can search or sort by tag, topic to find sources relevant to a homework assignment or a project.

It's getting a bit big to be a table. Some students struggle a bit with the spreadsheet learning curve. Others can't find items by keywords, partially because I have mostly ESL students.

Then, there's the issue with sharing. If I share with view or comment access, the viewer cannot modify the sort or filters. This also means that if I'm using it and forget to clear the filters, the students only see what I've filtered. Giving write access isn't an option for obvious reasons. Last semester, I shared the view access and told them to download or save their own copy. This had to happen a few times, as I added information sources during the course.

Request: I have zero budget, but access to Microsoft products. I'm considering using Access and making it more of a database. I can also control sharing through onedrive. Is there a way to create a database and share through onedrive so that the students can see, filter, or explore, without being able to change any database information? Essentially, onedrive would need to act as my server (no other server options and no budget).

(I'm currently annoyed at Google's approach to education tools, so I would rather avoid the Google suite if possible.)

Other suggestions or possible approaches are welcome. Thanks!


r/Database 4d ago

LOW STORAGEEE

2 Upvotes

i have mysql workbench & have been practicing it on my own. the problem i've run into is low disk storage. i currently have 4.5 gb on my c drive, which i don't think is a lot. i don't have a lot of applications installed, so removing or moving them to another disk isn't an option. neither is spending money on storage 💔

im worried about the rest of my learning journey. i know i'll eventually have to install other programs/tools & it makes me sad that low storage space is what might hold me back from learning something im genuinely interested in.

i wanted to ask if there are online versions of these softwares available? im talking about python, tableau & all other stuff i'll need later on. i've used an online c++ compiler before, so im wondering if it's possible for other tools too. and if so, can they save all my previous data? what about something with an account where it syncs data to a cloud? HALP


r/Database 5d ago

Tool for exploring the Postgres wire protocol

Thumbnail pgwire-explorer.dhuk.net
3 Upvotes

r/Database 5d ago

Traced PostgreSQL 18's io_uring with eBPF

Thumbnail
2 Upvotes

r/Database 6d ago

Coding a database proxy for fun

Thumbnail
packagemain.tech
2 Upvotes

r/Database 5d ago

Data migration from AWS to google drive advise plzzzzz

0 Upvotes

I'm an IT intern in a US startup mi task is to migrate the DB (actually stored in Amazon RDS postgres) to google drive (like backup due to the billing in the aws around 9k ! ) the problem is the size (around 400 GB) so I think the pg_dump to generate the script is not a solution for my case

Is there any solution ! And how I can verify the integrity ? ( Hashing a file with 200 gb size is crazy !!!)

Can we divide the generated the script in a small chunks ??? Without losing the relations between tables and the constraints ?


r/Database 6d ago

What evidence do you require before dropping an apparently unused database index?

1 Upvotes

Index-usage counters can miss seasonal reports, failover periods, infrequent maintenance jobs, and queries that only run during a monthly or quarterly close. Keeping every index increases write cost and maintenance overhead, but dropping one based on a short observation window can create a delayed performance incident. What evidence makes an index safe to remove? I would expect query-plan and workload review, a representative observation period, dependency checks, a rollback script, and monitoring after the change. How do you handle redundant or overlapping indexes where the replacement is similar but not identical?


r/Database 6d ago

Looking for MySQL GUI Software

0 Upvotes

That can:
- Copy to Database to Different Host/Database

- Copy "Create table" Query

Currently im using SQLyog, 13.1.1 looking for free MySQL GUI software that have similar feature, because im planning to upgrade my current MySQL to version 9, which is not supported with my current SQLyog version


r/Database 6d ago

Is my facet based Database for media metadata structured correctly?

Thumbnail
0 Upvotes

r/Database 6d ago

DBMS CMU

2 Upvotes

Anyone interested in doing the CMU (Carnegie Mellon University) Database Management Systems course together?

I’ve already covered the basic DBMS concepts. My main goal with this course is to go deeper and understand how database systems actually work internally—things like storage, indexing, query execution, transactions, etc.

If you're interested, please make sure you have the prerequisites required for the course.

If you have the required background and want to learn DBMS internals seriously, DM me. We can follow the course together and discuss concepts along the way.


r/Database 8d ago

How do you decide when a database query needs optimization vs. a schema change?

37 Upvotes

I've been working with SQL and database performance, and one thing I find interesting is knowing when to stop tuning the query itself.

For example, if a query is slow because of a missing index, that's fairly straightforward. But at larger data volumes, you can reach a point where adding indexes and rewriting the query only gets you so far.

How do you usually decide that the problem is actually the database design/schema rather than the query?

Things like partitioning, normalization/denormalization, materialized views, indexing strategy, or even changing how the data is stored.

Would be interested to hear how people make that call in real-world systems.


r/Database 8d ago

4 silent data leaks you will accidentally build when moving your SaaS to Postgres Row-Level Security (RLS)

Thumbnail
1 Upvotes

r/Database 8d ago

I was thinking to improve MySQL as it had a lot of room for improvements. I need you guys to comment and share all your thoughts too.

0 Upvotes

I've been working on something I think is interesting, that hasn't been done before in the Node.js/TypeScript ecosystem, and I wanted to share the idea and get your thoughts.

The Idea: BeatSQL - A Zero-Trust Embedded Database Engine

The concept of BeatSQL (BSQL) is simple, but radical: what if your database encrypted data at the column level by default, and took security to a mathematical level?

Embedded databases like SQLite and LevelDB are not designed with encryption as a core primitive — they store data in plaintext on disk by default. While some provide full disk encryption, this is a false sense of security since the data is still plaintext in memory. However, BeatSQL completely reimagines this paradigm.

How It Works

All sensitive columns are individually encrypted using AES-256-GCM or ChaCha20-Poly1305. You will never see plaintext on disk (even the database file) - the value of any column is always encrypted.

You can search encrypted data using HMAC-SHA256 blind indexes. Searching is O(1) and requires no decryption of the column contents. The contents of the column remain encrypted on disk, and the database never decrypts it to search.

Every write operation is mathematically tamper-proof. Using a Merkle DAG hash chain, you can always run the query `VERIFY INTEGRITY` and know immediately if any bytes of your data have been silently altered or corrupted on disk. This is a cryptographically secure proof of data integrity.

You can do arithmetic on encrypted numbers. Using Partially Homomorphic Encryption (Paillier cryptosystem), yyou can perform calculations like total salary, total balance, etc. The database will return the correct result of these calculations, but will never expose individual salaries or account balances.

Columns can have role-aware data masking. Sensitive columns can be fully or partially "redacted" depending on the role of the actor querying the database. The mask happens at a low-level query engine, not in application code. You can define masks using SQL syntax: `DEVELOPER` role sees `XXX-XX-4321`, `PUBLIC` role sees `[REDACTED]`, and `SUPERADMIN` role sees the real value.

The database has native support for AI vector search. Columns can be defined as `VECTOR(768)` and searched against using `COSINE_SIMILARITY`. This is useful for AI applications using embeddings.

A New Query Paradigm

BeatSQL also has a new query syntax to allow for easier stream.pipeline processing:

FROM patients
|> WHERE email = 'alice@example.com'
|> SELECT id, full_name, ssn, salary
|> ORDER BY full_name ASC;

This is designed to be more approachable than deeply nested SQL queries. It's also quite flexible.

Built-In Learning Academy

BSQL also has a built-in interactive learning academy, with 500+ lessons to learn everything from basic queries to zero-trust encryption enclaves, plus 200+ lessons covering traditional relational SQL and guides for working with Python, Java, C++, and Rust. The goal is to make security-first database thinking easy to grasp.

What I Would Like Your Thoughts On

Is the concept of a zero-trust embedded DB something that you feel is interesting, or would you feel that problems are already solved in other ways?

The blind indexes are a trade-off: you get the ability to search encrypted data, but you give up the ability to perform range queries (>, <, LIKE, etc). Is this trade-off reasonable for a security-focused database?

Is the idea of homomorphic encryption in a database engine a gimmick, or do you see real-world applications for it?

Does the pipe syntax feel cleaner, or like a departure from an established standard?

I look forward to seeing your thoughts, and any criticisms you might have.

TLDR: Built an embedded database engine where all columns are encrypted, data can be searched without decryption, and arithmetic can be performed on encrypted numbers. All writes are Merkle-verified for integrity. Came with a built-in 500+ lesson learning academy. Seeking feedback on concept.

----------------------------------------------------------------------------------------------------------------------------

To summarize BeatSQL (BSQL).
It is intended to be a zero-trust embedded database for the Node.js/TypeScript ecosystem which prioritizes security,
The main ideas are,
-Column-level encryption by default, with AES-256-GCM or ChaCha20-Poly1305, including on-disk encryption.
-Encrypted searching with HMAC-SHA256 blind indexes, which permit exact matches but not range queries or LIKE searches.
-Tamper detection with a Merkle DAG/hash chain which lets you perform VERIFY INTEGRITY checks on arbitrary entries to ensure they haven't been modified or corrupted.
-Encrypted arithmetic via Partially Homomorphic Encryption which lets you perform operations like summation without ever decrypting any values.
-Role-based masking of columns which can expose different levels of redaction, depending on who is querying the database.
-Vector search support, including cosine-similarity queries on columns with vectors, for AI/embedding use cases.


r/Database 9d ago

Book recommendations for big refactorings?

8 Upvotes

At work I am working on a legacy CRM.

The issue is that the database is a mess. There are no foreign keys to form relationships etc. I was wondering if there are books that are specificly for refactoring databases?

The only one I found so far is actually called "Refactoring Databases". But I want to ask real people (not just gpt) what books are good to solve this problem? Do you have book recommendations on this topic that you found useful or which books you would avoid?


r/Database 9d ago

How are you structuring databases for nonprofits without creating duplicate records?

1 Upvotes

I'm helping a nonprofit clean up years of spreadsheets, and the biggest challenge has been keeping one record for each client while tracking multiple programs, referrals, and services over several years. Every solution looks good until you start thinking about reporting and long-term maintenance.

Curious how others have modeled this. Are you building everything from scratch, customizing a CRM, or using software that's already designed around this kind of data?

Edit:

We ended up going with Community CareLink software instead of building our own system. It already handled the relationships between clients, programs, referrals, and reporting, so we spent a lot less time maintaining the database and more time actually using the data.


r/Database 10d ago

Azure AI Search vs Manticore Search

Thumbnail
manticoresearch.com
1 Upvotes

A practical comparison of Azure AI Search and Manticore Search for hybrid full-text + vector search, focusing on chunk-level document workloads, relevance tuning, operational patterns, and cost.


r/Database 11d ago

Welcome!

Thumbnail
0 Upvotes

r/Database 11d ago

Data sovereignty and 3rd party

Thumbnail
0 Upvotes

Cross sharing this post because I am looking a solution to handle data sovereignty and offshore team with elevated privileges on database and source code - like myself working remotely on a different country.


r/Database 12d ago

Postgres table archival

Thumbnail
1 Upvotes

I want to archive postgres table


r/Database 12d ago

In memory database resources/suggestions

2 Upvotes

Looking for suggestions for which in memory database to learn.

I've looked briefly at singlestore, redis, mongodb, Cassandra, and memcached.

Which of these has value in the database admin market?

What are some companies/industries where these are used or make sense?

What has been your experience learning the skills for these? Ie; learning via the homepages for each? Moocs? Books?

My goal is to be a Jr dba. Please advise in that context.

Thank you.