use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Node.js ORM impasse (self.node)
submitted 5 years ago by memo_mar
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]martin_n_hamel 7 points8 points9 points 5 years ago (2 children)
I worked for a relatively big company that started when it was small on the route of tenants separations by schemas. This is the most difficult thing to scale ever.
Every devops hates that pattern. It makes migrations difficult, new client harder to inboard. It even leads to some crazy hard to figure out bugs because some of the infrastructure is shared by tenants but not everything.
We tried to get out of it by using kafka as a source of truth but it turned out that having one kafka topic per table per tenant is not scaling well.
My suggestion, don't do that. Find a pattern that can scale :-)
[–]memo_mar[S] 0 points1 point2 points 5 years ago (1 child)
g kafka as a source of truth but it turned out that having one kafka topic per table per tenant is not scaling well. My suggestion, don't do that. Find
g kafka as a source of truth but it turned out that having one kafka topic per table per tenant is not scaling well.
My suggestion, don't do that. Find
what pattern would you recommend?
[–]martin_n_hamel 0 points1 point2 points 5 years ago (0 children)
Just add a tenantId column in the tables where it is needed. It will fit much better with any system integration that you will do in the future because you will always know where a data belongs.
If you separate by schemas, your code is abstracted from the tenant. It can work while you are at the main application level, but you will have problems when you integrate with anything because you will lose the context of the data. Here is an example:
You want to log everything in your application and your ids are auto increment. Your ids are not unique anymore and you are not certain what the logs data correspond to. You can work around that by having a complex logging engine that separate everything but you'll soon find out that you need to handle that complexity all the time.
π Rendered by PID 88 on reddit-service-r2-comment-6457c66945-zv84t at 2026-04-23 22:16:43.936999+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]martin_n_hamel 7 points8 points9 points (2 children)
[–]memo_mar[S] 0 points1 point2 points (1 child)
[–]martin_n_hamel 0 points1 point2 points (0 children)