lundi 29 décembre 2014

Database system for accounting Saas


I am in the process of building a large scale cloud based SaaS accounting / finance software. So stability & scalability is very important.


Business - protected $id - protected $displayName - protected $contactFirstName - protected $contactLastName - protected $address


Customer (inherited from Business) - protected $customerRegNo - protected $customerRating


Supplier (inherited from Business) - protected $supplierBankAccount (convenient data for paying the supplier)


If I were to translate it into a RDBMS schema, it could become something like the following


APPROACH 1


businesses



  • id

  • displayName

  • contactFirstName

  • contactLastName

  • address


customers



  • id

  • business_id

  • reg_no

  • rating


suppliers



  • id

  • business_id

  • bank_account


APPROACH 2


businesses



  • id

  • displayName

  • contactFirstName

  • contactLastName

  • address

  • customer_reg_no (nullable)

  • customer_rating (nullable)

  • supplier_bank_account (nullable)


So approach 2 doesn't look so natural from the point of OOP, but it is commonly used approach in RDBMS, approach 1 was trying to mimic the OOP principle, but there will be a lot of joining required when performing search which could be expensive.


What are the pros and cons of both approaches, see which one is better suited for the accounting system, which one most people is using and why.


Any NoSQL alternatives and see if they are able to cater for the OOP principle and at the same time doesn't sacrifice performance, and their scalability & stability.


Ultimately I want to build a database system that can be scaled easily by just throwing more machines in the mix, I knew that MySQL is not easy to achieve that and I heard that NoSQL alternatives do better in scaling but not good in stability & consistency.





Aucun commentaire:

Enregistrer un commentaire