Vapor: What is it? New release 3.0.0, what does it mean for iOS Developers?

Marc Coll
Marc Coll, Business Development at AppFutura
Published on Aug 23, 2018 in iOS Developers Resources
Vapor: What is it? New release 3.0.0, what does it mean for iOS Developers?

Vapor is the result of hassles, faced by iOS cum backend developer, as he had to switch between Swift and backend scripting language. From the time of its completion, Vapor has solved the problem of many iOS developers and backend developers. According to Tanner Nelson, one of the creators of Vapor, the framework increases the efficiency and productivity of Swift developers and reduces the trade-offs they may face. Here’s a quick depiction of his thoughts:

Vapor: What is it? New release 3.0.0, what does it mean for iOS Developers?

You may consider it a Happiness or productivity vs. Efficiency or Performance graph for backend developers. Swift and Vapor make the best pair in this scenario.

Do you love Vapor already or it’s still a mystery for you?

For both types of developers, entitled in the question above, this article can help. In this post, we have covered Vapor, its latest release Vapor 3.0.0 and why iOS developers should consider knowing about it (and thereby, using it.)

What is Vapor? What makes it Swift’s most used framework?

Just as Swift is open-source, Vapor is also introduced as open-source licensed software by Tanner Nelson and Logan Wright in January 2016. It is the most powerful and perfect framework, built using Swift. Vapor’s SwiftNIO based non-blocking and event-driven architecture, alongside the protocol-oriented and expressive design, makes it a worth-learning modular framework for iOS and Swift devs.

Vapor utilizes Codable for the parsing and serializing of HTTP message data, for the creation of DB Models and rendering the views. The framework supports Xtensible Markup Language too.

It’s due to its amazing usability and performance that Vapor is the most-used server-side Swift framework at present.

Vapor Release 3.0.0: What’s New in Vapor?

It took too long for Vapor’s creators to come up with the 3.0 version of the framework. The reason is - They were busy in increasing robustness of the code, optimizing it, adding new module and preparing long and helpful documentation and API Docs.

Simply put, everything is new in the latest release of Vapor, i.e. 3.0. Vapor 3.0 brings full native support for Swift 4’s Codable-Standard Library, which is almost used everywhere from decoding to accessing the data and reading the queries. Now, Vapor runs on SwiftNIO.

The major features of Vapor 3.0.0 are:

  • Async

    It unblocks the limits of Vapor 2 and switches to completely non-blocking mechanism, which is an asynchronous approach unlike the previous version of Vapor. By adopting asynchronous method of communication, it is ready to handle super-high concurrency. Therefore, your application can perform way better than it would have done with Vapor’s previous release.

  • Services

    Services’ is the all new Dependency Injection framework, built completely in Swift. Therefore, this release can handle multiple requests at the same time. Server responsiveness is increased, with the minimized usage of system resources. JSON configuration files are outlawed from the Vapor’s module.

    To your surprise, Vapor framework has achieved the throughput of 120k requests per second, outperforming Perfect, Gin, Kitura, Express and many.

  • Improved Database Support

    The database support has been improved in Vapor 3.0. In this version there are maintained and official drivers for SQLite, Redis, Postgres, and MySQL.

  • Changes in Packages

    There are many changes in the existing packages, and some new packages, are rolled out.

  • Codable

    With Codable being used throughout the Vapor, the performance of the framework has been increased by a multitude. Parsing and Serializing of HTTP message content, database module creation and rendering of views are now type-safe and convenient in Vapor.

  • Documentation and API Docs

    The team has put extra effort into preparing a fully-fledged documentation so that the users can utilize the latest release of this framework easily. Guide and API Docs are updated too. You may also check the version-wise descriptions of parameters and methods.

Main Features and Benefits of using Vapor

Swift has become the most appealing solution for the mobile and macOS developers. It is the fast and safe language by design and it allows developers to develop the product with frontend and backend server side Swift.

Out of numerous benefits Vapor dishes up for the Swift developers, the main are:

  • Lets you to hide your code implementation.
  • Templating is possible.
  • .framework files are already compiled, saving your compilation time while developing a site.
  • Easy hashing and cryptography implementation, for robustness.
  • Makes use of web sockets to make fast and real-time connections.
  • Works well for middleware(s).
  • Support JSON Serialization and parsing.

By now, you must have understood that it is easy to create performance-oriented and beautiful APIs and websites using Vapor. So, let’s talk about how to get started with it (in the next section).

Compatibility

Vapor is available for MacOS and Ubuntu Operating systems, where it auto-installs Swift on your system (in the case of Ubuntu users).

Pre-requisites and Installation

Vapor can be installed via any Swift Package Manager. It requires Swift 3 and XCode (the latest version). You may also install Swiftenv, as it will make it easy for you to switch between multiple versions of Swift. Now, install the Vapor toolbox using the following BASH command:

  • curl -sL toolbox.vapor.sh | bash

Database

From SQL to PostgreSQL, NoSQL, Mongo and more, Vapor supports multiple databases. So choosing the Database for your Vapor project is up to you. This framework not only provides a native connector for SQL Languages like PostgreSQL, SQLite, and MySQL but also provides its native support to MongoDB and Redis.

You may also use the PaaS solutions like Heroku, to swiftly deploy your app’s code to run online.

Packages

The core packages, available for installation, are:

Vapor: What is it? New release 3.0.0, what does it mean for iOS Developers?

Architecture of Vapor

Vapor features a robust architecture, with good authentication methods, sessions, cookies and advanced routing procedure for type-safe parametrization. Its engine utilizes SMTP and HTTP protocols, making it a perfect choice for API development. It supports URI parsing and serializing. Vapor’s engine has full-duplex communication channels which run over a single TCP connection.

Vapor lets you handle to multipart Form Data like a breeze; it parses and serializes mixed form-data. JSON and Swift Wrappers are there to make your work easy. Vapor has its own template system, called leaf; it is natively swift. It has been designed to work well with the Vapor’s engine.

The framework has an in-built Crypto module so that security implementations could be deployed smoothly. The new version of Vapor, i.e. Vapor 3.0, allows hashing with or without authentication. Decryption and Encryption can be carried out through ciphers. There is another thing to talk about, called BCrypt, which is a pure Swift implementation.

Nodes, Core, Droplet, Leaf, etc. are some more notable parts of Vapor Architecture.

What does it mean for iOS Developers?

If you are into iOS development and require to code backend and iOS simultaneously, Vapor can become an easy getaway from switching between languages for you. With Vapor and its strictly-typed programming mechanism, you can stay consistent by using one coding language and style.

Vapor is perfect for developing websites and APIs. It is flexible and strives to speed up the development process by simplifying the coding task for the developers. Written purely in Swift and having its own Swift Parser, this highly-expressive framework can lay in the foundation of your upcoming projects.

Looking for an app or software development company?

You can post a project on AppFutura for free and explain your needs for app or software development. You will receive quotes from qualified companies and will be able to hire the best candidate through a safe payment system.

Post a project

About the author
Marc CollBusiness Development at AppFutura

Marc has been involved with AppFutura since 2012. During this time, he has been in charge of different areas, from Content Management to his current position as Business Development Manager. After all these years, Marc has been in touch with the vast...

Read more...
You might also like