Architecture questions: Angular App, DB and Wordpress

Hello do community. I’m considering building an app on do, and after having read some docs I have some questions considering the architecture and best services to use.

In general, my app will have an Angular + Ionic based application, connected to a backend DB (I’d prefer a graph DB, but I noticed do doesn’t offer a managed Graph DB, so it’ll be a relational DB).

Also, there will be a Wordpress + WooCommerce front-end for customers to work with, with the Angular app EMBEDDED within a Wordpress PAGE (for authorized users only).

  1. In my understanding, the better option for a DB + Angular deployment is an App, while the WordPress recommended way is a Droplet. Since I need both Wordpress and Angular app to be jointly provisioned, how would I go about combining all three elements on a single platform/service (the Angular app, its DB and the Wordpress site)? Can I have the Angular app + Wordpress site served by an App, or must they both reside within a Droplet? or else?
  2. I will need to listen for http requests triggered from Wordpress webhooks, to mutate the Angular app’s DB (e.g. when a new order is placed with WooCommerce, I need to update that I have a new customer in the app’s DB). What should be my considerations in choosing between implementing a serverless Function, vs. an App Platform Service to capture http requests and update the DB?
  3. As for the Angular app communicating with the DB - would you suggest an http-based communications with a Service/Function in between, or should I use some node package to directly hit the DB using its connection string and submitting queries (thinking here MySQL over port 3306 client-server communications)?

I believe DO should have some good offering to set this all up technically, anticipating your guidance and advise! Thanks, Mor

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
May 21, 2023

Hello @morsagmon

For your use case, it’s possible to use a combination of App Platform and Droplet. You can deploy your Angular + Ionic application on the App Platform and the relational database as a Managed Database service in DigitalOcean. This way you get a scalable and easy-to-deploy frontend along with a maintained database.

For the Wordpress + WooCommerce part, you can use a Droplet to configure and host your Wordpress site. You can embed your Angular app within the Wordpress page using an iframe or other methods according to your preference.

To capture HTTP requests from Wordpress webhooks and update the Angular app’s DB, you can use a serverless Function within the App Platform or create an API service within your Angular app. Both options can handle webhook notifications and update the database accordingly. The choice between these methods mainly depends on your preference and how you want to structure your architecture.

For Angular app-Database communication, using an HTTP-based communication with a backend service (Node.js, PHP, or any other technology) is recommended. Your backend service will need to handle CRUD operations, authentication, and other tasks. This approach provides better security and separation of concerns.

Hope that this helps!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel