Q: What Technologies Should I Use for Migrating a Rails Monolith to Microservices in 2020?
Thorsten Hirsch
Posted on December 23, 2019
So I have this 6 years old rails application monolith that contains all these things:
- user interface
- database
- additional tables for statistics (snowflake schema)
- API for android app
- workflow engine
- batch workers (sidekiq)
Currently I'm running 4 instances of this application, each is configured especially for the customer who's using the instance. Yes, that makes 4 customers, each has ~300 users, so we're talking about 1200 users. A virtual server with 2 cores and 8 GB RAM handles it easily. The web server is nginx and the ruby application server is passenger.
In 2020 a new UI (SPA) will be written, so I can get rid of the UI in rails. However I will have to provide an API for the SPA and it will be totally different than the API for the android app.
What a great opportunity to split the monolith into microservices!
I might split the microservices like this:
- API for new UI
- API for android app
- batch workers
- statistics
- what's left in the old rails app (business logic, workflow engine)
So far I pretty much know what I'm doing. However I don't have much experience in the microservices world, so I have a bunch of questions for you:
- What about user authentication at the API for the new UI? Are JSON web tokens the way to go?
- What about the database? Should I split it along the microservices?
- How do the microservices communicate with each other? I prefer a message bus over direct REST calls, so...?
- RabbitMQ?
- Kafka?
- Nats?
- Is it worth learning the whole Kubernetes stack? Or is docker plus docker-compose (or helm???) enough? Any other alternatives?
Actually my monolith isn't even dockerized, yet. Currently I feel overwhelmed by all the technologies I can chose from. But what's the right technology stack for rails? And for me? This rails application is only a hobby project. Any recommendations?
Posted on December 23, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
December 23, 2019