N
Novu•9mo ago
Matt

Development flow best practice with Novu

Hi all! I'm studying the use of Novu for our stack, and I was wondering what was the current best practice in term of development flow. Context: our platform is a B2B SaaS product and notifications (in app, email, etc) are very deeply linked to the product and to all its features. Each developer has their local environment where they should be able to develop new features and their corresponding new notifications, or upgrade old feature and making sure it doesn't break existing notifications. We then have a review app mechanism that automatically deploys an instance of our platform for each development branch, so that our product/UX team can test everything: notifications should work there as well. And finally we have a final staging instance + our production instance where of course notifications should work. Each of those instances are isolated one from another. Question: How can we work with Novu in that context? Can we easily have a Novu for each of our instances, that would duplicate the production setup? Can we use a single Novu instance with various environments, cloning the conf of the prod (workflows, etc), but not the actual data (users, companies, etc)? What is the best practice to use Novu with this flow? This 9 months old post (https://discord.com/channels/895029566685462578/1019663407915483176/threads/1063976879780003910) with a similar question seems to indicate that this is not possible, but maybe things have changed since then 🤞
3 Replies
Matt
Matt•9mo ago
Hi! Anyone with a good way to use Novu in such a multi-environment context? Thx!
Pawan Jain
Pawan Jain•9mo ago
@Matt Currently we show two environments in UI production and development. We do have support for creating new environments via API/SDK, But I would not recommend to use it because we have not tested it well. You can create multiple organisations for B2B cases, each one will have two environment. for all purposes (local, staging, qa), you can use development environment and for prod use production environment
todd
todd•9mo ago
@Matt All of what you suggest is doable (and what I am doing). As you can see from @Pawan Jain it is slightly working against the grain of Novu. Novu in essence has a workflow built for UI-based development of workflows that IMHO is for marketers/product—I get that developers will use it. I say this because the primary use case for configuration is NOT to have it in source control (eg terraformed). The clearest example of this is the promotion approach using environments (as suggested). But that's not the isolation you are looking for. This is not a criticism just a reality. Another reality is that for your case of isolation you need to stand up new instances is that each instance is costly (I know because I can see my AWS bill with mongo and redis and an ecs cluster and vpcs). But its very doable and I have mine in mostly in terraform. (I written elsewhere the the dev setup on local machines is easy.) Finally, the last of piece of the puzzle is to migrate data between environments. To do this, I wrote the Sync library (it's part of the "novu dotnet-sdk"). One of the key limitations is that novu isn't really written as a machine-to-machine api but as an api for their client. That leads to couple of issues around the public API abstractions and that some collections are behind the private API. For example, the public API doesn't allow provision organisations—say if you wanted to provision via terraform. I think the overall project would be stronger if it dealt with your (my) use cases. Although commercially not so good. At this stage, I am continuing with the project until I more fully understand its tradeoffs. For example, the embed service is just static content and doesn't need to be a hosted service/workload in production and for now just costs me uneccesary money.