Ask HN: Do you use microservices?
7 comments
Not fully (ie in production) however a new side-project I'm working on which has many processes I'm building each as a micro-service, with RabbitMQ handling the messaging, Bunny to handle message processing and Sinatra/Faraday for where the messages are too big to send via MQ (ie when I process a 2.3Gb JSON file, I send the filename to a queue, which triggers a Faraday request by the worker to a Sinatra app to download/process the actual file)
About the only thing I need to really work on is directory/registration (at the moment I'm using .env files with the URLs to different micro-services in each micro-service, mainly as it's PoC and I'm running it all on a single box)
About the only thing I need to really work on is directory/registration (at the moment I'm using .env files with the URLs to different micro-services in each micro-service, mainly as it's PoC and I'm running it all on a single box)
What is your app doing that requires a 2.3Gb JSON file?
It's working with the Schedule data from National Rail (under their Open Data - http://nrodwiki.rockshore.net/index.php/SCHEDULE) - the "full" file for initially populating your database is around 2.3Gb uncompressed JSON (nightly updates range from 1Mb to 31M looking at the files I've got here)
I'm just curious. When dealing with JSON files that are 2.3Gb, what programming language do you use to parse it?
Ruby at the moment - my original (monolithic Rails) v0 version takes about 5 hours to process it and create database records with ActiveRecord - that's about 600,000 records - the microservices are using Oj for the JSON parsing and raw pg queries for database (so not a real comparison at the moment)
In my last two gigs the companies were adopting microservices trends. In the last job, I have architected the whole microservices architecture.
Each microservice was a Django app, messaging was handled by RabbitMQ. I used Celery as a nice framework around messaging and asynchronous processing.
There was a thin REST layer for mobile apps to consume. It was basically just an Nginx proxy with a small Python app sending tasks to remote Celery workers and returning very fast response while the logic is handled asynchronously (this is pretty cool for payment processing, sending emails, writing entries to ledgers etc).
Big advantage is this is quite easy to scale, as you can just create new EC2 instances with workers.
I have also implemented several microservices in Go last year.
Each microservice was a Django app, messaging was handled by RabbitMQ. I used Celery as a nice framework around messaging and asynchronous processing.
There was a thin REST layer for mobile apps to consume. It was basically just an Nginx proxy with a small Python app sending tasks to remote Celery workers and returning very fast response while the logic is handled asynchronously (this is pretty cool for payment processing, sending emails, writing entries to ledgers etc).
Big advantage is this is quite easy to scale, as you can just create new EC2 instances with workers.
I have also implemented several microservices in Go last year.
Do you have any recommendations on articles or books about getting started with microservices? I'm an experienced Django dev - I began using Docker a few months ago and microservices seem like the natural next step. But most of the blog posts out there about the big picture reasons to switch to microservices, I haven't found much about implementation details.
Just wondering what percentage of people here are adopting this trend of microservices? What platforms , messaging layers, protocols and patterns are you using to aid in this? What are the pain points?
I am quite heavily invested in the world of microservices and would like to see if anyone out there does it differently.
Cheers