Live data from Hacker News

Write libraries instead of services, where possible

catern.com

291–300 of 328 posts

Re: Write libraries instead of services, where possible

#291
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…

It's not about "getting paid for labour" It's the attitude and environment a whole generation of devs is brought up in.

In the olden days, if you encountered a problem and had an idea how to solve it, you sat down and hacked a solution. No matter at work or in the evening at home. You had fun doing it, it improved your life, you open sourced it to share it with the community with the goal of having other people help you improve it or even helping your peers. That's how most of the small tools in the GNU toolchain were created as well as even Linux etc. And many of them live on today even as the original maintainers left or didn't keep improving by way of forks.

Today, if somebody has such an idea, they sit down make a MVP, find a cofounder, apply for YC, move to the valley, wonder about seed funding and product/market fit of their SaaS. And hope for getting acquired for big money. And most don't, they just fail and die. It's about money first and making it big.

Re: Write libraries instead of services, where possible

#292

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?

To add to this, we use Phoenix in a typical dockerized, stateless Loadbalancer- X Webserver - Postgres/Redis setup and it works great. Deployment is exactly the same as any other dockerized webapp. What OP is using is the "next level" that allows you to really leverage the BEAM but you don't have to.

Re: Write libraries instead of services, where possible

#293
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…

This. However, the burden of dealing with dozens of not only subscriptions, but change in subscription models (none->monthly, annual only like Prime, or per-usage) is daunting to many.

In particular, if I can't get family subscription for services like VPN, video, etc, I simply don't bother - because I'm not maintain 2-3x subs and I'm not going request close family to pay for something they may not need.

So I choose not to pay and look for simpler alternatives in that case.

Re: Write libraries instead of services, where possible

#294
I’ve seen many unnecessary services-that-should-have-been-libraries. Usually the result of organizational structure and career ambition; it’s more high-profile to launch a new service than to write a new library. Coworker jokingly called one egregious case the “Promotion Service”, as that seemed to be the main function of the service for the team which developed it.

Re: Write libraries instead of services, where possible

#295

Earlier quoted context omitted.

So write your own software for your needs and sell it for a one off price? But you presumably won't because the incentive isn't great enough. Which is exactly why people milk subs. And if you're not willing to do it for the incentive of a one off price, why should anyone else be?

Fells like the reason one off pricing is less common is because the model has felt broken since the time of Kazaa (file sharing app from way back), Napster etc. For some reason software is almost exclusively sold through app stores. I don't remember the last time I bought software that wasn't subscription based for a non mobile device. Ok, maybe one app.

Well that and probably the pricing psychology of paying what would be your LTV as a subscriber up front.

That’s also why I don’t agree subscription software is categorically detrimental but more of a trade off. The benefit is there for both parties: for the seller it’s easier to convert people because you’re only asking for the one month or one year price, for the buyer you’re at most out that same reduced price if the service doesn’t work out.

The negative is of course that you don’t own it outright, but it seems a lot of people are happy with the trade off. Apart from HN.

Re: Write libraries instead of services, where possible

#296

A service is great when you want to let the services dev cycle run independent of yours. There’s good use cases for this: - an auth service that keeps up with security bugs - a recsys that keeps deploying newer and better recsys into your app In these cases the service continues to fulfill the same contract, but they keep getting better independent of your dev cycle. In effect a service is a kind of “push” model of d…

100% agree with this. Determining the "direction" of dependency like this is one of the main considerations around implementing something as a library or a service.

I've built services that expose the latest/current version of an underlying library, with various versions of that library used in products across the company.

There is also a question of overhead - calling a library is almost always SO much faster and lighter than calling out to some service, especially if we're talking JSON or XML over HTTP.

Re: Write libraries instead of services, where possible

#297
post #137
post #75

Earlier quoted context omitted.

SOAP doesn't have anything like the restrictions rest has, does it?

"REST" these days is a defacto code name for "(JSON?) calls over HTTP", with loosey-goosey adherence to anything close to what the original REST author meant. At this point, we might as well call it RPC-style organized calls over HTTP using JSON representations and defined by "Swagger" files. Likewise, most of SOAP was "RPC-style organized calls over HTTP (or TCP) using mostly XML serialization and defined by XSDs. Y…

I now genuinely dislike XML. We ditched all that XML tooling around RPC over the wire and can't be happier. JSON is far better for what we do. Its faster, easier to parse, easier to store, easier to create/modify/delete. For us we even found JSON over HTTP uses less electricity.

We still use XML but its gone from RPC / everywhere to now only being a storage mechanism. I remember the network transfers dropping significantly and being very happy. Haven't looked back.

Re: Write libraries instead of services, where possible

#298
post #282

Earlier quoted context omitted.

> it's basically a single-language Kubernetes Well, yes and no. By using Kubernetes, you get a scalable infrastructure. By using OTP/Akka, you get a scalable application. While there is common problems to both domains, they are still 2 different domains. For example, using only Kubernetes, you won't have the ability to react to a Pod restart within your application (unless your application is aware of Kubernetes). Us…

Thanks! I was just going to point out that Elixir/Phoenix + Libcluster + K8s is like a match made in heaven. I haven't tried Horde yet but I'm quite intrigued now.

Horde uses a CRDT[1] (Conflict-Free Replicated Data Type) to provide a distributed Supervisor/Registry, this allows you to run an OTP supervision tree only once in your cluster, with automatic takeover. Basically, you run your supervisor on each nodes, but only one will run it (thanks to the CRDT).

I find it very useful because "Distributed OTP Application" are a pain IMHO (they must be started during the boot of the BEAM).

[1] - https://en.wikipedia.org/wiki/Conflict-free_replicated_data_...

Re: Write libraries instead of services, where possible

#299
post #298

Earlier quoted context omitted.

Thanks! I was just going to point out that Elixir/Phoenix + Libcluster + K8s is like a match made in heaven. I haven't tried Horde yet but I'm quite intrigued now.

Horde uses a CRDT[1] (Conflict-Free Replicated Data Type) to provide a distributed Supervisor/Registry, this allows you to run an OTP supervision tree only once in your cluster, with automatic takeover. Basically, you run your supervisor on each nodes, but only one will run it (thanks to the CRDT). I find it very useful because "Distributed OTP Application" are a pain IMHO (they must be started during the boot of the…

wow thankyou! this is actually handles a usecase we're trying to solve in an upcoming sprint. (each tenant needs to maintain a persistent websocket connection to a third party api but though us) I was trying to use registry to do it but was was wondering how I'd scale it once it got big enough.

Re: Write libraries instead of services, where possible

#300
post #149

Earlier quoted context omitted.

this sounds really neat and I'm going to go read about it! I also wanted to call out that this ~sentence has just... a bunch of things that seem like jargon/names within the community? As an outsider, I have no idea what they mean: > make a Genserver or Oban worker and mount it in the supervision tree. The Beam takes care of maintaining the process it sounds very sci-fi :)

sorry! so I'll clarify Elixir inherits a library called OTP from erlang which is a set of primitives for building massively concurrent systems. A Genserver is sort of like a Base Class for a object that runs as an independant process that plugs into OTP. By inheriting/implementing the Genserver behavior, you create an independant process that can be mounted in an OTP supervision tree which runs at the top of your app…

> there's very little hype behind it

This isn't a knock against Elixir or the Erlang ecosystem but I would definitely say that Elixir gets a decent amount of hype. Each time a new release comes out it invariably shoots to the front page of HN.

Post reply on HN