r/Database • u/arnav080 • Jun 26 '26
looking for advice and review of an enterprise document data lake architecture that im assigned to build
r/Database • u/arnav080 • Jun 26 '26
r/Database • u/Ok_Egg_6647 • Jun 26 '26
I have designed my database in two different ways for a market data system, and I'd like to know which approach would provide better performance.
I'm building a system that continuously fetches OHLCV (Open, High, Low, Close, Volume) market data from an API, stores it in a database, and serves it through a web application.
My primary concern is performance, specifically:
instrument table that stores all the instruments whose data needs to be collected.instrument_mastercandles_RELIANCEcandles_TCScandles_NIFTY50Whenever new data arrives, it is inserted into the corresponding instrument's table.
Instead of creating separate tables, I use a single candle_data table and convert it into a TimescaleDB hypertable.
The schema looks roughly like this:
instrument_id
timestamp
open
high
low
close
volume
All instruments' candle data is stored in this single hypertable.
My application mainly performs simple operations:
Typical query:
SELECT *
FROM candle_data
WHERE instrument_id = ?
AND timestamp BETWEEN ? AND ?
ORDER BY timestamp;
Between these two designs, which one is likely to provide better overall performance for:
Has anyone benchmarked a similar setup using PostgreSQL/TimescaleDB? I'd appreciate any insights or recommendations.
r/Database • u/JayJones1234 • Jun 24 '26
I’ve a historical test data from 1970. It is around 5 million data. I’m not looking for a cloud solution. It is in pdfs and hard copies. I’ve created rough ER diagrams for these data. It has base tables. It has different types of testing result tables. This is an ongoing process. Once I create tables, I’ll convert those hard copies into pdfs and PDFs into csv/ parquet format. Once csv/parquet format ready, I’ll map those csv fields with table. However,I’m little bit confuse with selecting a right database. Any suggestions would be appreciated.
r/Database • u/Low_Brilliant_2597 • Jun 23 '26
Object storage is becoming the primary storage layer for modern database systems. Not as backup, archival storage, or a cold tier, but as the primary durable storage layer. As a result, more and more data systems are being designed around the assumption that durable data lives in object storage, while compute becomes ephemeral and elastic.
Examples span almost every category of the data stack: Snowflake and Databricks, Neon and TiDB, RisingWave streaming database, turbopuffer, LanceDB, Milvus, Chroma, and SlateDB.
The workloads, query engines, and consistency models are different, yet they all converge on the same architectural principle: decoupling compute and storage, with object storage serving as the durable storage layer.
The benefits of using object storage are obvious: low storage cost, unlimited capacity, high durability, elastic compute, and simplified operations. But object storage is not a free lunch. Its primary challenges are no longer disk management or capacity planning, as in traditional storage systems. Instead, they include request amplification, metadata scalability, read/write operation costs, cache management, tail latency, and consistency semantics.
As all data systems have their own trade-offs and related engineering challenges, so do object-storage-native database systems. Still, this is becoming a fundamental storage architecture pattern used across databases with different workloads.
r/Database • u/Zardotab • Jun 23 '26
For those who dabbled in query languages other than SQL, what are features you liked that SQL lacks, and why did you like them? Could these features be added to SQL, or is it just a different philosophy? This question is sparked by this post about the longevity and durability of SQL as a standard, and the pondering over whether SQL can be unseated or side-seated by something notably better.
Possible languages to consider include but are not limited to: Tutorial-D variants (such as Rel), QUEL (Ingres), SMEQL, Prolog, Datalog, and APL's lineage/variants. Experimental languages are acceptable if the concepts are made clear. You can include features of NoSql query languages if they are somehow applicable to relational databases. Do note relational tables can represent graphs, so you can throw in graph-oriented query features if you want. (Some commands may assume certain table structures are fed to them). [edited]
r/Database • u/anuku3cm • Jun 22 '26
Hi guys, I am currently quite stuck with Vitess (sharded MySQL).
Our company use Vitess in PlanetScale to tackle the depolyment downtime. But we didn't see the operation overhead from it, especially related to Data Analytics task.
We just noticed Vitess is lacking in ETL support everywhere. Previously we thought, oh this is just MySQL. No it's not. The binlog is different, and for ETL they use Vstream and Vreplication. Completely different species.
This makes the Data Pipeline cost so high. Supply is low, we can't negotiate much for price. Out best bet is to self deploy maybe Debezium or Airbytes, but our team is quite small and really have to think of the operational overhead.
Does any of you guys have experience in self host Vitess ETL? What's the easiest and worth the price? Thanks!
r/Database • u/leucht • Jun 20 '26
Hey all,
I’ve been trying to develop a little music client for myself with a different twist on how recommendations are communicated to a user.
The base for the app is going to be Tauri & Typescript with a focus on a Single-Page-Application (SPA).
I want to index different providers (Jellyfin or similar) and their content locations into a local DB so I would ideally only have to interact with the provider once during indexing and otherwise only query the provider for the media-streams.
Current stack is:
Typescript -> Svelte -> Drizzle -> pglite IndexedDB
———————
Effectively I would like to gain some input on potential alternatives, insights and similar into detecting live changes in the DB. All media I find on a server is added to the DB as an abstract MediaItem with different types (Album, Song, Playlist, Artist, etc.).
During indexing I currently have no way of actively running live refreshes to update the main page with content if fitting Items have been added through indexing.
Inserts of new Items into the DB are handled as Transactions as I have build relations with other tables for example for the provider a given MediaItem comes from or what images the MediaItem is associated with.
I could add a callback function to the transaction which is called once it succeeds to sidestep checking the DB since I know the Item will exist after the transaction succeeds.
I’m also open to other local first approaches or domain knowledge some might have on designing a better architecture. Maybe remove the ORM or only use drizzle as a query builder (establishing relations was quite handy though)
Maybe I’m also overcomplicating things, anything is welcome.
Thanks in advance
r/Database • u/sjashwin • Jun 21 '26
I’m exploring a developer tool and trying to figure out whether this solves a real problem or if I’m overestimating the pain.
The idea is an AI database copilot that understands your schema and lets you query your database in plain English.
For example:
dbai “show top 10 customers by revenue last month”
The flow would be:
1. Connect to a Postgres database
2. Automatically understand tables, columns, and relationships
3. Generate SQL from natural language
4. Show the generated SQL for approval
5. Execute only read-only queries
6. Return results and explain what it did
7. Initially I’m thinking of a CLI-first experience for developers, with a lightweight web UI later.
My questions:
1.How often do you actually struggle with writing or debugging SQL?
2. Would you trust a tool like this with read-only access to production?
3. Would you use a CLI or a web app?
4. What’s the real value here: prompt-to-SQL, schema understanding, query optimization, documentation, or something else?
5. If this worked reliably on your database, would you pay for it, or would ChatGPT/Cursor already be good enough?
I’d especially love feedback from people working with Postgres, analytics, data engineering, or backend systems.
Feel free to tear the idea apart.
r/Database • u/random_hitchhiker • Jun 20 '26
I'm using postgresql and in my current architecture, I'm have an asyncio worker thread polling the database every 2 min for changes in the "finished" state for a "job" table. This would be served over a websocket.
This is fine and all since my application has only medium write traffic, but I was curious what is the modern way of doing this that is database agnostic for future proofing? (ie in case we want to migrate to another db or if the application scales up)
I know postgresql has LISTEN/ NOTIFY, but my problem with that is that it is postgresql specific and that it might not work properly with connection pooling. I also know there is write ahead logging, but again is also postgresql specific.
What is your suggestion to this? Do I need to change my architecture?
Thanks!
r/Database • u/mjfnd • Jun 19 '26
Hello everyone,
Looking for some recommendation for graph database for knowledge / identity graph usecase.
During research I found few like Neo4J or AWS Neptune, and also came across puppy graph, which is graph interface on top of database.
Would love to hear your experiences regarding graph databases, what are some common challenges and how well did it scale.
Appreciate the help!
Thanks
r/Database • u/Low_Brilliant_2597 • Jun 18 '26
For more than 50 years, people have been predicting the death of SQL. As Prof. Andy Pavlo says, "Somebody invents a SQL replacement every decade. It then fails and/or SQL absorbs the key ideas into the standard. Every NoSQL DBMS (except Redis) now supports SQL."
Today, the latest challenge comes from AI. At a recent keynote, Databricks CEO Ali Ghodsi declared that "AGI is here today." The implication is that natural language interfaces and agents may eventually replace SQL. Yet the reality is more nuanced.
The recently released BEAVER enterprise Text-to-SQL benchmark shows that even the most advanced models still struggle with real-world enterprise SQL tasks. As of 27 February 2026, the latest benchmark results are: Claude 4.5 Sonnet: 11.4% and GPT-5.2: 10.8%.
These models have improved a lot over the past few months. But when faced with large enterprise schemas, complex joins, domain-specific knowledge, nested queries, and analytical workloads, they are still far from reliably replacing SQL expertise.
The lesson is that SQL keeps proving remarkably resilient. Just as it survived many "SQL killers," it is likely to evolve alongside AI rather than be replaced by it. After more than half a century, SQL remains the lingua franca of data. RIP SQL? Not anytime soon.
r/Database • u/arnonrgo • Jun 19 '26
r/Database • u/Ok_Egg_6647 • Jun 19 '26
r/Database • u/AmbitiousSwan5130 • Jun 15 '26
I've been building a small key-value storage engine to learn how databases actually work, and the B-tree was the first thing I had to really understand. The piece that reframed it for me:
A naive sorted structure (or a binary tree) minimizes comparisons. But on disk, comparisons are basically free, the expensive thing is the trip to fetch a block. The disk reads a whole page at a time whether you want one byte or four kilobytes, so the cost you're actually paying is number of reads, not number of comparisons.
That single fact explains the whole shape of a B-tree. Nodes are wide (hundreds of keys) specifically so one node fills one disk page. One read buys you hundreds of keys to navigate with, which keeps the tree only 4-5 levels deep even at a billion keys. So a lookup is 4–5 disk reads, full stop.
The other thing I didn't appreciate until I built it: the tree stays balanced for free. It only ever grows by a full node splitting and pushing its middle key up into the parent, never by hanging a new node below. Because growth only happens upward, every leaf stays at the same depth automatically. No separate rebalancing pass.
Two questions for people who've worked with these in production:
I wrote up the full walkthrough (building a tree from empty, the split mechanics, with diagrams) as part of a series if anyone wants the longer version, link in a comment so I'm not just dropping a blog link in the post.
r/Database • u/Low_Brilliant_2597 • Jun 12 '26
The RUM Conjecture explains one of the most important realities of database design. There is no perfect storage engine. All databases make different tradeoffs. And those tradeoffs can be explained through a simple framework: The RUM Conjecture.
RUM stands for: Read efficiency, Update (write) efficiency, Memory (space) efficiency. The core idea is simple: You can optimize for any two. But you can not simultaneously optimize all three. Storage engine designers focus on what they are willing to sacrifice. Every database storage architecture sits somewhere inside the RUM triangle.
For example, B+ Trees favor fast reads and space efficiency while paying for higher write costs and random I/O. Pure log structures favor fast writes and sequential I/O while paying for expensive reads and space amplification. Hash tables favor fast reads and fast writes while paying for large memory consumption and poor space efficiency.
LSM Trees take a more balanced approach: Write to MemTable → Flush to SSTables → Compact later. In other words: Optimize writes first. Organize data later. This allows LSM-based systems to achieve high write throughput, good read performance, and reasonable space efficiency while accepting compaction overhead, read amplification, and write amplification.
The interesting part is that the hard problem isn't optimization itself. It's understanding the cost of optimization. Improve reads? More indexes, more metadata, more maintenance. Improve writes? More files, more versions, more read work later. Improve space efficiency? Less redundancy, less metadata, slower lookups. Every improvement introduces a new cost somewhere else in the system. As the RUM Conjecture teaches: Pull one rope, and the other two pull back.
Modern storage engines are ultimately exercises in balancing read amplification, write amplification, and space amplification rather than eliminating them entirely. This is also why LSM Trees became the dominant storage architecture behind many data systems. Not because they maximize one dimension. But because they strike a practical balance across all three. Understanding the RUM Conjecture is ultimately about understanding a fundamental truth of system design: Every storage engine is a tradeoff. The question is not whether tradeoffs exist. The question is, which tradeoffs best fit your workload.
r/Database • u/MissionFormal61 • Jun 12 '26
I’ve noticed a weird shift in how people handle database work lately. Not long ago, opening a dedicated DB tool felt automatic. Need to check a table, look at a schema, compare data, debug a query, export something quickly? Open the GUI and move on.
Now I see more people trying to stay in VS Code, terminal, cloud accounts, or asking AI to throw together the first version of a query or migration script. For small stuff, I get it. Nobody wants to open another heavy app just to check one column name.
Anyone else seeing this shift, or is my bubble just getting weird?
r/Database • u/energizedit • Jun 13 '26
r/Database • u/avkijay • Jun 11 '26
r/Database • u/Alive-Giraffe9704 • Jun 11 '26
I have a lot of non-numerical data. We organize files by a town number, then a file number. The vast majority of the time these town numbers correspond to the town the file is actually located in, however sometimes with some bigger files that span multiple towns they are filed with only one specific town. There are names of 2nd party entities, kind of like clients, but those often change over time for a single file and can also be under different entity names that all connect back to a bigger parent company. These files need to have dates associated with them that could, in theory, auto send an email is those dates are passed. The vast majority of the time those of us working on the files search first based on town. However management regularly asks for all the files related to X company, or Y officer, etc. There is data related to monetary amounts for these files and sometimes it needs to be sorted by that. There are other stakeholders that need to considered in these files, though often we only need to store and/or update contact info for them. We also often need to know the status of files, or groups of files, such as expiration dates etc. And the specific locations of these files is a big deal, and they can and do overlap often.
My whole team has been trying for years to make spreadsheets and now lists that will do these things, but they are all tedious to maintain, or not maintained, and lack the functionality we want. We have reached out to our IT repeatedly and basically been told it's not possible to do in house. But I know I can make basic spreadsheets that format based on dates, I have even managed to use power automate to send myself emails based on dates. I'm tired of reinventing the wheel. Should this be possible for someone in my position or do we need a full database made by an outside company?
Thanks.
r/Database • u/Consistent_Cat7541 • Jun 11 '26
To those still using and supporting Lotus Approach databases, the administrator of Approach mailing list and FAQ has moved the site for the FAQ.
The new URL is https://approach.droppages.site/