Live data from Hacker News

Write libraries instead of services, where possible

catern.com

211–220 of 328 posts

Re: Write libraries instead of services, where possible

#211

Earlier quoted context omitted.

What's it like using stored procedures with Ecto?

surprisingly easy. 1. if I'm calling directly, I can just use a raw sql query 2. views can be backed with a read only ecto model 3. triggers can be set to run without your ecto code even being aware of it. 4. for custom errors, you can add overides for the error handling in ecto to transform things like deadlocks to 400 errors

Cool. What language do you write the stored procedures in?

Re: Write libraries instead of services, where possible

#212
post #131

Earlier quoted context omitted.

You're right. The fact that people can make outsize rewards from subscription services are the reason that even small single use tools are now 'services'. I have a piece of software that removes the background from my video feed. It's a subscription, and it regularly phones home. I have a piece of software that lets me visually combine, rotate and reorder pdfs. It's a subscription. Even the simplest things, like a 't…

> It's miserable fighting off a million people who want to help me for 'less than the daily price of your coffee'. Is it also miserable "fighting off" a million companies who want to sell you stuff for the daily price of a coffee? Stuff like T-Shirts, books, newspapers, candy, etc? You seem to have a patronizing attitude towards software products/services. You seem to think that they are so simple, that they should b…

I pay for a T-shirt, then I use it for as long as I want. I don't pay every month to wear the T-shirt.

Re: Write libraries instead of services, where possible

#213
post #104

Earlier quoted context omitted.

You're right. The fact that people can make outsize rewards from subscription services are the reason that even small single use tools are now 'services'. I have a piece of software that removes the background from my video feed. It's a subscription, and it regularly phones home. I have a piece of software that lets me visually combine, rotate and reorder pdfs. It's a subscription. Even the simplest things, like a 't…

> Even the simplest things, like a 'torch' are ad-supported on android these days. This has a built-in feature on every smartphone for years now. These apps are a scam.

Is there a standard way to get at "turn the screen white and the brightness up"? I used to have a torch app that had that mode (presumably, lower power than driving the flash LED), along with a few others (like a night-vision-preserving red screen).

Hardly the most challenging app in the world, but it was worth the $.99 I paid for it. I probably could have written it myself, and while I personally would likely have made it free, I felt ok giving somebody a tiny tip for it.

Re: Write libraries instead of services, where possible

#214

Phoenix is practically built with this idea in mind. My startup is built out of a single phoenix monolith. Only external dependency is postgres. Despite this, I've managed to completely avoid all the typical scaling issues of a monolith. Need a service or background worker? I juts make a Genserver or Oban worker and mount it in the supervision tree. The Beam takes care of maintaining the process, pubsub to said servi…

> And all the advantages of microservices without the associated costs. (orchestration, management etc) Really curious about this! What’s the deployment experience? What environment do you use for your production? How do you run/maintain the erlang VM and deploy your service?

We use eks with some customizations specific to elixir and use a autodiscovery service for new nodes to connect to the mesh.

One of the big differences we had to make was allocating one node per machine as the beam likes to have access to all resources. in practice this isn't a problem because its internal scheduler is way more efficient and performant than anything managing OS level processes.

That said, a more complex deployemnt story is defiantly one of the downsides. But the good news is that once setup, its pretty damn resilient.

Now of course, our deployment setup is more complex specifically to take advantage of beam such as distributed pubsub and shared memory between the cluster. If you don't need that, you could use dokku or heroku.

Re: Write libraries instead of services, where possible

#215

Earlier quoted context omitted.

You're right. The fact that people can make outsize rewards from subscription services are the reason that even small single use tools are now 'services'. I have a piece of software that removes the background from my video feed. It's a subscription, and it regularly phones home. I have a piece of software that lets me visually combine, rotate and reorder pdfs. It's a subscription. Even the simplest things, like a 't…

MS Office is a great example of this because they squeeze money out of folks when it seems the features added are minimal. The only interesting aspect is cloud-collaboration, but that could be P2P instead. I'm willing to wager most folks still use the same subset of office functionality: page layouts and fonts and such have been around for a while; financial formulas rarely change; etc. But yet, they are charged an a…

Three words: Adobe Creative Cloud

Re: Write libraries instead of services, where possible

#216
post #136

Earlier quoted context omitted.

You're correct that obfuscation of Java libraries has nothing to do with Java stack inspection/JVM security... but the latter is what the article talks about and what is cited above, so not sure why you have just now brought up decompiling obfuscated Java libraries, which is, as you say, totally unrelated...

What it says is "Java-style stack inspection can restrict user or library code to deny access at runtime to unauthorized methods.", which doesn't seem true to me, if the user has access to the library binaries. It's very possible for the user to just patch the library and use it however they want. It's possible (although I'm not especially convinced) that you can prevent the user from reflectively doing this at runti…

Yes, the OP has this backwards. The Java sandbox would allow an application to limit the access granted to a library to protect from a malicious library. It does not protect a library from being used by an application in way that was not intended by the library creator. It is certainly not a means of enforcing a licensing scheme.

Re: Write libraries instead of services, where possible

#217
post #65

I have a hard disagree here. Though, I suspect it is a matter of what your code is doing. First, my objection, though. Pushing this "to the users" is in no way easier to support. It is easier to abandon, but support is a different thing. You will have support contacts. And, due to the distributed nature of the deployment, you will have a much harder time isolating your code from the environment it is in. With a servi…

>If one user can't have a negative impact on other users, then you don't care if some users are slow to upgrade; they're only hurting themselves.

This quote looks like it was written by someone who has never had to support users. I've had that pleasure, and, these slow to upgrade users will become the bane of your existence. You'll spend an inordinate amount of time trying to support the "If only this f*ing user would upgrade!" customer.

Re: Write libraries instead of services, where possible

#218

Earlier quoted context omitted.

What's it like using stored procedures with Ecto?

surprisingly easy. 1. if I'm calling directly, I can just use a raw sql query 2. views can be backed with a read only ecto model 3. triggers can be set to run without your ecto code even being aware of it. 4. for custom errors, you can add overides for the error handling in ecto to transform things like deadlocks to 400 errors

[deleted]

Re: Write libraries instead of services, where possible

#219

Earlier quoted context omitted.

surprisingly easy. 1. if I'm calling directly, I can just use a raw sql query 2. views can be backed with a read only ecto model 3. triggers can be set to run without your ecto code even being aware of it. 4. for custom errors, you can add overides for the error handling in ecto to transform things like deadlocks to 400 errors

Cool. What language do you write the stored procedures in?

plpgsql

Re: Write libraries instead of services, where possible

#220

Curious what people's experiences are wrt library development within an enterprise. I've been at organizations where basically everything was done via services and there was very little library usage, and I always thought that was suboptimal. Now I'm at a place where we utilize lots of libraries and they seem to pose pretty significant costs of their own. A typical example is if we need to do something that the libra…

Exactly. Integrating external libraries into another system is much harder than leveraging e.g. a RESTAPI. The OP seems to be saying that Service oriented architecture (SOA) is worse. It's definitely not. There's no "better" or "worse" here. It's just two different options with different costs of integration and interoperability. the service architecture is going to have additional maintenance overhead but provide cheaper and easier interoperability.
Post reply on HN