What would you use to build a mostly CRUD backend today?<p>In my experience a lot of the jobs I get are to build backends that are mostly CRUD operations with a few endpoints that present 'aggregated' or filtered views of that data. Most of these apps will also need some mechanism to do background processing.<p>What is your preferred stack to build such a backend today? What tools and frameworks do you like and what have you changed your mind on and don't like anymore (after using it)?<p>Does your choice of tools change depending on if it is a commercial venture or a personal project?<p>Curious to hear what everyone is using these days.
For every type of projects I'm involved, I choose Go as the backend and put maximum of business rules there to help me manage changes. Go standard library is sufficient and robust for many (all) cases I faced : http handlers, templates, concurrency...<p>If a web frontend is needed, I'll take svelte (not svelte kit) to code independente components that talk to the backend. I'll code there only interface logic (no control, no calculation, etc...)
Either ruby/rails for tried and tested, or crystal/amber if you don't need much from the wider rails ecosystem for some typing goodness.
I'm mostly doing that.<p>Django + Unpoly + Postgres<p>Development as fast as it can be. :D<p><a href="https://alexandremjacques.com/django-plus-unpoly/" rel="nofollow noreferrer">https://alexandremjacques.com/django-plus-unpoly/</a>
Go for backend. Yes it’s a bit more tedious. But in return you get deadass simple builds and pretty amazing performance. Also tbh it’s not that tedious to write SQL and tests. I’ve almost always run into issues with ORMs when things get complex.<p>Use Postgres and embedded db for cache. With SSD and Nvme you can leverage the embedded db for crazy performance. These days you can get a lot of storage space. Swap file and 5gb of space for the db as cache and you’re speeding. Save money and the network call, don’t need Redis.<p>React or svelte for UI. Don’t use next or any of that bloat. Use vite and lazy loading. If you need SSR don’t use SPA tech, maybe sveltekit would be good. I use sveltekit and react mostly.<p>For anything else like using sdk I use node if it’s not available for Go.
I have been in love with Loopback.io since v2 even though it was a bit of a rollercoaster.. Loopback v4 is a beautiful library. Its been around longer than nestjs but that's the easiest thing to compare it too. I recently have been creating lb4 servers that interface nextjs and react native clients. Initially, I identify my entities and use cases that I want to build. I then use the lb4 cli to auto generate models, relations, controllers, datasources, interceptors (add logic on methods/classes). I can start testing them with the OpenAPI explorer. With the openapi-typescript-codegen library I can generate services from my lb4 OpenAPI spec that I can use on the client side. From there, you can really query data easily with the loopback filter (which can be used on the client too). I initially started doing this with angular1/2+ but its been pleasant using many clients. Even though I have been leveraging it for years in production, I am still learning and exploring. There are many other awesome things I can expand on or explain if you are interested!<p><a href="https://loopback.io/doc/en/lb4/" rel="nofollow noreferrer">https://loopback.io/doc/en/lb4/</a><p><a href="https://github.com/ferdikoomen/openapi-typescript-codegen/tree/6a9333116aa1c0ada3b6d19bc81433c671f9a604">https://github.com/ferdikoomen/openapi-typescript-codegen/tr...</a>
<p><pre><code> - Stack:
- Application FE:
- Next JS (Hosted via Vercel)
- Hasura GraphQL for real-time messaging.
- Supabase for Auth and hosted Database.
- Application BE:
- PostgreSQL via asyncpg (no ORM)
- Uvicorn - hosted on AWS Lightsail.
- Redis - as a message queue.
- Hasura GraphqlQL for real-time messaging.
- Monitoring:
- Axiom https://axiom.co/vercel as it integrates with Vercel.
- Packaging:
- Docker & docker-compose</code></pre>
I would pick Ruby on Rails as main framework. It can go a long away, has sane defaults when talking about security and can move fast with building features.<p>For CRUD is the perfect fit (for me).<p>For background processing job I would pick Sidekiq or GoodJob<p>And would add to it a library like Avo - a good admin that will remove for me the need to create my own backoffice dashboard.<p>If I would have more time to put aside for learning something new I would try Hanami 2: it is Ruby but it comes with a different code architecture for a web app.
That doesn't really narrow it down very much. How many different entities, how complex are the filters, how frequent are the reads and writes?<p>When I was around 14 or something I started teaching myself relational databases with something called Paradox for DOS. For at least 15 years I went along with the assumption that real programmers use a relational database for just about everything.<p>When the NoSQL trend appeared and became wildly popular, it made me reconsider.<p>These days, if I can get away with using JSON files, then I just do that.<p>As far as the stack I usually use Node.js and JavaScript just because I have been doing it that way for so long. Recently some people specifically ask for Python.<p>Obviously, whether that will work depends on the project.<p>You often don't have a choice because the database is already built.<p>For many projects, there are multiple different approaches that would work fine.<p>I think for the future you will start to see languages that target web assembly becoming more and more popular for portability. Such as Rust and maybe some Rust competitor that has yet to become popular.<p>There will probably be some kind of popular web assembly runtime soon bundled with Postgres or something.<p>Or maybe someone will just build a Postgres extension that serves web pages running web assembly that can query Postgres.
Node and Express. It’s the most common for new projects at work, and i’ve been using it for over a decade at this point. It’s just so simple and easy and fast to get going.
<p><pre><code> - Stack:
- Application:
- Flask[0]
- Flask-Admin[1] (maybe for the initial prototype)
- SQLAlchemy --> PostgreSQL
- Gunicorn --> Nginx
- Celery[2] (long-running background jobs)
- Monitoring:
- Sentry[3]
- Analytics:
- PostHog[4]
- Packaging:
- Docker[5] & docker-compose
</code></pre>
I <i>may</i> use Flask-Admin initially to offload the "CRUD" operations to have an initial prototype fast but then drop it ASAP because I don't want to write a "flask-admin application" to fight against later on. If the application is mainly "CRUD", then Flask-Admin is suitable.<p>Now...<p>Would you do a breakdown/list of all the jobs you've done by sector/vertical and by function/role and by application functionality?<p>- [0]: <a href="https://flask.palletsprojects.com" rel="nofollow noreferrer">https://flask.palletsprojects.com</a><p>- [1]: <a href="https://flask-admin.readthedocs.io/en/latest" rel="nofollow noreferrer">https://flask-admin.readthedocs.io/en/latest</a><p>- [2]: <a href="https://flask.palletsprojects.com/en/2.3.x/patterns/celery" rel="nofollow noreferrer">https://flask.palletsprojects.com/en/2.3.x/patterns/celery</a><p>- [3]: <a href="https://sentry.io" rel="nofollow noreferrer">https://sentry.io</a><p>- [4]: <a href="https://posthog.com">https://posthog.com</a><p>- [5]: <a href="https://www.docker.com" rel="nofollow noreferrer">https://www.docker.com</a>
Parse Server+Dashboard. Setup takes half an hour, including testing whether the DB is connected. Handles accounts. Easily links stuff in a table, e.g. if you have Company connected to a User and a Address, it manages the pointers for you, and it's really easy for FE to just get the details.<p>If Parse Server dies or implodes for some reason, it's still built on top of MongoDB, so the data still belongs to me and I can switch to something else. I also don't need to worry about horizontal scaling.<p>Tutorial on it for setting up on Heroku: <a href="https://smuzani.medium.com/setting-up-a-mobile-backend-server-in-half-an-hour-f1b13e88092c" rel="nofollow noreferrer">https://smuzani.medium.com/setting-up-a-mobile-backend-serve...</a><p>It's a little old, but the stuff I built on top of Parse Server back then has been scaling up to a thousand users, and now we've just been adding things like pagination and giving heroku more money.
SST, you can have your backend logic and infrastructure all in Typescript. If you want to use a different runtime for your serverless functions, you can. you can also define your frontend in the same project and deploy the whole thing with one command.<p>For personal stuff this is great because you can run everything you need for next to nothing. For commercial stuff, it would depend on the use case. If you are going to be handling a bunch of requests or have to do a large amount of processing, you may want to go a different direction, as is the case with all serverless applications.
Java + Spring Boot. Old school server-side rendered templates with Thymeleaf if the site is static, Vuejs frontend instead if something more dynamic is needed.<p>Alternatively, Flask/Jinja/Vuejs if I'm working in Python.
Elixir/Phoenix is a great option. Oban for batch processing. Everything runs either in the Elixir VM (BEAM) or on PostgreSQL, no other servers to set up or manage.<p>Same for personal projects.<p>Sentry is great for monitoring. Prometheus/Grafana for operational insights. All are easy to integrate with Elixir.
Django.<p>- I know Python very well.<p>- I know Django quite well.<p>- Django is extremely mature.<p>- The Django REST Framework is quite mature.<p>Other stacks I've used: None, because I only started taking this kind of stuff seriously a year ago.<p>What else I'd recommend: Whatever you're most familiar with.
I use mostly Symfony (PHP). Really powerful form component combined with Doctrine ORM makes it super good for fast CRUD development<p>Also it has ApiPlatform where you can just add new CRUD api using few annotations/attributes
If a UI is needed: sveltekit, Prisma, trpc<p>One app, no need for an API, typesafety baked in at the DB and API layer, client-side interactivity, and server side authentication is easy to work in.
Backend only? I'd go with Go and use Gorm.<p>Fullstack including frontend, jobs, emails, I'd still pick the PHP+Laravel, with Livewire. It's incredibly powerful.