Needs advice
on
DenoDenoFaunaFauna
and
SvelteSvelte
at
()

I run a music-based website (eatnoise.com) which was built ~ 7 years ago. It was built using the jQuery framework, using PHP and MySQL in the backend. The site wasn't successful business-wise, so the site is more or less dormant. Now, I am learning web development myself via structured, online tutorials from Udemy. After working as a band-booker for several years, I want to pivot the site to include band-booking and ticketing features. I have two options: Engage the web developers who built the site initially and pay them to make the upgrades, even though there are improved technologies that have come onto the market since to increase performance, security, and SEO, OR build the site myself to my specifications using technology clearly on the ascendant. The first option means I get to market much quicker, albeit the technology will be redundant sooner and comes at a performance cost. The second option means it could be a year before I am proficient enough at coding to build the product myself and would take months to build, but I have the latest in technology to make a good PWA, but I'd be able to debug and make changes to the site myself. I'm looking for the advice of experienced developers who might be able to suggest the best way forward.

READ LESS
6 upvotes·11.6K views
Replies (2)
CTO at Dee Flex·

First of all, thank you for reaching out and asking the community a question like this, because I think there are a lot of people in this boat.

TLDR; The short of it is - if you are interested in building other sites further down the road, then you would be wise put the work in and build the booking site yourself. It will take time, so you will definitely need to think about long term implications. However, if you are not really interested in building other sites, or you have other really pressing concerns that need your time, it would be best to engage the original web developers to see if they can update the site which would free up your time. The flip side is they might say the whole site needs an overhaul due to such and such not being secure anymore, or whatever their excuse might be, so it could take time and cost more than you expect. Watch out for ballooning costs and make sure you get a clear plan down before agreeing anything.

-

If it were me, I would build the site myself. But, there are a couple of things you need to consider (and this is coming from my experience working with on the web for around 26 years, and as a pro webdev for nearly 20 years).

This is a slightly long post (sorry, I truly did not mean to write an essay) but I hope that it will quell your concerns, encourage you, and help you on your journey as a webdev.

The first point is about time - if you ask this other team to update the site, you will have more time to do other things. If you have something else that is important to you, that you need to attend to, then it would make sense to ask that team to do the work. I suspect they will likely tell you the site needs to be totally re-written somewhere along the line, and it might turn out to take more time and money than you expect, but at least you would be free to pursue other things. The second point I would raise is that if you build the site, you have to maintain it. If you build the site well, you can sleep at night. If you don't, you might get a call at 8pm before you are thinking about finishing for the day saying there is some problem with the site. In fact, even if you build the site really well, you will still get edge cases where someone will inform you of an issue, with limited information, you may end up spending hours to work out what the issue is (and indeed, if there even is one). I've experienced this a couple of times over the years, fortunately it's very very rare, but it's always a possibility.

Considering the two points above, if you decided to build the site yourself, I would have the following suggestions: Build the site with SvelteKit, FaunaDB and CloudFlare (Workers and CDN). There are a LOT of tools around, and there are always new ones just around the corner, but working with the above tools has been a game changer for me. This is all serverless based. It has the capacity to serve hundreds of thousands of simultaneous users in a way that PHP/MySQL could only dream of (and PHP/MySQL has been my bread and butter for most of my webdev career).

  1. It does this at a controlled cost : (CloudFlare Workers) In quiet times it scales down, you pay almost nothing to keep things going, and when the site is busy it scales to support the users, however as many as there are. Many firms have made this claim over the years about various tech, but I think that with Cloudflare Workers it really is true. Performance is fast, reliable, it scales smoothly, and cost is kept in check. I notice you have put Deno in your stack which is a V8 runtime (I think this is pretty much the same as Cloudflare Worker’s V8 runtime, though someone correct me if I am wrong). I have no experience with Deno though.

  2. Less time is needed to maintain servers : I have a few sites on a hosting provider in the US where they manage the servers, I’m also using AWS where I have to maintain the servers. The reason I use AWS is because I needed sites served in Japan, on a fast backbone, and because I was PHP/MySQL based they seemed to have everything I needed (I looked at a lot of other TRADITIONAL hosting options here in Japan, but AWS reliability, scaleability and functionality simply beats them all, even if it is not the cheapest). There are some issues though. If you have a site that is going to be potentially very very busy (even for short periods of time) you need to set up load balancing. There are various ways of doing this on AWS, trying to figure out the best reliability/performance/cost path is not easy - I read so much documentation I started dreaming about it. If you have load balancing in place, and the site is not busy, you are burning money. On the other hand, if it cannot support the current number of users, you have to scale up quickly, preferably before you get into that situation otherwise you are going have a poor user experience (which I truly dislike) and will lose customers. Of course, for best performance (and control of costs), you would probably set up your own server via EC2. You have to maintain that server. I’ve never had a server go down, fortunately, but it’s certainly a possibility. You have to maintain that too. This all takes up valuable time. It’s not a marketing thing, it’s a real down to earth problem that is solved going the severless route. It really truly does. Which is why I recommend Cloudflare.

  3. Why Svelte? (or, how did I get here) : I’ve written several large web applications from scratch over the years. I amassed a large library of my own modules that I have refined over the years including tools to support the development process itself (performance, trace, logging, etc). For about a year or so, a decade ago, I used Drupal 6/7 (which was a nightmare for many different reasons, and caused lock-in). I built several sites with it, but it always seemed to require more work and had a lot of issues with maintainability later on (I bring this point up, because I have experienced the ‘promise’ of new tech several times, Drupal was one of them). After this I ended up building my own framework from scratch in PHP because I wanted to make sites I built as fast and lean (yet fully featured) and be the least memory intensive as possible - in order to serve as many concurrent users as possible. Full user account management, security with roles, forms that build themselves (pretty much) because the system knows how tables are related (I was really proud of this because I could build a form programatically with just a few lines of code, fields are protected from invalid input, user access controlled view/edit, etc.) I designed the whole stack setting up my servers on AWS, tuning Apache and PHP to be as fast as possible. Memory use for building a fully constructed page was under 2mb, and generation took a millisecond or so (actually can’t recall the exact number, but it is VERY fast).

I spent over half a year last year working every day. I mean, truly, every day. I didn’t have a single day to stop and rest for over half a year because there just wasn’t time. Towards the end of last year the project got paused for various reasons. It was used for demos to clients, which was immensely important for our business, but was not put into full production as it wasn’t 100% finished. I took a break. Worn out, and pretty disappointed. I bring this up because when you put a lot of hard work into something, you don’t usually want to let it go. There has to be a damn good reason to take another path after that.

Over the years I looked at many different frameworks, CMs, and other curiosities - each time wondering "would it be worth investing time in this?" After being burned by Drupal many years ago, I had pretty strong reservations about locking myself into someone else's code base.

Earlier this year I started on a new project - I had all my tools I had already built. I could build the new site in around two months with all the existing tech I had, and I would probably have much free time to myself. Having designed the new system, prepared the database, I starting thinking about improving the page design and better user interaction (of all things right?) I looked at various javascript frameworks. My thinking was - I’ve got the server side down, I’ve got the content management down, let’s see what more we can do with the front end. And I discovered Svelte. I saw Richard’s demo from back in 2017. My world exploded from that moment on (where the hell had I been?)

It needs a serverless server (I’d heard of these and it didn’t make much sense to me way back when - losing control of the servers, who would possibly agree that was a good idea?) However, I looked into it more, and ‘saw the light’ so to speak. While there are a lot of options I decided that ultimately Cloudflare made the most sense to me. And the journey began.

The point of all of the above post is that I am not one to jump ship. I am not interested in the latest fad. There needs to be something truly substantive for me to decide to invest the time needed to move to a different stack.

I still haven’t answered the question - why Svelte? You might wonder - why on earth would I change after all that hard work I had already done for my PHP based framework (which actually has a Javascript side with lots of modules for different things as well), to using Svelte? Because it is, in my opinion: the future of webdev. Yes, there might be a new framework years down the line that could take over (never say never) but right now it is so well thought out, so well put together, and so forward thinking, it just doesn’t make sense not to invest time and use it. It’s similar to a few other frameworks (next, react, etc), but different enough, that it’s a totally different beast. The amount of code you have to write is lower, readability is better (this is REALLY important, and many programmers learn way late in the game how to write code that is readable - we often get stuck on performance; readability be damned). Code manageability is great, separation and modularity of code is pretty good, I’ve been very impressed with it.

Now that you can understand a bit of my background, and my journey here, I’m going to try to answer some of your other questions.

If you build the site yourself, you are not just committing to building the site, you are also committing yourself to building other sites later down the road (otherwise it is likely not worth the amount of time you will have to put in to building the booking site.) Given how functional the Svelte, FaunaDB, Cloudflare stack is, if you get the stack down, then future development time will be significantly reduced, and the sites you build will be fast and robust. The bonus is that you won’t have to keep an eye on them in quite the same way you would have to in a traditional non serverless hosting environment, costs are kept low, performance is good, and you can serve how ever many users you need to. Less stress, more time.

Both Svelte and FaunaDB are young. They are still developing, but I like the direction they are taking, and I think they are likely to take more and more market share of the webdev sphere - so having a good knowledge of them will most likely serve you well into the future.

There are a couple of holes in Svelte at the moment. Internationalisation for example is not really there, encrypted cookies with Svelte and Cloudflare was problematic for me as one of the usual Cookie modules for Svelte (not a standard inbuilt Svelte module, but something written by a contributor) uses an encryption module that is not compatible with Cloudflare (so this is really an issue with Cloudflare). Their VM is not 100% Node compliant, just so you know. Despite the issues I have had, I’m still steadfast in my belief that this is the right direction to take.

I hope that this post is useful to someone. If you have questions, just ask! Good luck with whatever you decide.

Edited to correct "CloudFlare (Works and CDN)"; and later to correct formatting.

READ MORE
5 upvotes·16.7K views
Recommends
on
Apollo

Whenever choosing a tech stack start with the simplest solution. WordPress might be a simple solution for all your problems with little development experience. However the booking feature with backing database may require more coding. If that is the case, a PWA is not a bad choice. I have not personally used svelte but it looks to be primarily a prebuild static site generator. This may make some runtime elements difficult like logins or reactive behaviors. I don't think you need those heavily so Svelte might be a good fit. If you need something more heavy duty based on React, consider Gatsby. I have found it is a good combination of SPA and static site features and can still be hosted on a CDN like Cloudflare. Svelte is newer to the game (but newer is not always better). Regarding the backend API, I have heard good things about FaunaDB. However, if you want to use the sql database you already have you could drop an Apollo server right in front of it to add the graphql features you crave. GraphQL is a great modern way to build an API. I endorse it. All my APIs are GraphQL. Regarding Deno, it is very new to the game... very new. I am excited to move all my stuff off nodeJS to Deno someday, but be aware as it's new it may have gaps and cause some headaches where NodeJS will just work and has the best package ecosystem in the world, NPM. For example, to use Apollo Server you'd have to use NodeJS instead of Deno. Overall, your choices are cutting edge so I think it would result in a sleek app, but know that with the newest comes the most change and learning difficulty. Also, I endorse using cloudflare for static site hosting. It is awesome. If you have any questions, don't hesitate to reach out for more specifics.

READ MORE
5 upvotes·2 comments·3.5K views
Paul Vardy
Paul Vardy
·
November 29th 2021 at 9:31AM

Just to add to Jim Hill's comment:

“I have not personally used svelte but it looks to be primarily a prebuild static site generator. This may make some runtime elements difficult like logins or reactive behaviors.”

It is the exact opposite. Dynamically updating different parts of a page based on user interaction with the page, along with elegant and performant animation is very easy with Svelte.

Dynamic websites are Svelte’s bread and butter - with reactivity that is better than React’s.

Regarding Gatsby - my understanding is that Gatsby is a static site generation (SSG) solution built on top of React.

There is of course also Next.js, a static-site rendering (SSR) solution also built on React.

Svelte is really a compiler that compiles a site ready for the server to put the pieces of a page together based on the incoming call to the web server (such as a Cloudflare Worker).

SvelteKit is for Svelte, what Gatsby and NextJS are for React. An opinionated framework built on top of Svelte that allows you to create SSR (and SSG) websites and applications.

I’ve read of devs moving from Gatsby to Sveltekit and being able to leverage the performance advantages it has over it. Personally though I have never used Gatsby, so that’s anecdotal, but it does seem to be a recurring pattern.

* GraphQL

Fauna supports both FQL (which to me feels like the serverless version of SQL - I found it very easy to pick up) and GraphQL. They are fully implemented database servers.

As Jim Hill mentions, Apollo Server can provide GraphQL endpoints, meaning your web app can talk to the server in GraphQL - the Apollo server can then talk to your existing (My)SQL server using the Sequelize plugin (for example). This is very useful if you are not able to move your database or simply want to keep it where it is - but it’s not performant.

Using Fauna reduces all these different components, simplifying the architecture, and provides significantly better load handling. That said, Apollo is an immensly useful service if you need it.

Regarding Wordpress - yes you could use it for that - but it would take quite a bit of work. I had some experience using Wordpress a few years back setting up a simple website for my Dad. It’s working fine for him. I will say though that it will bring with it lots of issues that you will have to deal with down the line. Much like Drupal.

It may well be perfectly useable for the OP, but you will be fighting the constraints of the CMS at some point. Since the OP does seem to be interested in writing the site rather than attempting to build it with a CMS - I can’t really recommend it.

·
Reply
Jim Hill
Jim Hill
·
November 30th 2021 at 3:58AM

Thanks for the clarification. I will definitely check out Svelte more. I really believe in compile time optimization which it appears Svelte may have taken to the next level beyond React or Gatsby (on top of React).

·
Reply
Avatar of Evan Read