Live data from Hacker News

We saved $50k/year with a Go microservice coded in a hackathon

movio.co

101–110 of 264 posts

Re: We saved $50k/year with a Go microservice coded in a hackathon

#101
post #92

Earlier quoted context omitted.

It makes sense if each client gets to add their own fields.

Using the builtin type for that purpose is going to work way better. This depends on the DB you're using but is generally referred to as a "JSON" field (why ? Because they're a response to MongoDB, which calls is that). Oracle and SQL server have very similar things. In Mysql, it is JSON data type [1], in Postgres JSON/JSONB [2]. Creating indexes across them is doable, through a workaround (involving what is generall…

They may be generally a better option, but they have their own disavantages. For example, JSONB fields in Postgres won't deduplicate keys, so if you have large keys, your table size will increase quite a bit (which also makes it harder to keep it memory).

Using an EVA, you can have a "keys (id, key_name)" table, and then only use the IDs in the values table, reducing that waste.

By the way, you don't need views for indexing on JSONB fields, it's supported out of the box in PG.

Re: We saved $50k/year with a Go microservice coded in a hackathon

#102

Earlier quoted context omitted.

The stack has to bottom our somewhere and it's usually at the application code

If that’s where they bottom out they should be called “mid stack” rather than full stack. If you are claiming to be full stack you better be prepared to go all the way.

How much quantum mechanics do you really need to know to code the next Uber for hamsters?

Re: We saved $50k/year with a Go microservice coded in a hackathon

#103

Earlier quoted context omitted.

If you are using Postgres, the JSONB datatype will let you do exactly this while still using the full power of SQL. Simply create a column where you keep a JSON object full of random user properties, if flexibility is what you want. You can even index properties.

The question is whether it can be stored like this while allowing for fast queries. For example, unless it changed recently, Postgres doesn't calculate statistics to help the query planner on jsonb fields.

The answer would make a great blog post.

Re: We saved $50k/year with a Go microservice coded in a hackathon

#104
post #95
post #91

Earlier quoted context omitted.

I like to trot out this old gem[1] when people wonder why there's so much hate for MySQL. Nontransactional DDL alone is sufficient to classify it as a toy DB for me. Yes, I've been personally bitten by it. [1]: https://grimoire.ca/mysql/choose-something-else

This talks a lot about 5.5 and mentions that 5.6 is “due out soon”. The current release series is 5.7. How much of this is outdated and how much has stayed the same?

Some things are improving — for example: https://dev.mysql.com/doc/refman/8.0/en/atomic-ddl.html

And https://mysqlserverteam.com/new-defaults-in-mysql-8-0/

Previously on HN: https://news.ycombinator.com/item?id=5122299

Personally, I only use MySQL and derivatives where I have to (basically WordPress.)

Re: We saved $50k/year with a Go microservice coded in a hackathon

#105
post #91

I've come to the conclusion that the problem in tech is that all the people doing the work are in their early twenties and have no idea what they are doing. Once they get some experience they are quickly promoted to the CTO position. Rinse and repeat. What we have here is a classic dbms problem and no one at Movio seems to know how to deal with that. Instead of migrating from Mysql to something serious (Postgres) the…

I like to trot out this old gem[1] when people wonder why there's so much hate for MySQL. Nontransactional DDL alone is sufficient to classify it as a toy DB for me. Yes, I've been personally bitten by it. [1]: https://grimoire.ca/mysql/choose-something-else

According to [1] Oracle doesn't have transactional DDL either.

[1] https://stackoverflow.com/questions/4711447/oracle-ddl-and-t...

Re: We saved $50k/year with a Go microservice coded in a hackathon

#106
post #14

What else it shows - how expensive AWS hardware vs hosting own hardware. I guess you have to consider how often you have to scale, but hetzner offers dedicated servers with 64Gb and NVMe drives starting from 54 euros per month - https://www.hetzner.com/dedicated-rootserver?country=us - compare that to $580 per month these guys were paying for i3.2xlarge instance..

I’ve heard mention of Hetzner no less than a dozen times in the last couple days. What’s their deal? I’m not quite sure I grok this server auction thing they do, or how they’re so cheap.

If all you need is Virtual Machines or dedicated machines, you are good to host your databases, services etc. using AWS is very expensive. You could literally buy from 3-4 different vendors to maintain availability in disaster case and still be cheaper. Hetzner is one of the most affordable providers and both dedicadted and cloud offerings are fast enough.

Re: We saved $50k/year with a Go microservice coded in a hackathon

#107
post #69
post #29

Earlier quoted context omitted.

The user data is most likely in rows instead of columns. Instead of having id, name, age, gender 1213, fake, 60, female they would have property_id, user_id, value 1 (assume age), 1213, 60 2 (gender), 1213, female This gives them the freedom to add more properties to the user without always having to add a column to the users table. When querying the database you'll have to do unions or joins.

Oh gosh this pattern. The first time I encountered it was in my first job where we used Magento. Super flexible. Also super slow. Does anyone have any advice how to make a db design like this work faster? Generally I thought when data is arranged like this it might be a prime candidate for document based storage. But I'm no dba so I have no idea if that would be correct.

> Does anyone have any advice how to make a db design like this work faster?

Normalize it properly. If this is not possible, ensure that both the userid and the property are indexed

Re: We saved $50k/year with a Go microservice coded in a hackathon

#108

This is cool but it seems strange (to me) that this was a “Hackathon” project as opposed to just a stand-alone problem to be addressed as a normal course of doing business. It doesn’t make the solution less cool. It just seems like a strange distinction on what a Hackathon is.

Depending on the type of company, it could have been blocked by the manager or PM. It is easy for them to reject "tech stuff", when your time could be spent adding a feature from the product owner.

A proposal like this could easily have been seen as the developers wanting to test out a technology that was not approved or with a good business case. That business case is usually something that only sales/product can sell. The barrier to listening to developers is higher because they are assumed to not know enough about business.

You may have an "agile" environment, but you often need a very good reason to not pick the next item from the backlog, which was not created and maybe not even prioritized by you.

In those companies, the hackathon may be the only time developers can present their ideas.

Re: We saved $50k/year with a Go microservice coded in a hackathon

#109

Earlier quoted context omitted.

If that’s where they bottom out they should be called “mid stack” rather than full stack. If you are claiming to be full stack you better be prepared to go all the way.

How much quantum mechanics do you really need to know to code the next Uber for hamsters?

Isn't the current quest in quantum mechanics (to find a grand unified theory) to find an abstraction that does leak? At the moment it's too self contained and doesn't explain anything about the macroscopic world.

In any case, having a basic understanding of the next level up (the electron) has proved quite useful to my career, otherwise I wouldn't know how turning things off then on again affects the machines I'm working with.

Post reply on HN