You can use WordPress to build whatever kind of application, or portal you want. Certainly, I promise you it won’t fail you. I’ve done it all. However, what you have to keep an eye on your database, you need a good design and structure for it to serve you well.
In WordPress, you have a lot of options to save your data. Although the main concern here is “what you want to save”. Through our work, we built a Classified Ads Portal for one of our clients and an Accounting Software for another. So let us show you how you can save your data in applications which are similar to these two.
Custom Post Types
When looking to store information of the classified ad portal, saving the title, description, and a few pictures are all what you only need to do. This structure is very close to the posts in WordPress. Hence, creating a custom post type will be a very effective way of storing your data and integrating with search engines too.
On the other hand, when you start to think of creating a Journal Voucher for the Accounting software you are playing on a totally different ground. It is necessary to have a primary table to store the JV basic info and another table to store the transactions. When it comes to these types of data, CPT won’t help you at all since they are stored in the built-in WordPress post table and you are not able to change the structure of this table. As well as writing your SQL Query on this table to get the JV information will be a tedious job.
Your Own Tables
WordPress will allow you to design your own tables for storing data. It is your decision if you would like to create tables for Classified Ads Portal or not. Moreover, in case of the accounting software, it will be the right call. WordPress gives you the
$wpdb library to access these tables. Where you can insert, update, delete, or execute any kind of SQL Queries you want. If instead, you decide you don’t want to use the
$wpdb library you can use the Advanced Content Type (ACT) in Pods plugin for creating tables totally separated from WordPress table and have similar functions for
Similar to the internal database, you could use an external database to store your own tables such as Microsoft SQL Server or Oracle, and you could use any PHP library such as OCI8 and mssql to connect to these databases.
The new player in the game and I am one of its biggest fans; in NoSQL database, you don’t represent your data as tables, instead, you will use JSON documents to store the object as a whole.
One of the biggest advantages of NoSQL is that the fact that you can distribute the database over multiple instances and servers easily as well as you won’t have any problem with data replication and repetition. This allows you to store the data of your portal in a flexible and scalable way, especially if you are using a cloud-based CouchDB provider such as CloudAnt.
On the other side of the field, JSON documents won’t help you in representing the financial transactions of the journal voucher in an effective manner, and query its information won’t be an easy task. For this reason, I recommend sticking with the old fashion tables when it comes to an application similar to the accounting.
To sum things up, the main factor when deciding on the database infrastructure that is most suitable for you, it is the type of application you are looking to build. As well as the complexity of the data you need within the app. Nevertheless, I recommend NoSQL in case you have a portal which heavily depends on post-like data from the users, where it will handle the load easily and the coding will be much effortless. Although, if you have a complex structure of information and queries I will advise you to return to the old school of the rational database either with WordPress database or on any other provider.