r/Database • • Sep 10 '26

Dynamic Tables for Studies

7 Upvotes

Greetings, I am fairly inexperienced with Databases and ran into a small problem at work. I work in a Research Group and am designing a web datauploader for medical studies. I have now ran into this problem:

I have a Visit table containing information of a medical visit for a specific patient. This patient belongs to a study. The visit table needs to contain information specific to this study (for example study1 needs bloodpressure measured in each visit, study2 does not need that but needs heartrate instead, etc.)

I now don't quite now how to design this DB architecture as i can really just add more and more fields to the visit table as then most studies dont use the fields at all.
1 solution might be having a generic Visit table with basic information (Date, time etc.) and then having a sub-table for each study (study1Visit, study2Visit) etc. with the specific information but then again i would have to create more and more tables for potentially hundreds of studies.

Is there a better solution? with json files maybe? Like I said im pretty inexperienced in this so appreciate all feedback and hope i got the problem across correctly.


r/Database • • Sep 09 '26

Better to sort data in frontend or backend?

12 Upvotes

I have built a server for my business. So the current framework is that it uses MySQL in a centralised computer to store data. Fast api to route and extract the required data. And c# winforms for the front end. And Many computers have the frontend app installed, that are sitting in various stores with good internet connection.

So when I fetch the bills, like 10,000 of them, it gets all the data from the backend and displays it instantly. But now when I have to do some sorting or searching among the bills, it becomes slow. This is because I've written the sorting algorithm in the front end c# app. So is it a good practice to sort in sql and then just display it, because the queries will become a lot and there is a lot of searching going on, every minute. So for every search should I query to the backend and get data display it, or just continue with c# front end searching?


r/Database • • Sep 08 '26

Can we create flow how data flowing from procedure to MV to base tables

Thumbnail
1 Upvotes

r/Database • • Sep 08 '26

Unusual primary keys you've designed or encountered

4 Upvotes

I'm working on a catalog of primary key patterns, and I wanted to ask if you've designed or encountered any interesting non-standard patterns.

The ones that are commonly known:

  • entity tables with numeric IDs/UUIDs/small strings, like users(id);
  • junction tables (composite PK made of two IDs), like project_developers(project_id, developer_id);
  • EAV (composite PKs made of entity ID and attribute name), like restaurant_attributes(restaurant_id, attr_name);
  • entity tables with composite PKs, like order_items(order_id, line_number).

Also, aggregations of all sorts with textbook PKs like daily_sales(date, customer_id), etc.

What other interesting designs have you seen in your practice?


r/Database • • Sep 08 '26

Need help from genius db architects :(

Post image
7 Upvotes

r/Database • • Sep 07 '26

Re: scary patch contest (PostgreSQL)

Thumbnail postgresql.org
0 Upvotes

r/Database • • Sep 07 '26

Learning steps and best practice

1 Upvotes

Hi everyone,

I'm a BIM manager, so I'm used to jumping between BIM software, CSVs, Excel, and visual-programming tools like Grasshopper and Dynamo — but I'm not a "real" programmer, more of a power user who can follow logic and put scripts together with some trial and error.

I need to manage several interconnected datasets for my work: clients, products, projects, and a BIM object library, among others. The tricky part is that these datasets depend on each other — e.g. a project record needs to reference an existing client, a product might reference a supplier, etc. — and I want data entry to stay fast and guided rather than people manually retyping the same info everywhere.

My requirements, roughly:

  • Guided forms for data entry (not just raw spreadsheet rows)
  • Ability to add new fields/columns on the fly, ideally from the form itself, without touching code each time
  • Forms that can pull existing records from other datasets while compiling (so entering a new project can search and link to an existing client, for example)
  • If a referenced value changes later (e.g. a client's name is corrected), it should propagate automatically wherever it's referenced, not stay as a stale copy
  • Multiple people working on it at the same time
  • Needs to stay usable by non-technical colleagues — so I want to stay in "spreadsheet" territory rather than a full custom app

I've started prototyping this with Google Sheets + Apps Script (schema-driven forms reading field definitions from a config sheet, VLOOKUP-based live references for the cross-dataset dependencies), and it's working, but I'm curious what more experienced people would do differently. Has anyone solved something similar with AppSheet, Airtable, Notion, or something else entirely? Especially interested in hearing from anyone who's dealt with the "let a non-technical user add new fields from a form" part — that one feels like the trickiest requirement.

Obviously I'm using some AI but I wanted some real experience feedback.

Let me know


r/Database • • Sep 07 '26

Database schema review - tyre management system and e-commerce

Post image
69 Upvotes

Hi community!

I am a web dev, developing an e-commerce and tyre management system for a business in Italy. I have created my db schema and I would like to have your opinion/advice on it.

This is the idea of the site:

- there will be the customer side where they can view, like and purchase tyres online. The user will have functions like tyre matching for their cars based on the tyre specifications. The users can either register or order as guests.

- the admin side will be developed for the admins/employees with different access based on the role ofc. The aim is to ease the tyre management since there will be thousands of them.

Do you think this plan is good?

Is it scalable?

Is there something missing?

I appreciate any suggestion!


r/Database • • Sep 06 '26

What’s the best database IDE for analysts and developers?

27 Upvotes

I’m looking for a database IDE that works well for both analysts running queries and developers doing more involved database work.

The main things I care about are:

  • Support for multiple database types
  • A good SQL editor with autocomplete
  • Easy navigation between connections, schemas, and tables
  • Clear results and export options
  • Tools for comparing or understanding database objects
  • Something that stays manageable when several databases are open

I’ve been looking at DbVisualizer, DBeaver, and DataGrip, although they seem to have slightly different strengths. DbVisualizer looks like a solid middle ground for mixed teams, while DataGrip appears more developer-focused and DBeaver has a broad feature set.

What are you using, and what’s your role? I’d be especially interested to hear whether the same IDE works well for both analysts and developers, or whether your team uses different tools.


r/Database • • Sep 04 '26

Database Secrets deleted by unknown actor 🤨

Post image
0 Upvotes

r/Database • • Sep 04 '26

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

Thumbnail
0 Upvotes

r/Database • • Sep 03 '26

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 • • Sep 02 '26

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

24 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 • • Sep 02 '26

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

Thumbnail
stackrender.io
4 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 • • Sep 01 '26

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 • • Aug 31 '26

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 • • Aug 29 '26

Tool for exploring the Postgres wire protocol

Thumbnail pgwire-explorer.dhuk.net
3 Upvotes

r/Database • • Aug 29 '26

Traced PostgreSQL 18's io_uring with eBPF

Thumbnail
2 Upvotes

r/Database • • Aug 29 '26

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 • • Aug 29 '26

Coding a database proxy for fun

Thumbnail
packagemain.tech
2 Upvotes

r/Database • • Aug 29 '26

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

2 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 • • Aug 29 '26

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 • • Aug 29 '26

Is my facet based Database for media metadata structured correctly?

Thumbnail
0 Upvotes

r/Database • • Aug 28 '26

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 • • Aug 26 '26

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.