Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

08-11-2016 , 02:20 PM
Quote:
Originally Posted by PJo336
lol thats pretty funny. I like Mongo but the relational model seems to keep ppl slightly more on the correct design path. Were using Mongo but in a lot more relational manner. Although the nested docs are nice, updating them can be annoying
There are ways to do relational stuff in mongo in a way that is basically sane, if error prone, i.e. without relational integrity. But man we are doing it all wrong.

Another favorite of mine is that there is a data type A that contains a list of Bs. Bs are not unique - many many As may have the same B.

But they went ahead and embedded the full B object into the A. So if anyone changes a B you have to search and replace them all. **** me.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 02:27 PM
Oh and we also are using an ORM, so it's not like we are taking advantage of the ad hoc structure of mongo very much. All the down sides, none of the benefits
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 02:33 PM
Yes but mongo is cool.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 02:39 PM
For stuff it's good at, I really like it. For other stuff, I don't.

A real problem with it is, you can create a new db or collection at will. But making a new mysql/postgres/etc table usually involves coordinating with someone at your company and making a ****ing migration plan and all this ****. So people are like, **** it, if I use mongo, I can do whatever I want! No migrations! No DML!

And so tons of **** gets rolled into mongo where EVERYONE agrees it should be in a RDBMS.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 02:51 PM
Mongoose is awesome and does have schemas and works amazingly with passport (node auth) so um use that.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 03:18 PM
The problem is if you have non-node clients which need to access mongo (at least according to the startup guy).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 03:57 PM
Theres a lot of times where nesting stuff is awesome, and its probably not a good reason at all, but I like having 10 collections vs 30 tables for representing the same data.

Also async db libraries for mongo! Which admittedly are more frustrating than they are worth
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 05:37 PM
I've had to deal with SQL DBs that were massively over-normalized like that. Not fun. Like zip code would get its own table and address would have a reference to the primary key of the zip code.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 05:41 PM
How many people at the startup?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 05:58 PM
Quote:
Originally Posted by suzzer99
Well the startup I negotiated at $85/hour just offered me full time at about 80% of my current salary (which is at the top of the market) + 2% of the company. They beauty is I don't have to quit the day job and they know day job meetings might have to come first.

Lol - 2 "full time" jobs here we come.
Congrats, totally awesome.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 07:38 PM
Quote:
Originally Posted by Lattimer
How many people at the startup?
10-12, all remote, mostly in AUS. ChrisV - might be something. Supposedly they've got 18 months of seed money and are closing in on series A.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 08:59 PM
What kind of work is it?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 10:07 PM
Development. It's a startup. The stack is RethinkDB/node/react.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 10:47 PM
I seem to recall it's mostly a job doing nothing, which is perfect for a 2nd full time job, especially when the first job is also doing nothing
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-11-2016 , 11:18 PM
It's getting better. I have stuff to do on the second job.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-12-2016 , 02:19 AM
Quote:
Originally Posted by suzzer99
I've had to deal with SQL DBs that were massively over-normalized like that. Not fun. Like zip code would get its own table and address would have a reference to the primary key of the zip code.
Sounds so much like my first few databases. Wow, they were terrible.

Quote:
Originally Posted by suzzer99
It's getting better. I have stuff to do on the second job.
Congrats on the dual income.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-12-2016 , 03:06 AM
RethinkDB looks interesting, anyone used it? Looks a bit Meteor-ish.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-12-2016 , 09:42 AM
Quote:
Originally Posted by daveT
Sounds so much like my first few databases. Wow, they were terrible.
Yeah I've seen things you wouldn't believe, c-beams, attack ships etc.

One of my favorites was a DBA who insisted that every column in a table begin with the name of the table, that way, in every query you could tell what table a column came from.

At my last job, again, it was really hard to modify existing tables, but easy to make new ones. So we had like 9 tables that held "user" settings, i.e. a 1-to-1 mapping to the main user table. This is of course propped up by the ORM, the average user of the ORM models doesn't even know this is happening. Some of these tables were 2 columns: user_id + whatever new setting.

I interviewed someone once, and asked him to make a little program that would track books - basically it would have like author, title, publish date, isbn, etc. He made a structure where the 1st row in the table was title, the 2nd was author, the 3rd was publish date, etc. To add a new book, he used "alter table add column", i.e. each book was a new column. He was, apparently, way ahead of his time.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-12-2016 , 11:01 AM
I've seen the "new data, new column" pattern before. It's advanced ****, not to be tried at home.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-12-2016 , 02:57 PM
Quote:
Originally Posted by ChrisV
RethinkDB looks interesting, anyone used it? Looks a bit Meteor-ish.
We're using it because they like the real-time push aspect (basically you can watch attributes/data and push to the client when those change, so you don't have to poll). I'm not 100% sure why we need that but there is a lot I still don't know.

Right now we are stuck on this problem. So if anyone has any ideas please chime in. From the dev working on it:

Quote:
Localy on my VM and on the server behind xxx, if i upload a 600Mb file size, i'll have 600 chunks in rethinkdb. Then if i ask for one, by PRIMARY KEY, it take 20 sec to give me chunk of 1Mb.

It's not the nodejs driver (using rethinkdb embed GUI, same thing).

Primary key is of course indexed.

I need help on this. It's probably a rethinkdb tunning. I hope.
Followed by this:

Quote:
Problem solved. Seem's we have to take care about HDD or SDD usage.

The "direct io" option enabled (disabled by default) in rethinkdb config file solve the problem.
And this:

Quote:
I spoke to quickly. The lag behavior now occured after 1200 record of 1Mo for each.
Here is a similar issue but they don't think it's the same as ours: https://github.com/rethinkdb/rethinkdb/issues/4036
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-12-2016 , 04:01 PM
Coming from Postgres, my initial thoughts:

https://www.rethinkdb.com/docs/memory-usage/

Quote:
To understand the number of blocks used by a given data set, we must first distinguish two different modes of how a document can be stored.

-- Small documents of no more than 250 bytes (including encoding overhead) are stored “in line” in the primary index tree. Many such documents can share a single 4 KB block.
-- Larger documents of more than 250 bytes are stored in blocks of their own. Documents up to 4 KB use a single block; larger documents are split across multiple blocks as needed.
In simple terms, large documents require more blocks. Sounds like you are reading from several blocks.

There is a simple, non-mathematical way of thinking about indexes. They take up some space > 0Mb. This is going to be some N indexes in each block, depending on the size of each index. Larger indexes are going to take more memory space, but with limits:

Quote:
Restrictions on keys

-- Primary keys are limited to 127 characters.
-- Secondary keys are indexed on their first 238−PK bytes, where PK is the primary key length of that table. If a secondary index has keys whose first 238−PK bytes are identical, performance using those keys will be degraded, as RethinkDB will fall back on a linear search.
-- Secondary indexes do not store objects or null values. See Using secondary indexes for more details.
-- Primary key strings may not include the null codepoint (U+0000).
https://www.rethinkdb.com/docs/optimization/

Also, if he is attempting parallel queries, the order of the query seems to matter:

Quote:
Commands that stop subsequent commands from being parallelized include:

-- order_by (with or without indexes)
-- distinct
-- eq_join
-- reduce, fold
-- limit, skip, slice
-- max, min, avg
My take, without seeing the data and query, is that the documents may be too large, and that is causing large indexes to fire, which isn't going to help the query run any faster (one indexes are so large, you are effectively doing sequential scans anyways, plus using up a bunch of memory that could be causing read blocking issues, and it appears the memory is shared across blocks, so more work). Also, there is no guarantee that an index is even firing in the first place. It could be index size or query issues, possibly a combination of both.

First question I would ask is: "are you sure the indexes are firing?" If so, are they firing over the entire query?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-13-2016 , 02:48 PM
To add to above, when I read or hear "I don't know why that query is slow, the table has indexes," I translate that to "I only shot my foot with a bazooka, I don't know why my toes are missing."
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-13-2016 , 10:17 PM
Quote:
Originally Posted by suzzer99
Well the startup I negotiated at $85/hour just offered me full time at about 80% of my current salary (which is at the top of the market) + 2% of the company. They beauty is I don't have to quit the day job and they know day job meetings might have to come first.

Lol - 2 "full time" jobs here we come.
Quote:
Originally Posted by suzzer99
Development. It's a startup. The stack is RethinkDB/node/react.
Awesome, congratulations suzzer! Do you know if they may still be looking for people 4-8 months from now? I may be looking for a part-time arrangement like this at some point, depending on how things go at my current job. It seems like remote team + significant time difference would make things quite a bit easier when combined with a full-time job.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-13-2016 , 10:44 PM
Yeah they might be if they get their series A, which they seem fairly confident about. Do you have any react or rethinkDB experience?

DaveT I sent our RethinkDB guy your response and got two kind of cryptic responses from him about it. I think he's a bit lost.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-14-2016 , 12:10 AM
Quote:
Originally Posted by suzzer99
Yeah they might be if they get their series A, which they seem fairly confident about. Do you have any react or rethinkDB experience?
Great. No experience with RethinkDB but I'm at a React shop so I should have a decent amount of experience by the time I'm looking to do contract work.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m