I personally do not like to go to the formal comparison of the two frames, so meaningless, but to good its advance advantage!
Technologies are common, but there must be a tool that is best suited to a particular domain at a particular stage!
The comparison here is not from the perspective of technology, but from the consideration of the technology selection of the company, especially the start-up Internet startups. Have no way, who lets Internet company cannot leave software! Ha, ha, ha.
First is the introduction of the players from both sides:
Laravel
- Relatively standard (PHP framework), suitable for team division of work
- Fast development (community ecology and scaffolding support)
- Easy to deploy (PHP deployment just like that, Git just push and pull down)
- The functional modules are comprehensive
- Complex architecture (in the PHP framework, O(∩_∩)O haha ~)
- Full stack, front and back end of an IDE done
- In another article
Spring Boot
- With Java as the old guy, and Spring as the standard J2EE endorsement, the ecosystem is strong
- Fast development (in the Java family…) The convention is greater than the configuration
- Based on the JVM, execution efficiency is guaranteed
- Need to master the Spring that set, for non – J2EE children’s learning costs are a bit high
- Blessed by Cloud, inservice calls
- Ridiculously smart Spring Data JPA
Ok, after introducing the contestants, we start to analyze which one to use. Here we set up a situation:
Suppose Xiao Hong is a BOSS (soon to be) who has an Idea worth 2 billion yuan and wants to put it into practice. He knows a little about software architecture and development technology. Yes, he is very good (if he is good, he can use the framework in any way, it doesn’t matter).
I don’t want to assume so sad, in reality, this situation is a lot, so let’s analyze with this scenario. Xiaohong should launch version 1.0 at the lowest cost and fastest speed, put it on the market, collect feedback and continue to iterate. This is a system engineering, excluding other factors and only considering technical problems, which can be summarized as follows:
- Cost (development efficiency and labor costs)
- Response (iteration and deployment efficiency)
- Security (stability and BUG resolution speed)
- Collaboration (teamwork and scalability)
1. Development efficiency
The development process, which we define as requirements and prototypes have been identified and simply modeled, well, from the moment the apes come to work and turn on the computer (Windows) with the requirements document, to the 1.0 release, who’s going to be the fastest? O ha ha ~ O (studying studying)
The first is the Laravel framework, which goes like this:
- Configure the local environment: Includes PHP-CLI, Vagrant, VirtualBox, HomeStead Box, Composer, NodeJS (Mix is needed), Python, and Visual Studio, Node-gyp (node-sass), PHPStorm, Git
composer create-project laravel/laravel xxx
- Development: Define migration and Model, then transformer and Repository, then service and Passport, then controller and View, then Event, Notification, push, etc. Unit tests accompany this process
- Git Clone/Git Clone/Git Clone/Git Clone/Git Clone
For those familiar with Laravel’s development process, development is fast.
Let’s take a look at Spring Boot:
If the business is not complicated, don’t bother about microservices. Don’t be like someone who has only one machine, but just want to open dozens of ports, and then run dozens of Spring Boot small services, but also with the Cloud family bucket chain. I was speechless
Monomer application lifting, the steps are as follows:
- Configure the development environment: IntelliJ IDEA next, a JDK installed, other need to use Redis what installed, minutes can be done to open the lu.
- Development: Define JAP Entity, Repository, Service, configure Spring Security (including Oauth2), define Validation, open lift Controller, exception handling, view layer, unit testing, etc
- Deploy: Pop out the Jar, throw it on the server, map it, and you’re done
I personally find Spring Boot to be more efficient than Laravel!
Why is that? If you are familiar with Spring, Security, JPA, Thymeleaf templates, RabbitMQ, etc., the package of Spring Boot is better than Laravel, but only if you are familiar with Spring. Otherwise, we won’t know where to start.
Some of Spring’s components, such as Spring Security, are quite complex
The Laravel framework uses many of the ideas of Java Spring, such as containers, dependency injection, and sections.
Java language is very rigorous, the experience in the development process is better, at least like me as an unconstrained ape, but also have to Java this old man to manage, otherwise every minute will run off.
Getting back to the issue of development efficiency, Spring Boot is faster to develop if you are familiar with both frameworks, but Laravel beats Spring Boot in some ways, as follows:
- Laravel framework ORM construction needs to go through two steps, migration and Model, and changes to migration need to adjust model, can not be like JPA Entity is database structure;
- The Laravel framework requires manual implementation of some injection bindings, usually
$app->bind
Although it doesn’t take much time, it’s still slower than Spring’s powerful annotations, and mainstream ides provide navigation to View Spring beans, which is awesome; - When it comes to web rendering, Laravel’s dynamic scripting language features plus Blade templates are almost always spring-Boot lite;
- Laravel would need to manually implement the Repository schema to make it more hierarchical. I can’t stand defining business logic directly in a Model or in a Controller. It’s ugly and hard to scale.
- In terms of authorization, Laravel’s built-in and Spring Security are both very strong, so it’s almost even out of the box.
- The Laravel framework outperforms Spring Boot in terms of development feedback and debugging, which can be said to be great for all non-compiled languages! Although Spring Boot also has DevTool, PHP does not need to be restarted at all.
- The Laravel framework’s code prompts are not nearly as good as Spring Boot’s, and it also requires a third-party package called IDE-Helper to help it track code. But even with third-party packages, you still can’t see what the container looks like.
- An object-oriented elegant framework like Laravel runs into PHP, an object-oriented language, which makes PHP incapable of implementing a feature that is easy to implement in Java.
- Route Routing Laravel is very powerful, intuitive, and more flexible than Spring Boot, so the efficiency of defining routes is better than Spring Boot.
- Exception handling both are very convenient, provide a unified way to handle, difficult to distinguish;
- Laravel is more powerful than Spring Boot in terms of Api Json data customization. This is because PHP’s array manipulation is so flexible that Java needs to define utility classes and entity classes to handle it.
- I18n internationalization, Laravel is more convenient than Spring Boot;
- In terms of front-end resource processing, Laravel’s Mix and Blade templates beat Spring Boot, but then again, as long as it’s not full stack, it’s not much of an advantage. Imagine if the front end made the page and got the template on the back end, Thymeleaf would beat Blade, because Thymeleaf could keep the preview data and render the actual data, which Blade couldn’t.
Conclusion: With sufficient skills, I feel that Spring Boot is slightly more efficient than Laravel. Do not spray, please refer to several dimensions in the article and think about it yourself.
Finally, I would like to mention and verify:
Laravel doesn’t say “Lava.”
Laravel doesn’t say “Lava.”
Laravel doesn’t say “Lava.”
It’s getting late and sleepy. That’s it for today, and we’ll talk about labor costs tomorrow.
Good night, everyone! thank you