1

I am new to this, what is a best approach to implement microservices?

I found fw like seneca but it is little bit confusing...

Is there any tut how to create jwt auth, mongodb and other staff in microservices?

Vladimir
  • 1,751
  • 6
  • 30
  • 52

3 Answers3

1

Take a look on Docker.

With docker-compose you can play with several services with an easy integration without worrying about the IP addresses to connect them.

Also if you add nginx to your stack, it's gonna be very easy to scale those services, there are several videos and tutorials that you can lookup to help you get started.

I've heard aboutseneca, but I haven't used, I think you shouldn't depend on a specific framework because one of the ideas behind of Microservices is the low coupling.

calbertts
  • 1,513
  • 2
  • 15
  • 34
  • Thanks, I also tought I can solve all with `docker` and `docker-compose`... Could you send me that tuts? Also did you heard for `kubernetes.io` how it can help? – Vladimir Apr 18 '17 at 16:39
  • The first video that helped me to understand the basics: https://www.youtube.com/watch?v=HJ9bECmuwKo And after that, I found this repo to automate the nginx stuff: https://github.com/jwilder/nginx-proxy Go the the basic things, like in the first video, that's gonna give you the way to go. I haven't used Kubernates, what I know is that it's the "Google way" for microservices orchestration, it looks like and advanced tool specially for monitoring, but at the end you will need to pay for it, anyway, you can try it out and see what of them fit better for your needs. – calbertts Apr 18 '17 at 18:13
  • Thanks, one more question in this post: https://www.airpair.com/scalable-architecture-with-docker-consul-and-nginx I found that he use consul and consul template for what it use? – Vladimir Apr 18 '17 at 19:43
  • You don't need an external DNS server for service discovery, because with `docker-compose` you already have it. I don't know anything about Consul, but if it's related with service discovery and DNS it isn't necessary at least to get started. – calbertts Apr 18 '17 at 20:45
  • Thanks, I tried `nginx-proxy` repo, I have some question here: http://stackoverflow.com/questions/43483753/how-to-change-nginx-proxy-settings it would be great if you can help – Vladimir Apr 18 '17 at 23:20
0

To make the jump into the real micro-services world is not trivial. It's not about plumbing some APIs, but a radical change in architecture thinking that, well, at the beginning will make you a bit uncomfortable (e.g. every service with its own database) :)

The best book I have read so far about micro-services is The Tao of Microservices, by Richard Rodger the author of Seneca himself. It exposes very well the shift from monolithic and object-oriented software towards micro-services.

I have personally struggled a bit with Seneca because of the average quality of documentation (inconsistencies, etc...). I would rather recommend Hemera, which took its inspiration from the message-pattern approach from Seneca, but is better documented and much more production-ready.

Digital Stoic
  • 1,229
  • 11
  • 20
  • I tried `Seneca` but I don't like the way code is written... What are benefits from `Seneca` or `Hemera` in opposite `nginx docker-compose` approach? – Vladimir Apr 19 '17 at 11:01
  • @Vladimir `nginx` and `docker-compose` are the _infrastructure_ layer of your application stack. `Seneca` or `Hemera` suits well for the _business model_ layer when the _business domain_ is complex. For instance, they enable patterns such as [Command Query Responsibility Segregation](https://www.martinfowler.com/bliki/CQRS.html) (CQRS). – Digital Stoic Apr 19 '17 at 13:31
0

1) Build services and deploy it with Docker Containers

2) Let them communicate via gRPC coz it is really fast for inter services communication.

3) Use error reporter like Bugsnag or Rollbar. Error reporting is really important to catch error quickly.

4) Integrate tracing using opentracing or opencensus. Tracing is important too because it will be so hard to monitor all microservices with logs only.

Hassan Ajaz
  • 613
  • 8
  • 15