Showing posts with label azure. Show all posts
Showing posts with label azure. Show all posts

2021-12-18

Coolest PaaS/IaaS I've ever use: Jelastic

So, I'm looking an simplest deployment strategy for my next side project, I don't want to use Kubernetes since I'm all alone XD, learning Nomad, WayPoint, Swarm, and other popular tool to make it easy like Portainer, but why they doesn't make it just as simple as Vercel or Fly.io). Also don't want to use big cloud providers (GCP, AWS, Azure, etc) which the UI quite sucks like everything developed by different team with lack of communication and you have to do a lot of setup hassle just to deploy simple things. Then I found a really cool product called Jelastic, that fit my needs:
  1. Can autoscale out (like AWS ELB/ECS, GCR, ACS, etc) and auto-clustering (as easy as CloudSQL or AWS RDS/Aurora, but can be automatic)
  2. Can autoscale up '__') without downtime, only took 1 second to scale up from 1 core 640MB to 16 core 32GB (seems like they only changing container's resource quota limit) but you can see the changes directly without restart
  3. Can deploy VPS on the same cluster/network (for my databases, since I don't use "standard/popular" databases) and it's super cheap (it only took 3.9$ per month to deploy a VPS with 1 static IP, and can autoscale up), you only need to pay what you utilize (CPU and RAM usage), not charged 100% when server up unlike other VPS providers
  4. The UI doesn't sucks XD you can WebSSH, normal SSH (as long as have real IP), easy SSL setup, super easy to change config, the lacking part about Jelastic probably configfile/gitops-based setup (for working with multiple members in the future) at least there's API and CLI to create and modify environment, not sure if there's auditing available (haven't checked yet). 
  5. Can also deploy automatically from git (checked every N minutes) or CI pipeline or using CLI.
  6. Easy to move (live migration) to different providers, change ownership of a cluster, or if it's not enabled, at least there's no vendor locking, you can also manually export and import environment (for example copying staging setup to production has similar architecture just different deployment branch and scaling strategy).


Other cool things that I won't use: deploying any-container/docker-based with easy steps, deploying kubernetes, bunch of stack in marketplace provided (may vary on different provider).

For 3.9$ (if you utilize only 1%) per month (16 core, 32GB RAM, 200 GB NVMe VPS, 1 static IP, provider: ToggleBox), you can get the greenest (highest on average) result among all VPS I've ever tried:


You can see the raw benchmark result here and recap here.

What's the catch?
  1. It's quite expensive if you utilize 100% (around 339$ if you use ToggleBox for the specs above), for comparison:
    1. cheapest highest spec Contabo's VPS (9 core, 60GB RAM, 1.5TB SSD) unmetered bandwidth only cost $55-ish per month (not apple-to-apple since it's different spec and performance, also this is what you should pay per month regardless your utilization)
    2. similar spec GCE n1-custom-16-32768 (16 core, 32GB, 200GB SSD) non-committed, cost $525 excluding bandwidth
    3. similar spec AWS EC2 a1.xlarge (16 core, 32GB RAM, 200GB gp2 SSD) on-demand, only cost  $317 excluding bandwidth
    4. similar spec Azure F16s (16 core, 32GB RAM, 256GB SSD) pay-as-you-go, cost $634 excluding bandwidth
    5. cheapest OVH on SG (8 core. 64GB RAM, 400GB SSD) only cost $135 with unmetered 200Mbps bandwidth
    but still, this is way cheaper for minimum usage than if you use GCR you will be billed around ~$10 per month for idle instance, or ~$37 for standby instance (for 1 VCPU, 1 GB RAM, not including bandwidth that quite pricey $0.085)
  2. Some provider have different "free" tier, for example ToggleBox give free 2GB bandwidth per hour (GCR only give free 1GB per month XD), some other provider give free 1 static IP, some other provider give free 10GB disk usage per hour, etc.
  3. License might be pricey if you install it on your own cluster instead of using the already provided (eg. DewaCloud or CloudKilat for Indonesia region, ToggleBox for US region, etc), but they have profit sharing model if you are a reseller (have your own VPS and rent it).
  4. The billing is hourly (so you will always billed at minimum 1 cloudlet -- specs of 1 cloudlet can be vary per provider), compared to for example GCR that use second as minimum billing resolution (VCPU, GB RAM, Requests, and Bandwidth).


That's it for now, I'll create a new post if I found something better.

2021-08-05

You don't need Kubernetes

Everyone using kubernetes, even they don't have to, which adds additional complexity. In this article we will discuss when we need Kubernetes, and when we don't, and what's the alternative?

When you need Kubernetes?
  1. If you have lot of teams (>3, not 3 person, but at least 3 teams) and services, it's better to use Kubernetes or any other orchestration service to utilize your servers
    Why? because that way they can deploy each services independently, and service mesh management is far easier if using orchestration.
    Alternative? use Nomad or standard rsync with autoreloader (eg. overseer if you are using Golang) or if you are using dynamic languages (or old CGI/FastCGI) that are not creating own web server usually you don't need an autoreloader since source code on the server anyway and will be autoreloaded by the web server
  2. If you have more than 3+ powerful servers, it's better to use Kubernetes or any other orchestration service 
    Why? with orchestration service we can binpack and fully utilize those servers better than creating bunch of VMs inside the servers
    Alternative? use Ansible to setup those servers, or Nomad to orchestate, or create a script to rsync to multiple servers
  3. If you need canary or A/B deployment
    Why? creating canary-like deployment manually (setting up load balancer to send a percentage of request to specific nodes is a bit chore)
    Alternative? use Nomad and Consul service registry
  4. When you are using slow programming language implementation that the first bottleneck is not database but your API/Web requests implementation
    Why? normally if you code using compiled programming language, the bottleneck is not the network/number of hits, but the database, which usually solved with caching if it just read, or CDN if static files. But when you are using slow programming languages (eg. Ruby, Python, PHP5, etc), you mostly will hit bottleneck on the API/Web requests side first before the database. So you'll need to spawn additional pod to handle those requests.
    Alternative? Amazon AutoScaling, Google Cloud AutoScaling Group, Azure AutoScale, or just do a capacity planning and scale up/out manually before the peak season (eg. Black Friday, Christmas,  discount day, etc) and scale down/in after peak season ends.
When you don't need Kubernetes?
  1. When you only have a little <=3 or bunch of least powerful servers that are utilized well.
    Seriously you don't need it, just a simple rsync script (either manual or in CI/CD pipeline) or Ansible script would be sufficient
  2. When you are alone or in a small team (no other team), writing modular monolith is fine until it's painful to build, test, and deploy, then that's the moment that you will need to split to multiple services.
  3. When you only have production and test environment without A/B or canary deployment.
    Again, Kubernetes will be totally overkill in this case.
    1. always cache reads
    2. prepare for nth server when it's already 70% load (you need to provision a new node anyway if kubernetes also hit the load), either manually or use cloud providers' autoscaler
    3. put slow tasks/computation as background job, so web services could always respond fast. Even when you have autoscaler for APIs/web services, if the bottleneck is the database or I/O (which is more likely than the processor/computation), it would be totally useless.
  4. When you don't want Kubernetes to be the 30% overhead your servers, use lightweight orchestration and service discovery instead, like Nomad with Consul.
Well, for the last part, you are mostly don't need Kubernetes, don't be eaten by the hype, especially if you deploy databases on the pod, it's unstable AF, you don't need to automatically scale out/in the databases anyway (usually scale up if the database product is quite hassle to scale out), it would be a crazy thing to move around gigabytes of data because the automatic scaling. I hope this article could help people that started to build their startup to start provision with proper capacity planning and releasing instead of prematurely optimize their architecture and infrastructure with Kubernetes.

FAQ

So, what are your qualification saying this?
I worked for small companies (<7 engineers) and huge companies (700+ engineers) that are both using Kubernetes, and I realized the difference why one is a must, and why the other one is just decision based on hype.

EDIT

I found something that even simpler than nomad/waypoint/kubernetes, jelastic! see the demo video here.

2015-12-21

If Programming Language were Woman

A sexist joke..


PHP is your teenage sweetheart, the girl you first awkwardly fumbled around with that one summer. Just don't try and start a more serious relationship - this girl has serious issues.

Perl is PHP's older sister. She might be a bit old for you, but she was pretty popular back in the 90s. In a long-term relationship with Larry Wall, so her standards have dropped, and she's looking seriously fugly now. "I don't care what y'all say, I still love her!", he says. No-one else does.

Ruby is the cool kid of the scripting family. When you first saw her, she took your breath away with her beauty. She was fun, too. At the time she seemed a bit slow and ditzy - though she's matured a lot in the last few years.

Python is Ruby's more sensible sister. She's elegant, classy, and sophisticated. She's perhaps too perfect. Most guys are like "dude, how can you not like Python!?". Sure, you like Python. You just consider her the boring version of the edgy and romantic Ruby.

Java is a successful career woman. Some people who've worked with feel she owes her position less to ability and more to her knack for impressing the middle-management types. You might feel that she's the sensible type you should settle down with. Just prepare for years of "NO THAT DOESNT GO THERE GOD YOU ALWAYS USE THE WRONG TYPE INTERFACE AND YOU MISSED A SEMICOLON" nagging.

C++ is Java's cousin. Similar to Java in many ways, the main difference being she grew up in a more innocent time and doesn't believe in using protection. By "protection", I mean automatic memory management, of course. What did you think I meant?

C is C++'s mom. Mention her name to some old grey beard hackers and they're sure to reminisce with a twinkle in their eye.

Objective C is another member of the C family. She joined that weird church a while back, and won't date anyone outside of it.

Haskell, Clojure, Scheme and their friends are those hipster, artsy, intellectual girls you probably spent a blissful college summer with a few years ago. The first girls who really challenged you. Of course, it could never have become something more serious (you tell yourself). Though you'll always be left asking "what if?"

You might be put off C# due to her family's reputation. But they've gone legit, the last few years, they tell you. Once you're one of us, you're one of us, you hear? You need a database? Her brother MSSQL will hook you up. Need a place to stay? Heck, her daddy will even buy you your own mansion on Azure avenue. What's that, you're having second thoughts about all these overly friendly relatives? No, you can never leave. You're part of the family, now, ya hear?

Javascript - hey, wasn't that the girl you first kissed, way before even PHP came on the scene? I wonder what she's doing now. I hear her career's really taken off in the last few years. Would be cool to catch up some time, if only for old time's sake... (You catch sight of her, dressed head to toe in designer jQuery)... wow, somebody grew into a beautiful swan...e else does.

Reblogged from utest.

Let's add some more..

VB, C#'s little sister that easier to talk to, she was quite ugly back then (VB6).

Go, new kids on the block, quite mature for her age.

Delphi, the successful career woman that anyone forgotten or leave for family reasons, but deep down inside we know that we could achieve more with her.

Check the previous blogpost about if programming language were religion.