-
Create solutions that bring maximum success and value under our expert product management guidanceEnsure your product idea viability and get the right market and development strategies to succeedGet a product that directly addresses your customer needs and matches the goals of your businessBring your customers an exceptional user experience and make your product stand out with our designGet designs that amplify your product features with clear, intuitive, and sales-boosting user experienceNurture customer loyalty, boost sales, and expand your market presence with a stand-out mobile appGet higher customer satisfaction, more conversions, and better competitiveness with our UX auditCreate a custom software solution to unlimit your business capabilitiesStart and grow your startup fast or effectively renovate your existing solution with our RoR expertsExtend your product line quicker and cheaper by creating a secure, reliable, and flexible API solutionGet expert technical assistance in building real-time React-based web applications and SPAsBuild a high-performing web application with our Vue.js development company.Create robust native or cross-platform mobile apps for your business with our expert assistanceGet native-like mobile apps for both Android and iOS using the best cross-platform technologiesCreate native iOS, iPadOS, and tvOS applications to cover any of the desired Apple user segmentsCreate 99.9% crash-free native Android applications for any available device and screen typesEnsure the top quality and bug-free performance of your products by fixing all issues at early stagesConsult our experts to build an efficient quality assurance strategy for your productEnable full lifecycle software testing services to detect and fix all product issues at the earliest stageReveal all non-typical performance, security, and usability issues with our manual QA servicesBoost your overall software development velocity with our robust automation testing solutionEnsure the usability, security, performance, compliance, and compatibility of your web appsProvide your customers with mobile apps free from any usability, security, and performance issuesUse our functional testing services to ensure every product feature works as expected in all scenarios.Ensure a seamless user experience across all digital environments with our compatibility testing servicesMake technologies work for your business growth and choose the right ones to achieve specific goalsImprove app performance, setup continuous delivery, cut infrastructure costs with our DevOps servicesKeep your product stably up, running and get timely feature upgrades with our maintenance servicesClean your software from code issues and uncover possible improvements to boost its performanceEnsure security of your healthcare products and achieve HIPAA compliance with our expert assistance
-
Multi-Vendor Marketplace Online Store Custom Marketplace Telemedicine Software Chat App Custom Booking System Video Conferencing For Enterprise For StartupsBuild a custom multi-vendor marketplace fast and cost-efficiently using our MarketAge solutionLaunch a custom B2B marketplace for any type of products with MarketAgeLaunch a unique, custom-functional B2C marketplace at minimum effort with MarketAge white-lable productReduce costs to build an easy-to-use and reliable C2C marketplace using our MarketAge solutionCreate an online store with unique design and features at minimal cost using our MarketAge solutionGet a unique, scalable, and cost-effective online marketplace with minimum time to marketGet a cost-efficient, HIPAA-compliant telemedicine solution tailored to your facility's requirementsGet a customizable chat solution to connect users across multiple apps and platformsImprove your business operations and expand to new markets with our appointment booking solutionAdjust our video conferencing solution for your business needsScale, automate, and improve business processes in your enterprise with our custom software solutionsTurn your startup ideas into viable, value-driven, and commercially successful software solutions
-
Streamline and scale your e-commerce business with a custom platform tailored to your product segmentsAutomate, scale, secure your financial business or launch innovative Fintech products with our helpCut paperwork, lower operating costs, and expand yout market with a custom e-learning platformUpgrade your workflow, enter e-health market, and increase marketability with the right custom software
-
Discover our software engineering culture, what principles we follow to make our clients succeedOur BA office helps clients choose the right development strategy and get maximum value at minimum riskFind out how we manage development risks, ensure on-time delivery, and prevent budget overrunsWe create clear, intuitive, and functional designs to solve specific business problems of our clientsSee what techniques and principles we follow to engineer top-tier software products at RubyGarageSee how our QA office ensures zero usability and functional issues in every product we deliver to clientsDiscover more of RubyGarage’s culture, values, and strengthsDevelop your product in a clear workflow aimed to save your time and budget and boost the qualityJoin our team to build a successful career in software development. See open positions at RubyGarage
- Case Studies
- Blog
Ruby on Rails 4 And Symfony 2 Comparison - Testing, Modularity, Dependencies, and Scalability
In this article we’ll consider four aspects of the Ruby on Rails 4 and Symfony 2 frameworks. When building commercial products with these frameworks, we have to extend their functionality with plugins, split applications into modules, and test and scale products. Thus, we will focus on how Rails 4 and Symfony 2 manage dependencies, modularity, testing, and scaling.
Dependency management
Bundler is itself a Ruby gem, but is the most common solution for installing other gems and managing dependencies between gems and Rails applications. Bundler downloads and installs required gems into your system from RubyGems.org and then manages dependencies among them.
If you work with several projects simultaneously, you must have separate Gemfiles for each project. Specify the gems you want to include in your app – and their dependencies – in the Gemfile, and then run the following command:
$ bundle install
This will automatically download and install the libraries you specified, and Bundler will trigger an alert if there are conflicts between libraries. For example, if a gem requires the latest version of another gem to work normally, Bundler will notify you. Ruby’s Bundler also provides other important commands, for example, a command to generate a new standard Gemfile for a project.

Composer is similar to Bundler, and is used with Symfony 2 and several other PHP frameworks. Composer’s creators were inspired by Ruby’s Bundler, so their approach to resolving dependencies in PHP projects is very similar. Specify required dependencies in the composer.json file and then run the following command:
php composer.phar install
Composer differs from Bundler in a very important respect, though, bringing PHP libraries and Symfony bundles into a specific project, not into the entire system. This helps define independent environments for particular projects. With Bundler, you may need to install several dozen gems that aren’t used in one project but are necessary for others. This usually leads to conflicts, which you have to resolve by removing old dependencies, by using similar libraries or by implementing monkey patches.
In short, Composer and Bundler are both great tools that can update libraries and handle other package-related operations with ease. That’s all you need when resolving dependencies in your projects!
Modularity
Both Ruby on Rails 4 and Symfony 2 allow you to architect web apps from multiple components. This helps you build apps more quickly and replace irrelevant components more easily than if all your code is in one place. Components in Ruby on Rails are called engines, while Symfony calls them bundles.

You can think of engines as ordinary Rails plugins, although engines are more like small applications (read: more advanced than plugins). But in most respects, Rails plugins and engines have similar structures, such as the lib directory structure, and share common features.
When building a Rails app, you can take advantage of many existing engines. Here’s the top four Rails engines that we use at RubyGarage:
- Spree, an ecommerce engine for delivering web storefronts;
- Devise, an engine providing authentication for its parent applications;
- Forem, an engine for forum functionality;
- RefineryCMS, a Content Management System engine.
Many Rails engines and gems are located in the aforementioned RubyGems.org catalog, which currently offers more than 7,700 libraries.
Bundles in Symfony are also like ordinary plugins. When creating new bundles or using ready solutions in your Symfony 2 application, you have to encapsulate them using namespaces. Just add a bundle class to a namespace like this: namespace MyProject\MyFirstBundle;. This way you avoid irritating conflicts between bundles with identical names.
One of the biggest Symfony 2 bundle sources is KnpBundles.com, which currently offers almost 3,000 third-party solutions. In addition to KnpBundles, you can import any third-party PHP library to your web app from Packagist.org, which offers over 94,000 bundles.
Here’s a list of our favorite Symfony bundles that we install in almost every project:
- FriendsOfSymfony/FOSUserBundle;
- FriendsOfSymfony/FOSRestBundle;
- DoctrineBundle;
- AsseticBundle;
- SwiftmailerBundle;
- MonologBundle;
- DistributionBundle.
The bottom line is that both the Ruby on Rails and Symfony 2 frameworks allow you to create component-based applications. Many developers have already built tons of libraries to help you solve common development tasks. So if you’re looking for standard functionality, chances are that you’ll find a suitable extension for your Rails or Symfony app.
Testing
To avoid regressions (when new bugs appear after implementing new functionality) and to find existing bugs as early as possible, you have to cover your code with automated tests. If bugs are found during the production stage, this usually demands much more time and effort to fix them than if they were found when the code was initially written.
Both Ruby on Rails and Symfony can benefit from the Test Pyramid – a concept by Mike Cohn – that defines the following priority for tests:

Unit tests are easier to implement and harder to break, so use them as much as is practical. These tests check an application’s business logic code. Functional tests check how individual software modules act on their own. Acceptance tests are the most time-consuming and unreliable, requiring you to compile and check complete application builds. Therefore, it’s better to cut down on the number of acceptance tests as much as possible.
Ruby on Rails offers a built-in framework for testing called Minitest. However, the majority of Ruby developers rely on RSpec. RSpec boasts great code readability and a large community that supports many additional extensions.
Here’s an example of a unit test written in RSpec:
We can also use RSpec to write functional tests that check if Rails controllers call required services correctly and respond with necessary data. Functional tests are especially important when you need to check controllers that are APIs for other clients (such as a mobile app).
Acceptance tests for Rails check an application’s functionality from a user’s point of view. For instance, a test can fill in a registration form, submit the form, and check the response against an expected result. We use RSpec to write a scenario, and then Poltergeist or a Webkit web driver to run an acceptance test in a browser.
You can also use the Gherkin language to write such test scenarios. Gherkin allows you to literally turn functionality requirements into Gherkin code and use them as test cases, usually written by a project manager.
Check out the following code to see an example scenario written in Gherkin:
Scenario: Post article by user
Given I signed up as user
When I write article "Justin Bieber"
And text of article is "is awesome"
And I post article
Then I should see "You have no access to post articles"
Now let’s talk about testing with Symfony 2. Symfony doesn’t come with its own testing framework. Instead, this PHP framework benefits from a third-party solution called PHPUnit, and even offers an official testing guide based on this solution.
PHPUnit is a PHP testing framework introduced in 2004. Later on, the Codeception framework was also introduced on top of PHPUnit to help support the behavior-driven development approach, when an application’s code is covered with tests even before it’s written.
The following code excerpt is a unit test written for PHPUnit:
You can find other testing code on Symfony/Testing to learn more details.
Acceptance tests for Symfony 2 can be performed with Selenium Server and Selenium WebDriver, which is managed by PHPUnit tests with the help of the php-webdriver library.
At RubyGarage, we regularly practice the Continuous Integration approach with Ruby on Rails 4 and Symfony 2. Continuous Integration means that new code is integrated into the repository several times a day and is verified by automated tests – and then manual code review – before going into a production build.
As you can see, there are advanced tools for both Rails 4 and Symfony 2 to help you test your apps. We would also like to mention JavaScript (JS) testing, however, as all modern apps with front end are rarely written without JS. Therefore, you must properly test the JS code, and Jasmine is handy for this. The Jasmine framework can be used to write unit and functional tests, and is very similar to RSpec in terms of syntax.
Scalability
We should note that a framework’s scalability rarely correlates with an application’s ability to scale. In this section, we will review the practices you have to use in order to build scalable solutions with both Symfony and Ruby on Rails.
You can scale Rails 4 and Symfony 2 apps either vertically (by increasing server performance) or horizontally (by increasing the number of servers: application servers, database servers, caching servers, tasks servers, or CDN servers).
Web developers usually apply a complex of infrastructure improvements and configuration modifications to launch an application on distributed nodes. Here’s a general list of solutions and tools that we frequently use to scale Symfony 2 and Rails 4 apps:
- A three-tier client-server architecture (instead of a single-tier architecture);
- Redis for storing user sessions, DQL cache, and Doctrine mapping;
- MongoDB and ElasticSearch for storing aggregates of data;
- RabbitMQ to perform asynchronous operations through queues;
- Varnish to cache static resources and low dynamics HTML pages;
- Monolog and ELK stack for incident analytics;
- Hosting app nodes on Amazon Web Services (AWS);
- Assetic Bundle to minify and obfuscate JS and CSS files.
If we use all the solutions just listed, we can make Symfony 2 apps run over one billion requests per week with 30ms response time.
We would like to add that, although many Ruby on Rails applications have a monolithic structure, it’s easy to find a bottleneck in an app and implement that part as a standalone service. You can then further scale this service, which is a better option than increasing the number of app instances running simultaneously. This very same approach to scaling an application – which is called microservices – can be used with Symfony 2.
When using microservices, you can also implement some business logic in a lower-level language such as Go, Java, Scala, or C++. This is useful when you need to run unusually complex computations. It’s easy to integrate such a solution into your Ruby on Rails or Symfony application.
Hosting your Rails or Symfony application on Amazon Web Services (AWS) is one of the best options for scaling apps – as they’ll scale automatically. That is, additional servers will be provisioned to increase an app’s performance when required.
Ultimately, the scalability of an app built with either Symfony 2 or Ruby on Rails 4 is dependent on the app architecture you’ve engineered. Build a scalable architecture with either of these frameworks from the very beginning, and the app will scale in the future when necessary. (Note that making an architecture scalable means making smart decisions about how to link different app modules.)
As you can see, although these two frameworks – Ruby on Rails 4 and Symfony 2 – are written in completely different languages, they share very similar approaches to dependency management and modularity. Both offer advanced testing tools and allow almost endless scaling potential as long as your application is well architected. Because these frameworks are equally capable, the choice of which to use is really a matter of your personal preference.

Subscribe via email and know it all first!