Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Is Laravel a good choice to build a website like twitter?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Is Laravel a good choice to build a website like twitter?

Yes or not? and why?

«1

Comments

  • If it is personal, I would make my own framework. If it is for a client, go for it.

    I have workmates though having problem with laravel's patch and migration errors too. Another is open source paranoia.

  • No. Over-engineered for what you are trying to do.

  • @team_traitor said: If it is for a client, go for it.

    Thanks and how about the performance of Laravel?

  • @hackerman said:
    No. Over-engineered for what you are trying to do.

    Hmm, so what's your choice for a website?

  • yoursunnyyoursunny Member, IPv6 Advocate

    Twitter's core is API.
    Design the API and its implementation first before even thinking about webapp.

    You'll give up when you realize how complicated is the API.

  • @yoursunny said: You'll give up when you realize how complicated is the API.

    :#

  • You mean , replicating the functionality of twitter? or you want to build app that can handle the amount of traffic twitter gets?

  • @EthanZou said:

    @hackerman said:
    No. Over-engineered for what you are trying to do.

    Hmm, so what's your choice for a website?

    For what you're trying to do, nothing - a complete custom build.

    Are you planning to build a new public social media platform? Or is this a private/client project?

  • @xpress7 said: or you want to build app that can handle the amount of traffic twitter gets?

    Yes, just an example. ;)

  • @hackerman said: Are you planning to build a new public social media platform? Or is this a private/client project?

    Hmm, a simple public social media platform for people to share pics and videos.

  • @HalfEatenPie said:
    lol

    ?

  • As an aside, I seem to recall that Twitter itself started life written in, then fashionable, Ruby on Rails, and had to switch to other technologies when it didn't scale.

    Thanked by 1yoursunny
  • @cochon said:
    As an aside, I seem to recall that Twitter itself started life written in, then fashionable, Ruby on Rails, and had to switch to other technologies when it didn't scale.

    Thanks!
    I just take Twitter as an inappropriate example for Laravel. :)

  • @EthanZou said:

    @hackerman said: Are you planning to build a new public social media platform? Or is this a private/client project?

    Hmm, a simple public social media platform for people to share pics and videos.

    But why?

    You can use Laravel - there are Twitter clones which use Laravel - but it will not scale well at all. If your product remotely succeeds, you will either need to scale your infrastructure at an insane cost or rewrite everything ground up in an efficient and proper way.

    If you're serious about building the next big social media platform, you are not going to use Laravel as your base - this is not to trash Laravel, it is brilliant but it is not suited for the use case.

    If you are just having fun and trying to develop your skills, go ahead and use Laravel.

  • risharderisharde Patron Provider, Veteran

    For something as massive as Twitter, it's more important to look first at whether the laravel dependencies can be scaled. Laravel is a great framework no doubt but if you're going to build a Twitter alternative, your greatest enemy is likely the scale at which you need to serve clients.

  • First use whatever you want and then refactor to the proper scaling.

  • Not_OlesNot_Oles Moderator, Patron Provider

    @EthanZou

    Since you asked about Twitter code, maybe you might be interested to watch George Hotz | Programming | so how does twitter work? | API | GraphQL | requests | Backend | Scala

    As I watched this video, besides being interested in Hotz' description of how Twitter works, I also was interested to see how Hotz himself worked. My notes on Hotz' working style:

    • Working fast
    • Thinking structurally about higher level overall view
    • Keeping notes with vi, and using command line terminal, while also working with VS Code.
    • Talking about his mistakes and what he doesn't know
    Thanked by 1abtdw
  • @hackerman said:

    @EthanZou said:

    @hackerman said: Are you planning to build a new public social media platform? Or is this a private/client project?

    Hmm, a simple public social media platform for people to share pics and videos.

    But why?

    You can use Laravel - there are Twitter clones which use Laravel - but it will not scale well at all. If your product remotely succeeds, you will either need to scale your infrastructure at an insane cost or rewrite everything ground up in an efficient and proper way.

    If you're serious about building the next big social media platform, you are not going to use Laravel as your base - this is not to trash Laravel, it is brilliant but it is not suited for the use case.

    If you are just having fun and trying to develop your skills, go ahead and use Laravel.

    Many thanks for your guide! hackerman
    Get√ <3

  • EthanZouEthanZou Member
    edited December 2022

    @risharde said: your greatest enemy is likely the scale at which you need to serve clients.

    Thanks a lot!
    So 100k visits a day should be OK with Laravel?

  • @DennisdeWit said:
    First use whatever you want and then refactor to the proper scaling.

    Hmm, 100k visits a day should be OK with Laravel?

  • @Not_Oles said:
    @EthanZou

    Since you asked about Twitter code, maybe you might be interested to watch George Hotz | Programming | so how does twitter work? | API | GraphQL | requests | Backend | Scala

    As I watched this video, besides being interested in Hotz' description of how Twitter works, I also was interested to see how Hotz himself worked. My notes on Hotz' working style:

    • Working fast
    • Thinking structurally about higher level overall view
    • Keeping notes with vi, and using command line terminal, while also working with VS Code.
    • Talking about his mistakes and what he doesn't know

    Great job! <3

    Thanked by 1Not_Oles
  • Here's my two cents as someone with relatively extensive experience with Laravel:

    Architecture and component separation has more to contribute than choosing which framework to start on. PHP 8 improvements are no joke to laugh at and can scale considerably provided components are separated into their own service.

    Most PHP-based apps handle everything in one service, so of course they don't scale well (Wordpress being one example where the UI, uploads and backend are all one service). However, when you:

    • Use an object storage (s3/s-compatible solution) + CDN for user uploads
    • Separate your UI infrastructure (Vue/React/Svelte/whatever) from your API infrastructure (add more API backends as you go and load-balance them on a common endpoint)
    • Have a good database design (considering when to use NoSQL vs a traditional RDBMS, properly-indexed data, sharding)

    Then whether you go with Laravel or not is a non-factor. There's also a bunch of stuff that could help, for instance, GraphQL subscriptions (Hasura and the like) for timeline refreshes (you could do this with websockets on your own but why bother when there's already something you could use for it).

    From experience, Laravel's come a long way performance-wise and provides some sensible defaults. You also save time not needing to re-engineer authentication, filesystem definitions and the like since they already come built-in, saving you time and letting you rely on scrutinized code to handle the important stuff.

    With that said, any language would do. I've moved on to .NET Core but I'd 100% go back to writing Laravel code any day if it fits the project's requirements.

  • @EthanZou said:

    @xpress7 said: or you want to build app that can handle the amount of traffic twitter gets?

    Yes, just an example. ;)

    To scale at that level, not just laravel, but PHP will also be your bottleneck. But if you want to build something quick for personal or medium range app, you can't go wrong with Laravel.

  • @xpress7 said:

    @EthanZou said:

    @xpress7 said: or you want to build app that can handle the amount of traffic twitter gets?

    Yes, just an example. ;)

    To scale at that level, not just laravel, but PHP will also be your bottleneck. But if you want to build something quick for personal or medium range app, you can't go wrong with Laravel.

    Thansk for your reply!
    So 100k visits a day should be OK with Laravel? or not?

  • @definitelyliam said:
    Here's my two cents as someone with relatively extensive experience with Laravel:

    Architecture and component separation has more to contribute than choosing which framework to start on. PHP 8 improvements are no joke to laugh at and can scale considerably provided components are separated into their own service.

    Most PHP-based apps handle everything in one service, so of course they don't scale well (Wordpress being one example where the UI, uploads and backend are all one service). However, when you:

    • Use an object storage (s3/s-compatible solution) + CDN for user uploads
    • Separate your UI infrastructure (Vue/React/Svelte/whatever) from your API infrastructure (add more API backends as you go and load-balance them on a common endpoint)
    • Have a good database design (considering when to use NoSQL vs a traditional RDBMS, properly-indexed data, sharding)

    Then whether you go with Laravel or not is a non-factor. There's also a bunch of stuff that could help, for instance, GraphQL subscriptions (Hasura and the like) for timeline refreshes (you could do this with websockets on your own but why bother when there's already something you could use for it).

    From experience, Laravel's come a long way performance-wise and provides some sensible defaults. You also save time not needing to re-engineer authentication, filesystem definitions and the like since they already come built-in, saving you time and letting you rely on scrutinized code to handle the important stuff.

    With that said, any language would do. I've moved on to .NET Core but I'd 100% go back to writing Laravel code any day if it fits the project's requirements.

    Many thanks for your guide! <3
    So 100k visits a day should be OK with Laravel?

  • ericlsericls Member, Patron Provider

    @EthanZou said:

    @xpress7 said:

    @EthanZou said:

    @xpress7 said: or you want to build app that can handle the amount of traffic twitter gets?

    Yes, just an example. ;)

    To scale at that level, not just laravel, but PHP will also be your bottleneck. But if you want to build something quick for personal or medium range app, you can't go wrong with Laravel.

    Thansk for your reply!
    So 100k visits a day should be OK with Laravel? or not?

    I'm not making websites in PHP for awhile. But I'm pretty sure the bottleneck won't be from the Laravel framework. Stateless services are always horizontally scalable. Pay more attention to database and/or other services that requires persistency.

  • @EthanZou said:

    @xpress7 said:

    @EthanZou said:

    @xpress7 said: or you want to build app that can handle the amount of traffic twitter gets?

    Yes, just an example. ;)

    To scale at that level, not just laravel, but PHP will also be your bottleneck. But if you want to build something quick for personal or medium range app, you can't go wrong with Laravel.

    Thansk for your reply!
    So 100k visits a day should be OK with Laravel? or not?

    Yes you can. But at which cost is another question. Laravel is just one part of stack. You need webserver, caching server, database server, that can handle all that traffic. You need to plan and scale everything accordingly.

    If you want to run this in a monolith architecture , the traditional laravel way it won't scale well. Usually for this kind of apps, you'll separate your frontend and api. So you'll use Laravel for the API part, and handle the frontend with something like Vuejs or React etc.

  • @ericls said: Pay more attention to database and/or other services that requires persistency.

    Thanks! Maybe benefit a lot from a cloud database?

  • @xpress7 said:

    @EthanZou said:

    @xpress7 said:

    @EthanZou said:

    @xpress7 said: or you want to build app that can handle the amount of traffic twitter gets?

    Yes, just an example. ;)

    To scale at that level, not just laravel, but PHP will also be your bottleneck. But if you want to build something quick for personal or medium range app, you can't go wrong with Laravel.

    Thansk for your reply!
    So 100k visits a day should be OK with Laravel? or not?

    Yes you can. But at which cost is another question. Laravel is just one part of stack. You need webserver, caching server, database server, that can handle all that traffic. You need to plan and scale everything accordingly.

    If you want to run this in a monolith architecture , the traditional laravel way it won't scale well. Usually for this kind of apps, you'll separate your frontend and api. So you'll use Laravel for the API part, and handle the frontend with something like Vuejs or React etc.

    Many thanks! xpress7
    Get√ <3

Sign In or Register to comment.