SAAS architecture with rails

I am planning a basic architecture for new software, which should be modular. I am trying to define an application for tiered applications to run a single instance for all users.

I need the ability to scale when and where it is needed, so I do not like the idea of ​​creating several applications (monolithic-architectural) behind a load balancer, when this can be one part of the calculations that requires more resources.

So, I’m thinking about a service-oriented architecture, it will have a rails application as a web client and other services that can be practically written in any language and accessible through the API through the rails application.

I would also like these APIs to be open to users to integrate with their existing software and easily extend these services.

I have a specific question:

  • Would it be nice to have such an architecture for a new launch (1-5 employees)?
  • using the APIs, I don’t need to use any RPC, since the API request itself is RPC, do I stick to this concept correctly?
  • What would be a good standard for an API (REST only defines HOW to access resources)?
  • What could be, rightfully, the best (= good) way to expose these APIs to clients? Via a Web Rails app? Directly through a proxy server, which makes them available in the same domain? APIs will be accessible through RESTful, therefore through HTTP requests.
  • with such an architecture would it be cheaper to have a VPS, Cloud or dedicated servers? I like the clouds because of their incompatible nature, this will save us from worrying about the persistence of data and backups (including the fact that we want to build the architecture almost 100% affordable).
  • Any other suggestion or point of view, and any simple point starting to think about it will be greatly appreciated.

I know Python, C / C ++, JS, Perl, other PL very well, and I recently started working with Ruby / Rails. I choose this last one because it seems to me that this community is strongly focused on creating services and what I mean (before these extreme performances) is the ability to learn as soon as possible, and to share experience and learn, also with practical ones examples (I know this about the architecture, not the PL that implements it, but I think it would be easier to make a mistake in an immature environment that still works with the web1 or web2.0 style).

PS I also need to write a basic architecture design, do you have a template with which I can start? I need to share it with my team and other professional professionals, I would like it to be complete and understandable.

Hope to read the good suggestions here guys!

Thanks, Alex.

+4
source share
1 answer

Architecture

Here is an example stack that I think will basically do what you want to execute:

Cluster

  • One or more application servers
  • One or more database servers
  • Zero or more production servers

<strong> Instances

  • Chef for configuration
  • Unicorn or passenger
  • Nginx

Application

  • Ruby on Rails
  • Check Grape for Simple APIs

Additional answers

  • Would it be nice to have such an architecture for a new launch (1-5 employees)?

    If done correctly, this approach can be very stable and reliable. What you do not want to do gets into a situation where you spend all your time managing servers. You want to get it, you can quickly deal with situations and work to ensure that your application does everything. If you do it right, instantiation can be simple and fully automated.

  • using the APIs, I don’t need to use any RPC, since the API request itself is RPC, am I correct this concept?

    Yes.

  • What will be a good standard for the API (REST only defines HOW to access resources)?

    Here we need to clarify a little how you need to use RESTful design to achieve specific goals.

  • what could be, by right, the best (= good) way to expose these APIs to clients? Via a Web Rails app? Directly through a proxy server, which makes them available in the same domain? APIs will be accessible using RESTful, therefore through HTTP requests.

    The domain (or subdomain) must be accessible through HTTP and RESTful software development. This may return JSON or something else. It all depends on you.

  • with such an architecture would it be cheaper to have a VPS, Cloud or dedicated servers? I like the clouds because of their incompatible nature, this will save us from worrying about the persistence of data and backups (including the fact that we want to build the architecture almost 100% affordable).

    You get what you pay for. I would recommend cloud servers. Check out Heroku to get started, or Rackspace if you're ready to “collapse your own.” Or a motor yard.

  • Any other suggestion or point of view, and any simple point, starting to think about it would be greatly appreciated.

    I would try to create a test API using something like a free Heroku account.

+1
source

Source: https://habr.com/ru/post/1414502/


All Articles