Rails

Rails

Application and Data / Languages & Frameworks / Frameworks (Full Stack)
Managing Director at Bettison.org Limited·
Shared insights
at

In 2012 we made the very difficult decision to entirely re-engineer our existing monolithic LAMP application from the ground up in order to address some growing concerns about it's long term viability as a platform.

Full application re-write is almost always never the answer, because of the risks involved. However the situation warranted drastic action as it was clear that the existing product was going to face severe scaling issues. We felt it better address these sooner rather than later and also take the opportunity to improve the international architecture and also to refactor the database in. order that it better matched the changes in core functionality.

PostgreSQL was chosen for its reputation as being solid ACID compliant database backend, it was available as an offering AWS RDS service which reduced the management overhead of us having to configure it ourselves. In order to reduce read load on the primary database we implemented an Elasticsearch layer for fast and scalable search operations. Synchronisation of these indexes was to be achieved through the use of Sidekiq's Redis based background workers on Amazon ElastiCache. Again the AWS solution here looked to be an easy way to keep our involvement in managing this part of the platform at a minimum. Allowing us to focus on our core business.

Rails ls was chosen for its ability to quickly get core functionality up and running, its MVC architecture and also its focus on Test Driven Development using RSpec and Selenium with Travis CI providing continual integration. We also liked Ruby for its terse, clean and elegant syntax. Though YMMV on that one!

Unicorn was chosen for its continual deployment and reputation as a reliable application server, nginx for its reputation as a fast and stable reverse-proxy. We also took advantage of the Amazon CloudFront CDN here to further improve performance by caching static assets globally.

We tried to strike a balance between having control over management and configuration of our core application with the convenience of being able to leverage AWS hosted services for ancillary functions (Amazon SES , Amazon SQS Amazon Route 53 all hosted securely inside Amazon VPC of course!).

Whilst there is some compromise here with potential vendor lock in, the tasks being performed by these ancillary services are no particularly specialised which should mitigate this risk. Furthermore we have already containerised the stack in our development using Docker environment, and looking to how best to bring this into production - potentially using Amazon EC2 Container Service

READ MORE
8 upvotes·748.6K views
CTO at My Job Glasses·
Shared insights
on
RollbarRollbar
at

After splitting our monolith into a Rails API + a React Redux.js frontend app, it became a necessity to monitor frontend errors. Our frontend application is not your typical website, and features a lot of interesting SPA mechanics that need to be followed closely (many async flows, redux-saga , etc.) in addition to regular browser incompatibility issues. Rollbar kicks in so that we can monitor every bug that happens on our frontend, and aggregate this with almost 0 work. The number of occurrences and affected browsers on each occurence helps us understand the priority and severity of bugs even when our users don't tell us about them, so we can decide whether we need to fix this bug that was encountered by 1k users in less than a few days days VERSUS telling this SINGLE user to switch browsers because he's using a very outdated version that no one else uses. Now we also use Rollbar with Rails, Sidekiq and even AWS Lambda errors since the interface is quite convenient.

READ MORE
9 upvotes·495.1K views
CEO at StackShare·
Shared a protip
on
StripeStripe
at

We've been using Stripe for a while to charge our customers (mostly for the ads you see on StackShare), but we only recently realized that you can actually invoice and charge customers all through Stripe's UI 😱

You just need a customer's email address, then you add them as a customer and create a new invoice and send it to the customer- all via the Stripe dashboard. The customer then gets an email with a link to the pay the invoice (via credit card, ACH, or wire transfer). Once the customer clicks the link in the email to pay they're taken to a page hosted at pay.stripe.com where they can download a PDF of the invoice and pay via credit card, or ACH/wire transfer.

Nevermind the fact that we built an entire Rails app to do all this 😒 We'll be sunsetting our payments app soon. I wish someone had told us about these features sooner! I doubt they had this when we first built the app but we could have stopped using/maintaining the app a while ago. Stripe is amazing. That is all.

#invoicing #payments

READ MORE
9 upvotes·5 comments·103.8K views
David Gorcey
David Gorcey
·
July 19th 2019 at 9:31PM

Yeah, even people with no accounts receivable/billing experience like me find it pretty easy. I'd recommend it if you're handling billing for whatever project you're working on as an easy way to make sure you get paid. 🤑

·
Reply
Christopher Wray
Christopher Wray
·
March 12th 2020 at 9:00PM

Wow. Where is the docs for this? Sounds great!!

·
Reply
Yonas Beshawred
Yonas Beshawred
·
March 12th 2020 at 9:56PM

It's amazing! Docs: https://stripe.com/docs/billing/invoices/hosted

·
Reply
Christopher Wray
Christopher Wray
·
March 12th 2020 at 11:02PM

Thank you! And feel honored you responded to my comment. Sweet app you have here.

·
Reply
Yonas Beshawred
Yonas Beshawred
·
March 13th 2020 at 4:20AM

My pleasure! Thanks a lot for being a part of the community :)

·
Reply
Shared insights
at

I'm working as one of the engineering leads in RunaHR. As our platform is a Saas, we thought It'd be good to have an API (We chose Ruby and Rails for this) and a SPA (built with React and Redux ) connected. We started the SPA with Create React App since It's pretty easy to start.

We use Jest as the testing framework and react-testing-library to test React components. In Rails we make tests using RSpec.

Our main database is PostgreSQL, but we also use MongoDB to store some type of data. We started to use Redis  for cache and other time sensitive operations.

We have a couple of extra projects: One is an Employee app built with React Native and the other is an internal back office dashboard built with Next.js for the client and Python in the backend side.

Since we have different frontend apps we have found useful to have Bit to document visual components and utils in JavaScript.

READ MORE
22 upvotes·2.9M views
AVP - Business at VAYUZ Technologies Pvt. Ltd.·
Needs advice
on
Node.jsNode.jsPythonPython
and
RailsRails

Hi Community! Trust everyone is keeping safe. I am exploring the idea of building a #Neobank (App) with end-to-end banking capabilities. In the process of exploring this space, I have come across multiple Apps (N26, Revolut, Monese, etc) and explored their stacks in detail. The confusion remains to be the Backend Tech to be used?

What would you go with considering all of the languages such as Node.js Java Rails Python are suggested by some person or the other. As a general trend, I have noticed the usage of Node with React on the front or Node with a combination of Kotlin and Swift. Please suggest what would be the right approach!

READ MORE
Neobank - Wikipedia (en.wikipedia.org)
22 upvotes·702K views
Replies (9)
Recommends
on
Serverless

Use the language which works well for the developers you have or have available. If you're starting, building a first iteration is far more important than worrying about what language might be best to solve a problem you may never have.

When hiring, look for developers, not "node developers" or "java developers" having people who recognise and are willing to adapt means you can have the flexibility you will need to solve as-yet unforeseen issues. Hire people who are wed to a specific language and you will be bound to that language, regardless of whether it's most appropriate or not.

READ MORE
42 upvotes·1 comment·132.2K views
Shivam Bhargava
Shivam Bhargava
·
March 26th 2020 at 7:43AM

Hey! Thanks for the response. I do agree with this line of thought, currently I do have an established team of Folks who are pretty good at NodeJS and related stacks (MEAN, MERN, Meteor etc.) along with expertise in Flutter, Native Apps along with AWS as well. I think this would constitute the core App and then integrations all across can take place. Would you have any reading material on the Serverless front in relation to Neobanks / Digital Banking platforms? Thank you.

·
Reply
Recommends
on
Rails
in

For online banking, it'll be less computation intensive and more data intensive. So, Rails will be better than Python. I'll not recommend Node.js as it's not as scalable as those. If I had to choose indepently I would took Go.

READ MORE
19 upvotes·5 comments·132.3K views
Mikael Sand
Mikael Sand
·
March 27th 2020 at 9:48PM

What measurements do you base the scalability conclusion / comparison of python, ruby (rails), and nodejs on?

·
Reply
Shaswata Das
Shaswata Das
·
April 1st 2020 at 12:46PM

nodejs maintains concurrency by events, it's common sense that a single thread would never be able to equivalent of multi-thread.

Now, let's talk about Ruby vs Python.

Python requires the developer to be clean about side effects and isolation. With Ruby one can write concurrent programs that operate on multiple cores easily, similar to Python, a developer is responsible for side effects and isolation issues. Python’s concurrency process is more resource-demanding as compared to Ruby. But then again, it boils down to developer coding habits if one has to take the cake offered by both Python and Ruby Performance languages.

·
Reply
Mikael Sand
Mikael Sand
·
April 1st 2020 at 3:55PM

Seems like a banking system would have its scalability depend more on the transactional database in use, rather than the choice of language used for the api layer, which probably just translates from/to http+json or whatever transport and message standards used, to some atomic sql / db query in a transaction and serialising the response. Seem unlikely there would be any need for shared memory multi-threading in the api layer. Node.js could probably be used just fine, e.g. with PostGraphile on top of PostgreSQL. It seems very unlikely to be the bottleneck.

·
Reply
Shaswata Das
Shaswata Das
·
April 2nd 2020 at 8:59AM

In case of online banking, bottleneck may occur. I'd rather prefer isolated hybrid database API, that'll better than PostGraphile. For security issues, I'll not recommend any GraphQL API in online banking application, also it'll not be helpful in this scenario. It's true that "a banking system would have its scalability depend more on the transactional database in use", but when it's about online banking it's not only about transaction, I bet, they've more to offer to their clients. So, scalability on api layer is also important for this case.

·
Reply
Varun Sharma
Varun Sharma
·
April 22nd 2020 at 9:51AM

Brother I have been working in Ruby on rails and nodejs from last 3 years. From my experience it is easy to scale nodejs as compared to Ruby and it even requires less resources for deployment as well. This was one of the reason why linkedin shifted their stack from Ruby on Rails to Nodejs.

·
Reply
View all (9)
FullStack Dev at Nouvelles Donnes·
Needs advice
on
Node.jsNode.jsRailsRails
and
Rails APIRails API

Currently working on my company's new saas, the main goal is to manage content and user. I'm familiar with the rails framework and how it is easy to code and deploy. The thing is I'm the only dev on the project, and in terms of the tech stack, there is no preference. However, because Node.js is everywhere and there is enough dev on the market, I am stuck between choosing Rails or Node.js. I don't mind implementing Vue.js or React on the frontend, but I need a solid argument to explain to people that aren't necessarily tech-savvy as to why we should choose Rails over Nodejs.

READ MORE
3 upvotes·365.3K views
Replies (6)
Recommends
on
Node.js

You are probably referring to ruby on rails for web development and nodejs for building the backend. Nodejs has frameworks such as express and next which not only provides a minimal code to build a backend but also gives the flexibility to try and experiment with the framework choices. For example you can have express framework + Passport for OAuth .... etc. The flexibility and the constant improvement of the language provides a good reason to opt for nodejs. Nodejs uses javascript which makes your code uniform when you are working full stack i.e react in front end and nodejs in backend.

READ MORE
7 upvotes·2 comments·319.3K views
Max Loua
Max Loua
·
June 17th 2020 at 2:08PM

I'm familiar with Nodejs, express and vue, i have worked on a coupled of project with those stacks. my question was mainly towards how can i explain to a group of people (my supervisors) that arent tech savvy why working on rails is good for such product which is small and im the only dev on it. the goal is to dev it using rails api for the backend with a vuejs frontend.

·
Reply
Niket Kulkarni
Niket Kulkarni
·
June 17th 2020 at 8:58PM

You can tell them by showing the google trends , the manner in which nodejs has taken over ruby on rails over the years. You can show the amount of support that has been gained in the community when nodejs is being used and lastly you can tell them that nodejs is blazing fast due to v8 engine on which it runs.

·
Reply
Recommends
on
Rails API

I'd use the following metaphor to non-technical people. Rails is like a prepackaged toolkit, which can get most of the common tasks done fairly with ease. Whereas, node.js with whatever backend framekwork of choice, is like a DIY toolkit assembled by mix-and-match different tools in a large tool shop. Of course, at times DIY toolkit can do better on specific tasks. Given that you are the only dev on the project, I'd assume that the resource is fairly limited. And looks like you are not building some next-gen super duper fast smart application. So Just go with the prepackaged toolkit then. Rails is a very opinionated framework, there're pros and cons to it. But thanks to that, many of the gems are coded with it in mind. For example, they are all designed with same naming convention. Many will work well together out-of-box, for example devise and cancancan. Besides, many stuff are built in the framework. For example, logging utility, csrf protection, session encryption, etc. Yes, many of those stuff may not be useful or necessary at the beginning of the project life-cycle. However, down the road, there is a good chance you will need some of those. And the moment you realize that you already have it, it's so delightful. In addition, it's usually easier to debug a rails app than a node app in my experience. Personally, the cases where I would pick node.js over rails would be projects either require a) high-performance, or b) certain core functionality that has been implemented by some node packages but not by any ruby gems. In term of performance, node has a clear advantage over any other major web frameworks, except the ones built with go. It's simply a language feature. Node allows developer to easily write code that runs db query, external api calls, or other stuff of that nature in parallel. And that is THE MOST COMMON performance bottleneck of web applications.

READ MORE
6 upvotes·319.3K views
View all (6)
Software Developer at Nouveta·
Needs advice
on
PumaPuma
and
UnicornUnicorn

I have an integration service that pulls data from third party systems saves it and returns it to the user of the service. We can pull large data sets with the service and response JSON can go up to 5MB with gzip compression. I currently use Rails 6 and Ruby 2.7.2 and Puma web server. Slow clients tend to prevent other users from accessing the system. Am considering a switch to Unicorn.

READ MORE
4 upvotes·27.2K views
Replies (1)
Recommends
on
Puma

Consider trying to use puma workers first. puma -w basically. That will launch multiple puma processes to manage the requests, like unicorn, but also run threads within those processes. You can turn the number of workers and number of threads to find the right memory footprint / request per second balance.

READ MORE
3 upvotes·17K views
Software Engineer ·
Needs advice
on
JavaScriptJavaScriptNext.jsNext.js
and
RailsRails
in

I've inherited a monolithic Rails app for an MVP product. We're planning to slowly migrate away from RoR to build the remaining parts of the app. App requirements: - Video streaming w/ audio - Real time chat - User authentication & roles - Payment system Performance, scalability, and attracting dev talent(s) are important to our team.

I'm considering the microservices approach, SSR + CSR & caching with Next.js (prefer Svelte-kit but it's in beta). I also prefer to keep this a full JS household. What other JavaScript frameworks/libs would you recommend? Keep in mind the existing RoR will not be deprecated. We'll be consuming the APIs and slowly moving away from them until they can safely be deprecated.

READ MORE
6 upvotes·32.2K views
Replies (2)
CTO at JetThoughts·
Recommends
on
Rails
Stimulus

Moving from Rails will reduce development velocity (if you want to have easy support and update the app) and will require more skilled (expensive) developers to support it.

Without previous experience (5+ years) do not suggest moving to node.js. That code will easily become hard to learn and support.

You always can implement microservices with Ruby, but this approach should be considered only after Series-A and when you will have more than 5 developers and dedicated SRE/DevOps.

READ MORE
7 upvotes·29.9K views
Full-stack Developer && Software Engineer at Self-employed·

I see it's been some time since this was posted, but I'm glad you are migrating to Next.js 🎉!

Me personally, I would run an Express.js backend so that frontend and backend logics don't feel blurred, especially if you want to attract more developers to your project. Keeping frontend separated from the backend makes for a healthier workspace ecosystem and often confuses people less. Furthermore, implementation is a lot easier and later on as you move from RoR to an Express.js server there won't be too much confusion as to how certain parts mesh together.

Based on the features you're looking at I would consider using websockets (WSS or Socket.IO) for the chat application or rolling that with features from WebRTC, which you would need to support video streaming anyways. For authentication you could look at Auth0 which has some very nice libs for authentication or you could rig up your own stitching individual OAuths (Google, Facebook, etc.) along with a simple User/Pass signup that you manage in your database. For payment I would consider using Stripe, it's very popular in the JS ecosystem right now, has lots of documentation and features, and is also pretty cost-effective.

I know it's been some time since you have posted this and you have already made some decisions, but if you (or anyone else reading this) has any question feel free to let me know :)

READ MORE
4 upvotes·18.8K views
Needs advice
on
DigitalOceanDigitalOceanRailsRails
and
ReactReact

Hi there,

I'm looking to build up my own Auto Deployment tool for internal purposes (example deployhq.com, deploybot.com). I'm confused as to what tech stack I should use for the entire platform. My primary concerns are running parallel and concurrent builds to different targets (servers).

I have been researching and thinking of using Rails as backend and React as front-end (both deployhq.com and deploybot.com are built on these stacks).

Please advise.

READ MORE
6 upvotes·16.1K views
Replies (3)
Recommends
on
Jenkins
React

Hi Akshay,

If the goal is to have a system that is purely to be used within your company, then it would be a good idea to have something scrappy. However, lot more has to be considered if you are planning to offer it as a SaaS or PaaS.

In either situations, the first factor I would consider is Return of Investment. You can build a really fabulous system, but if it is only going to help you little bit in the overall scheme of things, it may not be worth the effort. In other words, you can build - job management, scheduling, progress tracking, auto recovery, maintaining container state etc all by yourselves, but it may be worthwhile not reinventing the wheel when these solutions are already available (Jenkins or Team City for example).

If I were you, I will offload majority of the features like triggering jobs (build jobs), monitoring progress, errors etc to Jenkins. Every deployable unit can be dockerized, so that you get an uniform interface to validate whether the service is up and running.

You can build a thin vanilla UI on top of Jenkins' apis using React, or simply jQuery or Svelte. My personal preference would be Svelte.

If Jenkins is not a viable option, Go is the perfect backend for anything related to devops. You can use any Golang frameworks (Gin or Beego for instance) and have a front end in React / jQuery / Svelte. Hope this helps.

READ MORE
4 upvotes·9.9K views
Recommends
on
Rails

I guess the bigger question is why are you building your own auto deployment tool for internal use? Assuming that is a good idea, I think this depends on how quickly you can develop what you need in a language and framework that you are comfortable with, choose that over everything at this stage. You could build what you need using rails easily and anything that needs to run as a backend process for builds etc can be farmed out as a job somewhere and can be as simple of complex as you like. You can even have those jobs spooling up docker tasks with an entire rails stack in to to do what you need. In summary, have your front end create jobs with enough data in to go build stuff, then queue up those builds with something job like. The jobs can be simple rake tasks or entire docker containers doing anything you like. Perhaps take a look at rails, shoryuken for queueing on AWS, AWS Elastic Container service for actually doing the jobs.

READ MORE
3 upvotes·9.8K views
View all (3)
Needs advice
on
DjangoDjangoPythonPython
and
RailsRails

Hi, I'm kinda confused here. Need to know which is better for a Secure Future. Django or Rails. Thank you!

READ MORE
2 upvotes·630 views