IT/Software career thread: Invert binary trees for dollars.

  • Guest, some asshat always complains they didn't know the tournie was running, so here's another notice!



    Go here and vote as hard as you can!
    This year's bracket is especially girthy, thanks to Asshat Lurkingdirk, so show your size appreciation with your vote, or else!
Tenants only matter with things like "ok, who do I send emails to today?" or my analysts wanna "fuzzy" search to get metrics on all things that have a cat on them. We can do it, but it's less than optimal which lead me to the idea of a secondary collection specifically for that analyst purpose.
Again I do not understand your use case beyond this post and the one before it.

But if you are concerned about scaling then creating a secondary collection that partitions things into more isolated datasets or volumes is a bread and butter change. You are on the right track here. If the Tenant is not the ideal partitioning point you will need to identify or create a better commonality. This design pattern is a best practice mongo or not in various situations. I would not really be concerned with duplication of data because storage costs nothing. The pain point is going to be keeping your partitions uniform if updates are inconsistent.

And I get why that this is a primary data store for you. But it is something to think about here because all of these problems are nonexistent with Kafka type streaming as the messages are immutable and you never have to deal with any of this. Hence why Mongo is less favored. I think the last time I used Mongo was like 3 years ago now.
 
Again I do not understand your use case beyond this post and the one before it.

But if you are concerned about scaling then creating a secondary collection that partitions things into more isolated datasets or volumes is a bread and butter change. You are on the right track here. If the Tenant is not the ideal partitioning point you will need to identify or create a better commonality. This design pattern is a best practice mongo or not in various situations. I would not really be concerned with duplication of data because storage costs nothing. The pain point is going to be keeping your partitions uniform if updates are inconsistent.

And I get why that this is a primary data store for you. But it is something to think about here because all of these problems are nonexistent with Kafka type streaming as the messages are immutable and you never have to deal with any of this. Hence why Mongo is less favored. I think the last time I used Mongo was like 3 years ago now.

So perhaps I can ask just one simple question: Do you/have you stored the same data in two different tables/collections before in a different style or with a different index to serve two different purposes?

If you have a team of 20 analysts that just go ham all day on the table running reports(especially ones that you cannot predict ahead of time so maybe might not be indexed because some idiot decided to group by the style of door handle on the car in a make believe car table) you obviously don't want that to have impact on the users who pay you to use the site, do you "migrate" or copy the data once it's been completed to some offline reporting database/table?

I was always taught redundancy was taboo and of course you introduce possible synchronization issues, but this just seems like the best way to handle some of these situations.
 
Last edited:
So perhaps I can ask just one simple question: Do you/have you stored the same data in two different tables/collections before in a different style or with a different index to serve two different purposes?
No, I have never used Mongo in this way. Whenever I had to use Mongo within a data platform we had a transformation layer to deal with problems such as this. From what I am getting here Mongo is your primary data store as well as the delivery point to downstream consumers. Is there a specific reason you are using it this way? What I would generally expect, because of Mongo's limitation in regards to delivering data products to end users, is using it the same way we would Kafka.

Mongo/Kafka -> Loading process into some other platform like Snowflake/Databricks -> Transformation (DBT or similar) -> End user data product (Most analysts would interact with it here) be it within the DB system or some more user friendly platform like PowerBI.
 
  • 3Like
Reactions: 2 users
Thanks for the conversation, we are a small startup so I dont have many people to talk to about this stuff.

I have 2 end users which is where I am struggling.

My customer: They log on, work together in teams, do whatever, etc. We have an end user UI(obviously) and essentially the "load" something(single pull from mongo by ID) work with it on platform in memory and "save"(update mongo by ID) when they are done. There is a bit more here that isn't relevant for this discussion such as real-time updates, blah blah. This works well.

Internal: We have companies looking to buy us, partially for our data and user base beyond a simple multiple of our revenue. What they want to do is run all sorts crazy metrics such as how many items are about cars and had more than 3 people work on them? I have the data, I can run the report, no big deal, it may be slow unless I add an index on #of people and type of item(car). Then it's fast. However I cannot predict what they want to query on.

Is that where you are talking about using snowflake/databricks?
 
  • 1Like
Reactions: 1 user
Thanks for the conversation, we are a small startup so I dont have many people to talk to about this stuff.

I have 2 end users which is where I am struggling.

My customer: They log on, work together in teams, do whatever, etc. We have an end user UI(obviously) and essentially the "load" something(single pull from mongo by ID) work with it on platform in memory and "save"(update mongo by ID) when they are done. There is a bit more here that isn't relevant for this discussion such as real-time updates, blah blah. This works well.

Internal: We have companies looking to buy us, partially for our data and user base beyond a simple multiple of our revenue. What they want to do is run all sorts crazy metrics such as how many items are about cars and had more than 3 people work on them? I have the data, I can run the report, no big deal, it may be slow unless I add an index on #of people and type of item(car). Then it's fast. However I cannot predict what they want to query on.

Is that where you are talking about using snowflake/databricks?
If you're a small shop and can sort of do whatever you want, why not pull the data into whatever format they're happiest querying against? Run an incremental pull in your low usage hours. No reason to run analytics on your live db (generally speaking).
 
  • 1Like
Reactions: 1 user