Live data from Hacker News

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

movio.co

41–50 of 264 posts

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

#41
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.

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

#42
post #18

what did the Go solution replace? I only read about DB changes, and cannot draw any conclusions.

Right. The blog post is a good narrative over time but isn't super clear about how they solved the problem. If I understand correctly they broke down the big MySQL query into separate queries that the Go service processes/caches?

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

#43
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.

I am not talking about auction thing here, just their regular dedicated servers offerings. They are bare metal and it is up to you to set it up, but savings are in the 5x - 10x range if you can avoid waste by underutilizing hardware (i.e. cases where you have to scale daily 1 to 100 instances might not be financially advantageous)

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

#44
post #25
post #8

I don't quite get this. How fast was running this query: Select loyaltyMemberID from table WHERE gender = x AND (age = y OR censor = z) Why the random complexity with individual unions and a group? Of course that's going to be dog slow. Sure, the filters can be arbitrary but with an ORM it's really really simple to build them up from your app code. The Django ORM with Q objects is particularly great at this. Obviousl…

> Edit: I've just read the query in the post again and I really can't understand why you would write it like that. Am I missing something here? Oh I've seen this happen a lot. Somewhere along the line, often from a DBA, it is decided that sql in an app is evil and that everything must be in a stored proc. Then instead of some simple string concatenation you have to jump through hoops like this.

One of the things I've done to harden an app is to revoke all permissions other than EXEC on a particular schema, then make sure everything is done via paramatised stored procedures - no chance of SQL injection then.

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

#45
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..

What if you need boxes closer to where your customers are? Latency is a big deal, especially in Australia / New Zealand.

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

#47
post #8

I don't quite get this. How fast was running this query: Select loyaltyMemberID from table WHERE gender = x AND (age = y OR censor = z) Why the random complexity with individual unions and a group? Of course that's going to be dog slow. Sure, the filters can be arbitrary but with an ORM it's really really simple to build them up from your app code. The Django ORM with Q objects is particularly great at this. Obviousl…

> Stuff like this is bread and butter SQL. Ten or fifteen years ago, sure - a DBA would look at a query plan and figure out how to do it properly. Worse case you'd slap a materialized view in and query that. But this is 2018! Programmers don't want to treat the database as anything but one big key value store ;)

Do you have any recommendations for resources to learn best database practices? I'm currently designing my first database and I'm not sure what information is worth storing (like calculations) and how to choose which data to group in tables.

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

#48
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..

What if you need boxes closer to where your customers are? Latency is a big deal, especially in Australia / New Zealand.

another provider of well-priced dedicated hardware is OVH - https://www.ovh.com.au/dedicated-servers/all_servers.xml

You can see there 64Gb boxes with NVMe drives startin around $160 USD per month. Not as much savings as with Hetzner, but still beats 1:1 price of AWS.

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

#49
post #38
post #8

I don't quite get this. How fast was running this query: Select loyaltyMemberID from table WHERE gender = x AND (age = y OR censor = z) Why the random complexity with individual unions and a group? Of course that's going to be dog slow. Sure, the filters can be arbitrary but with an ORM it's really really simple to build them up from your app code. The Django ORM with Q objects is particularly great at this. Obviousl…

Can be tricky to use EAV data models with traditional ORMs.. this type of functionality can often be slow or require plugins, if implemented at all: https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80...

Wondering if they shoved the data in PostgreSQL with JSONB how well it would perform over EAV.

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

#50
post #18

what did the Go solution replace? I only read about DB changes, and cannot draw any conclusions.

I found this linked from the article https://movio.co/en/blog/migrate-Scala-to-Go/

So if the alternative was Scala I can see why Go may have helped tighten things up a bit.

Post reply on HN