Plan your application
Every application development project is unique, but the process of setting up the database backend has a few steps that are common to most. This guide describes, in broad strokes, the path to implementing a software project with Fauna.
Plan your data management strategy
The planning stage is when you decide on the basic building blocks of your application: the language or languages in which you’ll write it, what the user interface will look like, and any existing technologies you intend to leverage (including a data management system).
When planning for your application’s data requirements, it’s good to consider such factors as:
-
What will my schema look like? Will I use one database or several?
A Fauna database may have several collections, and it’s possible to query across them, but the same is not true for databases, so you may want to use multiple databases to hold different kinds of information which should be kept isolated.
Fauna has a flexible data structure, so different documents in a collection don’t all need to have the same fields, but it’s still a good idea to think ahead about how your documents and collections will work together to maintain data integrity and query efficiency.
-
What sorts of data access patterns will I employ?
Setting up the correct indexes on your collections is crucial for successful data management. Knowing which of your collections will be read-heavy, which will be write-heavy, and what sorts of queries will run against them should inform your indexing strategy.
-
How will I authenticate users?
Different kinds of application users require different levels of access privileges. Fauna allows you to create access keys with defined roles, so you can plan for admin-level access, user-level access, and any other roles you might need.
-
Do I have data residency requirements?
Government regulations, especially concerning applications that collect personally identifiable information, may require that data be stored in a particular geographical location, so take that into consideration when you choose a Region Group for your databases.
Map out your development environment
It’s very common to have three independent database deployments: one each for development, staging, and production. The development deployment is accessible only by members of the development team, while the staging deployment is accessible by a set of trusted test users and the production deployment is open to the whole world.
Each deployment has its own set of security requirements, and it’s
helpful to use an intuitive naming convention for databases such as
dev-01
, staging-01
, and prod-01
.
Populate your databases with initial data
Before you even start to develop your application, you’ll need some initial data to work with. That dataset may include user records, product catalog listings, or other structural information. You can use the Fauna Dashboard to set up your initial databases, collections, and indexes, and you can use Fauna Query Language or GraphQL to add your initial data.
If you have data in CSV or JSON format, exported from another database,
check out the
fauna-shell
import
command.
Start building with your preferred driver
Fauna supports drivers in several popular languages. This is where you’ll implement all your programmatic database access. Be sure you have adequate test coverage: bugs are much easier to fix in development than in production, and load testing can save you from unpleasant surprises when your application goes live.
Integrate your database logic with your application
This might be a step or it might be a continuous process, depending on the nature of your application. Some applications have distinct areas of implementation for the frontend, the middleware, and the backend, while others are more seamlessly integrated.
Choose a service plan
Fauna offers multiple service plans, so you can choose the one that’s right for your business. Fauna is 100 percent cloud-based, so you can scale effortlessly as you grow.
Launch!
When you’re ready to go live, one thing you won’t have to worry about is database server management or maintenance. Fauna lets you focus on your customers and your business, not hardware.
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!