TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Shared Database Anti(?)-Pattern

5 pointsby cristalolegabout 3 years ago
Hi, looks like another team is interested in one of our tables, they&#x27;re planning to just read, so it will be 100% read-only queries (probably from replica).<p>I&#x27;m curious, how popular&#x2F;acceptable&#x2F;hopeless such pattern is?<p>I understand that giving someone read access to the database isn&#x27;t free (we cannot change schema easily, we cannot change DB, etc) but at the same time, we don&#x27;t need to create a dummy HTTP-service to just do simple queries (and spend more time on unmarshal-marshal stuff).<p>Let&#x27;s assume I&#x27;m asking about Postgres but will be very happy to hear stories or thoughts about other DBs (relational, nosql, graph, wide-column, analytical, inmem, etc) and are there any difference in sharing them practically or architectural.<p>Thank you.

3 comments

sidmitraabout 3 years ago
We use Stitch[1] for this. You can selectively replicate some tables from any &quot;source&quot; to any selected destination[2]. I believe 1 destination is there on the free plan. You can point to any self hosted(or cloud) Postgres DBs. There are a bunch of supported destinations eg. Postgres, Snowflake etc. The sources also can be a varied like Google sheets.<p>We use this to send relevant tables to analytics teams outside of engineering. There&#x27;s a bit of tweaking initially(i.e. having a timestamp column like &#x27;last_updated` helps to replicate only those rows)<p>Having a separate readonly DB user is also pretty common. We use that internally inside engineering(where we trust them slightly more). Important bit is to <i>always</i> add a statement_timeout so people cannot not run random slow queries on your production database that are hung for days.<p>I&#x27;ve also had my eye on <a href="https:&#x2F;&#x2F;www.singer.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.singer.io&#x2F;</a> , which seems like an open source ETL tool similar to Stitch. But i&#x27;ve not experimented with it locally yet. It uses &quot;taps&quot; and &quot;targets&quot; nomenclature. And there&#x27;s a healthy ecosystem of opensource extensions of creating your own taps&#x2F;targets.<p>[1] <a href="https:&#x2F;&#x2F;www.stitchdata.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.stitchdata.com&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;www.stitchdata.com&#x2F;integrations&#x2F;destinations&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.stitchdata.com&#x2F;integrations&#x2F;destinations&#x2F;</a>
micahdeathabout 3 years ago
It&#x27;s not that you can&#x27;t change the DB. Options could be:<p>- collaborate more with any breaking changes<p>- add features to the DB and keep backwards compatibility<p>- use a DB View so it can be changed as needed and not affect other apps (most similar to an API)<p>- use Stored Procedures instead of direct table access as it gives more compatibility<p>- there are other methods too.
评论 #30934867 未加载
jd_mongodbabout 3 years ago
How to mirror an Oracle Table to MongoDB <a href="https:&#x2F;&#x2F;medium.com&#x2F;@johnlpage&#x2F;oracle-pl-sql-and-the-mongodb-data-api-47962a5cfbb4" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@johnlpage&#x2F;oracle-pl-sql-and-the-mongodb-...</a>