Is it a good idea to develop website that only has little access to DB? CRUD will be done by calling API provided by separate internal backend system

I’m going to start developing an application in near future. This application consists of :

  1. Back-end system. This system provides API to be used by client. This
    system connects to data store and 3rd party API.

  2. Data Store : Can be relational or nosql data store.

  3. Client : Client will be a website and mobile applications.

My reasons are below :

  1. I want to prevent duplicated SQL query and 3rd party API call in
    website application side. The application and website will be
    developed by different developers. Only back end system
    developers that can make query or call 3rd party API. All website
    developers should only use API provided by back-end system

  2. In my opinion, the website is also a client just like the mobile
    application. If the mobile apps get their data from back-end system
    API, why the website shouldn’t be the same.

  3. I heard twitter is using similar idea (I can be wrong though). Its
    website is using twitter API just like their mobile application.

My primary concern to this architecture is that the website performance will be lower compared than If the website can make query or 3rd party API call directly.

Is there any other pros and cons that I should think about ?

As they say in Computer Science, “A level of indirection solves every problem”.

You can view what you are developing as a Service Oriented Architecture. The front end application consumes the data retrieved from the back end application. Together, they form a service. (The front end application might run on your user’s machine, if it is a thin client, e.g. made in JavaScript, or it might run on your machines, if it is a fat client that needs to perform complex computations or needs access to other resources that are not on your user’s machine).

The main upside of this specific “building a level of indirection” is that you are abstracting away your core data model. Many different clients may retrieve it using the same API: a mobile app client, an administration site that is not accessible from the Internet, or an embedded client in a satellite circling the Moon. Also, you are free to exchange the way those core data are stored: to you, they are retrieved from a DB, but those clients do not care if next week the backend retrieves the data from a flat file or a NoSQL key-value store.

The main downside is that this may be overkill if you are building a simple web site that is used within an intranet.

As @RobertHarvey notes, your concern about performance is unfounded. Indeed, being able to exchange backends might allow you to scale to much more performant hardware or software without the clients noticing.

Other pros and cons: remember to have a very clear protocol between frontend and backend — what was before an interface between packages has now become a remote API. Having an API call that returns the version, or the API capabilities, is useful. If the client calls go over the internet, remember to take into account they could be forged — try to encrypt and sign them, as if they were mails coming to your central office from local branches.

You’re basically describing a service layer.

Your performance concerns seem unfounded. In practice, your service layer will merely translate your API into the necessary 3rd party API or SQL calls; the overhead should be minimal.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật