Ask HN: Where do you host your API endpoint?

51 points by david90 ↗ HN
Just for some news feed like contents - it might be troublesome to launch an instance of the single purpose. Looking into Google spreadsheet as API endpoint.

What is your choice?

63 comments

[ 2.5 ms ] story [ 123 ms ] thread
I'm using now.sh, really nice for a node/express based API endpoint. Ours seems to scale very cheaply and deployments are, dare I say, fun :)
Sounds great, where do you host it? AWS / heroku?
now provides the hosting abstraction [1], sounds like internally they choose whichever one is cheapest.

[1] https://zeit.co/now#features

Rad. I did not know this. Where is your database hosted?
Mlab.com (also inexpensive if your needs are reasonable), with a lot of our stuff being handled with s3 bucket storage. Sorry for the late response.
Firebase - Free for small projects and very nice integration with frontend and node applications
API Gateway and AWS Lambda do it for me.
Last time I looked API Gateway didn’t support gzip making it prohibitive for longer XML or JSON responses. Is it still this way?
Kubernetes :) Heroku's free tier seems to be a popular choice for side projects.
Am I understanding you correctly, Kubernetes on Heroku? How?
I think parent means K8s for main projects and heroku for side-projects.
Yes, that's what I mean. Kubernetes is probably overkill for small side-projects.
Kubernetes is not a "where", more like a "how". Where do you host/rent your kubernetes?
We started with API Gateway + Lambda, but recently migrated to Google Cloud Functions. The overhead to spin up new funcs w/ endpoints is trivial, as is rolling in CORS and even some auth if you really want (we're using Firebase Auth). It was a big deal paradigm shift for us. Whether that's because it's a fun product or because I'm just awful at AWS is, well...
It doesn’t seem then that your response is dynamic? You could generate a static file every now an then and host it wherever you want, no?
Some how you can consider it as a news feed use case. So will need update from time to time. Being too static will be hard for managing the content.
(comment deleted)
http://pythonanywhere.com/ is also a good alternative.
I don't really find Pythonanywhere useful for anything other than hobby sites. I mean no gracefull restart, no caching on static assets and slow SSL encryption (not cached on the web server).
PythonAnywhere dev here: fair point re: the caching of static assets, but could you give a bit more information about the SSL and the graceful restart? All of that should work fine.
We use Apigee, now know as Google Sense (API Management framework)

Most big cloud vendors offer API management through their services.

DigitalOcean VPS running docker containers (for $10/mo).
+1 for DigitalOcean and docker containers.
I also run on DO but haven't deploy with docker. What are the greatest benefits in your opinion? (I only run little experiences for now, but would also like to run small client backends).
I have run DO + Docker and the reason I do it is because it makes deployments dead simple. Through up Ngnix as a reverse proxy to the port that is exposed through docker and you're done. I'm deploying an Elixir/Phoenix app, so it makes dependency management dead simple too with not having to worry about versions of Elixir/Phoenix and it makes changing droplets a breeze too, since the only pre-reqs to install are docker.
The biggest benefit for me is isolation. I keep the main system clean. Just install fish shell and glances there. And all messy stuff required by projects is isolated in individual containers. They can be rebuilt from scratch if needed and don't pollute the main system (except for well-defined data folders).
Old-fashioned answer: docker on a dedicated server at OVH or VPS
Is docker old fashioned nowadays? :)
Running your own host for it may be
Ditto. Dedicated hardware at packet.net, OVH, ServerStadium, HostVirtual. Recommend WebHostingTalk.com forums offers sections for good deals on dedicated servers, VPS. Using docker / dokku
Bare metal on a server at Hetzner. I like keeping things simple.
Running your own RAID on top of a handful of unreliable (probably used) disks is an unusual definition of simple in my book.
If you know what you are doing vs the latest IaaS fad, it's going to be a lot easier and probably cheaper doing that.
When you architecture your stuff correctly, you don't need RAID.
Is there a reason why you would not virtualize (use ESXi/Proxmox, etc) the server?
That's a lot less simple as now you suddenly have multiple machines to handle (even if they're virtual). Whenever I really want something like that, I'll usually use systemd-nspawn or docker depending on the use case.
Kubernetes on Azure and GKE for main projects (high traffic)

If your projects are lightweight / low traffic, check out Flynn. You get to push code directly to flynn and skip the docker workflow (push commit to github -> docker builds image -> kubernetes updates pods, this takes time ofcourse). Flynn can also create DB for you.

Or you can just use firebase.

3 f1.micro nodes k8s on GKE for hobby side projects:)
So how much does this cost you on average?
Amazon API Gateway + Lambda, managed by Serverless Framework. Practically free to use for small purposes.

For static content that can be (re)published as needed, I'd use S3 + CloudFront and a scheduled or triggered Lambda that handles the publishing.

IBM Bluemix used to have a free tier for containers, which you could use to run tiny apps quite easily and cheaply, using the native Docker CLI. They've since moved to Kubernetes and still have a free tier, but not sure how that works.

I'd probably recommend a DigitalOcean VPS though. Cheap, very stable (had a couple VPS for a year with 100% uptime, as far as I know), stellar support and a lot of new functionality being added lately - block storage, firewall, load balancing. DO is one of the best services I've paid for.

Disclosure: I used to work at IBM about a year ago, in the container service team.

Redhat's OpenShift 3 runs containers on Kubernetes under the covers. So far we haven't found a way to directly manage OpenShift via kubectl.
Huh? You can just use kubectl. Maybe I am missing something.
I think that I'm the one that's missing something!
StdLib seems like an awesome alternative in this space:

https://stdlib.com/

I've seen the founder setup some impressing services in a matter of minutes.

AWS ECS less powerful than k8s, but easier to configure for high availability, multi AZ/region, etc.
Docker containers running on hyper.sh

I love their docker-like CLI.

CloudFormation -> RDS + Elastic Beanstalk + Lambda.

Formerly Heroku, but now only for toy projects: their approach to pen testing and the insecurity of their Postgres setup count heavily against them, and they're expensive (I keep meaning to write a blog on these points ...)

I have a few services running on Heroku. Not a favourite amongst many but I've been using it for a while and it works well for me.