假設檢驗方差未知_設計云數據庫時如何處理未知數并做出假設

假設檢驗方差未知

by Rick Mak

麥瑞克(Rick Mak)

設計云數據庫時如何處理未知數并做出假設 (How to handle unknowns and make assumptions when designing a cloud database)

場景:鞋盒還是社交應用? (Scenario: Shoebox or social app?)

Say you’re a developer who wants to build a note taking app. Let’s look at one feature detail with huge implications on your back-end. To write a note, your app will need to be able to save the data.

假設您是一名開發人員,想開發一個筆記應用程序。 讓我們來看一個對后端有重大影響的功能細節。 要寫筆記,您的應用將需要能夠保存數據。

Saving a record to a database is straight forward. The key questions are:

將記錄保存到數據庫很簡單。 關鍵問題是:

  • Who will need to access that record?

    誰需要訪問該記錄?
  • Will it only be your user, or will your user share it with others?

    它只會是您的用戶,還是會與他人共享?
  • Will your product be shoe-box app or a social app?

    您的產品是鞋盒應用還是社交應用?

If you intend for the notes to be private to the author, you may conclude that you are making a shoe-box app. This means all data goes to a private DB (database).

如果您打算使注釋對作者不公開,則可以得出結論,您正在制作鞋盒應用程序。 這意味著所有數據都將進入私有DB(數據庫)。

If you intend for your app to share notes with others, you may conclude it should be a public DB.

如果您打算讓您的應用與他人共享筆記,則可以得出結論,它應該是公共數據庫。

But will you know which it is before you start?

但是在開始之前您會知道是哪個嗎?

And what will you do if you need to change your product as you go? Public DB and private DB isn’t the first thing most developers think about when they’re building an app. We encountered these question when we were building our back-end product for our developers, Skygear.

如果您需要隨時隨地更改產品,該怎么辦? 大多數開發人員在構建應用程序時都不會想到公共數據庫和私有數據庫。 在為開發人員Skygear構建后端產品時,我們遇到了這些問題。

Because of our experience in building apps for clients, we assumed there was a right choice of database. And that our user would know how to choose.

基于我們在為客戶構建應用程序方面的經驗,我們認為數據庫是正確的選擇。 而且我們的用戶會知道如何選擇。

How do you build a back-end for developers who aren’t sure of their products needs yet? Or for those who want to keep their options open in the future?

您如何為尚不確定其產品需求的開發人員構建后端? 還是對于那些希望將來保留其選擇權的人?

As the tech lead in the project, I’d like to share with you our decision making process from 2 years ago. I hope it helps future development teams approach unknowns and assumptions.

作為該項目的技術負責人,我想與您分享我們2年前的決策過程。 我希望它可以幫助未來的開發團隊應對未知和假設。

為什么我們開始考慮私有數據庫與公共數據庫? (Why did we start thinking about private vs public DBs?)

Many apps require a back-end to store and query user data. The back-end is a lot of hard work to build and, let’s face it — not so enjoyable to create. Skygear is our open-source serverless back-end. It helps address common development features for mobile and web apps.

許多應用程序需要后端來存儲和查詢用戶數據。 后端是很多艱苦的工作,而讓我們面對現實-創建起來并不那么愉快。 Skygear是我們的開源無服務器后端。 它有助于解決移動和Web應用程序的常見開發功能。

The feature I’ll talk about is our Cloud DB, where you store and query user data. When we started to design Cloud DB, we asked ourselves how different apps store and query user data.

我將討論的功能是我們的Cloud DB,您可以在其中存儲和查詢用戶數據。 當我們開始設計Cloud DB時,我們自問不同的應用程序如何存儲和查詢用戶數據。

We looked at our company’s mobile apps portfolio for inspiration. Our company does everything from consumer apps to e-commerce apps. So we grouped them into “shoe-box” and “social” apps.

我們從公司的移動應用程序組合中尋找靈感。 從消費類應用程序到電子商務應用程序,我們公司都應運而生。 因此,我們將它們分為“鞋盒”和“社交”應用。

Shoe-box apps store personal data that the user wants to keep private. For example, our side project Spentable helps a user track of their daily spending. Data stored in the app is meant to be private, in a shoe-box.

鞋盒應用程序存儲用戶想要保密的個人數據。 例如,我們的輔助項目Spentable可幫助用戶跟蹤他們的每日支出。 應用程序中存儲的數據是在鞋盒中私有的。

But, there is stuff that we want to share publicly or with friends. That also means the user needs to be in control of who can read their data. These two kinds of apps present a challenge in how we designed Skygear’s Cloud DB. We wanted to make storing data in Cloud DB as easy as possible. For shoe-box apps, all the developers need is a database where each user can only see the data that they are putting in. Yet, in social apps, developers need features such as ACL (access control). How can we make things simple for developers of both kinds of apps?

但是,有些東西我們要公開或與朋友分享。 這也意味著用戶需要控制誰可以讀取其數據。 這兩種應用程序對我們如何設計Skygear的Cloud DB提出了挑戰。 我們希望使數據存儲在Cloud DB中盡可能容易。 對于鞋盒應用程序,開發人員所需的只是一個數據庫,每個用戶只能在其中查看他們所放入的數據。然而,在社交應用程序中,開發人員需要ACL(訪問控制)等功能。 對于兩種應用程序的開發人員,我們如何使事情變得簡單?

吃我們的蛋糕也吃 (Having our cake and eating it too)

We decided to solve this problem by introducing the concept of multiple databases in the Cloud DB: private DB and public DB. Each user has a private DB to put data in, and that data is only available to the same user. The app also has one public DB that is shared among all users.

我們決定通過在Cloud DB中引入多個數據庫的概念來解決此問題:私有DB和公共DB。 每個用戶都有一個專用數據庫來放入數據,并且該數據僅可用于同一用戶。 該應用程序還具有一個公共數據庫,該數據庫在所有用戶之間共享。

A shoe-box app developer is able to focus on saving and fetching the data without worrying about permissions because data in the private DB is always private.

鞋盒應用程序開發人員能夠專注于保存和獲取數據而無需擔心權限,因為私有DB中的數據始終是私有的。

But, private DB does not work at all for social apps. Developers for social apps should put data in the public DB because data in social apps are meant to be shared.

但是,私有數據庫根本不適用于社交應用程序。 社交應用程序的開發人員應將數據放入公共數據庫中,因為社交應用程序中的數據是要共享的。

Before we added support for ACL, this simple distinction for public and private data served us(and our users very well. Everything in private DB is truly private while everything is public DB is truly public.

在添加對ACL的支持之前,對公共數據和私有數據的這種簡單區分對我們(以及我們的用戶)都非常有用。私有DB中的所有內容都是真正的私有,而公共DB中的所有內容都是真正的公共。

“Everything is public” is not good enough. Most social apps have use cases that data is only shared among a group of friends.

“一切都是公共的”還不夠好。 大多數社交應用都有用例,數據僅在一組朋友之間共享。

ACL is another difficult and interesting topic that should be it’s own article.

ACL是另一個困難而有趣的主題,應該是它自己的文章。

我們無法同時利用這兩個數據庫的優勢 (We couldn’t have the best of both databases)

Separating the DB into private and public ones was a good idea. We thought they supported the use case for majority of apps.

將數據庫分為私有和公共數據庫是一個好主意。 我們認為他們支持大多數應用程序的用例。

But early adopters found our private and public options confusing.

但是,早期采用者發現我們的私有和公共選擇令人困惑。

Our early users gave us invaluable feedback. We also paid attention to the support questions we received. This is what we learned from developer feedback when they used our Cloud DB:

我們的早期用戶給了我們寶貴的反饋。 我們還關注收到的支持問題。 這是我們從開發人員使用Cloud DB時的反饋中學到的:

  1. It’s not obvious to developers what they’re building at first

    對于開發人員而言,起初他們正在構建的東西并不明顯

    While it may be obvious which kind of app developer made by looking at the product retroactively, it is not obvious from the get-go. Forcing the developer to decide whether they are making a shoe-box or social app at the beginning is difficult, if not impossible.

    回顧性地看待哪種應用程序開發人員可能很明顯,但從一開始就并不明顯。 強迫開發人員決定一開始是制作鞋盒還是社交應用是困難的,即使不是不可能的。

  2. Developers just want to get started quickly

    開發人員只想快速入門

    We want the developers to learn the basics as quickly as possible. Having to learn one more concept to choose which DB to use before they can actually save and retrieve data is too much to ask for new users.

    我們希望開發人員盡快學習基礎知識。 在實際保存和檢索數據之前,必須學習另一個概念來選擇要使用的數據庫,這對于尋求新用戶來說實在太多了。

  3. The decision for public or private DB, once made, isn’t easy to reverse

    一旦做出公共或私有數據庫的決定,就不容易撤銷

    Suppose that a developer started with a shoe-box app idea and they put everything in the private DB. Later they may realize that they should make the app a social one instead. It is not easy to migrate data once they are put into a particular DB.

    假設開發人員從一個鞋盒式應用想法開始,然后將所有內容都放入了私有數據庫中。 后來他們可能意識到,他們應該改為使該應用程序成為社交應用程序。 將數據放入特定的數據庫后,遷移數據并不容易。

  4. Permissions are usually an after thought

    許可通常是事后的想法

    Data security a priority in our company. But data security is not the first thing that comes to the mind of a developer. Especially when they’re just doing a proof-of-concept prototype. They want to focus on the functionality first, and take care of the security later on.

    數據安全是我們公司的首要任務。 但是,數據安全性并不是開發人員想到的第一件事。 尤其是當他們只是在做概念驗證原型時。 他們想先關注功能,然后再注意安全性。

我們的外賣 (Our takeaways)

We are always thinking about how we could make our products better. We could do better in terms of software architecture, user documentation and ease-of-use. We sometimes brainstorm what we would do if we could rewind the clock two years to start over. But here is what we would tell our former selves:

我們一直在思考如何使我們的產品更好。 我們可以在軟件體系結構,用戶文檔和易用性方面做得更好。 有時我們會集思廣益,如果我們可以倒退時鐘以重新開始兩年。 但是,這就是我們要告訴我們以前的自我:

  1. If developers are already familiar with an existing concept, adopt it

    如果開發人員已經熟悉現有概念,則采用它

    Most developers are familiar with the concept of a database. It is a container of some sort where developers can save content. They can also retrieve data and support the CRUD (Create, Read, Update, and Delete ) property.

    大多數開發人員都熟悉數據庫的概念。 它是開發人員可以保存內容的某種容器。 他們還可以檢索數據并支持CRUD(創建,讀取,更新和刪除)屬性。

    Because developers are already familiar with the concept of a database, they would find a single database on Cloud DB straight-forward to use.

    因為開發人員已經熟悉數據庫的概念,所以他們可以直接在Cloud DB上找到一個數據庫來使用。

  2. Introduce new concepts when developers are prepared for them

    在開發人員為新概念做好準備時引入新概念

    This idea is actually an other way of saying that we should make the learning curve as easy as possible. Skygear was a prototype in its own way. We just launched V

    這個想法實際上是說我們應該使學習曲線盡可能容易的另一種說法。 Skygear本身就是一個原型。 我們剛剛推出了V

    1.0!.

    1.0 !。

    You never want to make life for your early adopters difficult. Having to learn everything before developers can do anything does not work well from a product perspective. Until developers need to think about data permission, they should not need to know about the difference between a private DB and public DB. We should let our users get started with the common concepts first to familiarize themselves with a new platform.

    您永遠都不想讓早期采用者的生活變得困難。 從產品的角度來看,必須學習所有知識之后開發人員才能做任何事情。 除非開發人員需要考慮數據許可權,否則他們無需了解私有數據庫和公共數據庫之間的區別。 我們應該首先讓用戶開始使用通用概念,以熟悉新平臺。

    Only after they’re comfortable should we introduce new concepts to provide more options. In this case, there’s no harm for a developer to discover they need ACL so the new concept is a natural next step after they have learned how to use Cloud DB.

    只有在他們感到舒適之后,我們才可以引入新概念來提供更多選擇。 在這種情況下,對于開發人員來說發現他們需要ACL并沒有什么害處,因此,新概念是學習了如何使用Cloud DB之后自然而然的下一步。

我們學到了什么 (What we learned)

When we began working on Skygear two years ago, we wanted to build a kick-ass product with 2–4 of our senior developers. We had ready testers from our own in-house developers, who gave lots of critical feedback. We thought we were using our experience in web and mobile app development to make better decisions on how to design tools for other developers.

兩年前,當我們開始從事Skygear的開發時,我們想與2-4位高級開發人員一起開發踢球產品。 我們有自己的內部開發人員準備的測試人員,他們提供了許多關鍵的反饋。 我們認為我們正在利用我們在Web和移動應用程序開發方面的經驗來就如何為其他開發人員設計工具做出更好的決策。

But our experience also created assumptions about what to expect our users to know before using our product.

但是,我們的經驗還為用戶在使用我們的產品之前應了解的知識做出了假設。

The good thing about getting user feedback on Cloud DB as we went was that we learned that our assumptions were incorrect. Our most valuable lesson was the humbling reminder of a basic startup principle. No matter our experience, we often don’t know exactly what we’re building.

在進行過程中獲得有關Cloud DB的用戶反饋的好處是,我們了解到我們的假設是錯誤的。 我們最有價值的一課是謙卑地提醒人們一個基本的啟動原則。 不管我們的經驗如何,我們通常都不完全知道我們要構建什么。

Of course, that doesn’t stop us from trying to build that philosopher’s stone to make lives easier for our fellow developers anyway. As my co-founder, Ben, said one of his most productive days was when he tossed 1000 lines of code away.

當然,這并不能阻止我們嘗試建立哲學家的石頭,以使??我們的其他開發人員的生活更加輕松。 正如我的聯合創始人本(Ben)所說,他最富有成效的日子之一是他丟掉了1000行代碼。

I would like to credit my colleague cheungpat who worked on the Cloud DB with me and helped write this piece.

我想感謝我的同事cheungpat和我一起在Cloud DB上工作,并幫助撰寫了這篇文章。

My team would love to hear your critical feedback for Skygear. Also check out our documentation and GitHub repos to see how we discuss Skygear features.

我的團隊很想聽聽您對Skygear的重要反饋。 另請查看我們的文檔和GitHub存儲庫,以了解我們如何討論Skygear功能。

翻譯自: https://www.freecodecamp.org/news/how-to-handle-unknowns-and-make-assumptions-when-designing-a-cloud-database-df002068a83b/

假設檢驗方差未知

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/395528.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/395528.shtml
英文地址,請注明出處:http://en.pswp.cn/news/395528.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

SQL校驗優化

我的思路只能查當前的: ----校驗此行訂單是否已導入,若已導入則提示訂單號并Return -- IF EXISTS (SELECT 1 FROM DOC_Order_Header b LEFT JOIN tblData a -- ON -- a.ConsigneeID b.Consig…

nat64 dns64 linux 內核支持,搭建NAT64/DNS6實現IPv4/v6轉換

NAT64采用tayga實現,DNS64采用bind9.8實現。1 平臺搭建平臺為ubuntu12.04 Desktop版本。正常安裝即可。2 NAT64(tayga)2.1 安裝在終端模式下輸入sudo apt-get install tayga2.2 配置2.2.1 相關設置sudo gedit /etc/tayga.conf按照說明配置,目前實現方案不…

React學習筆記(持續更新)

2.2頁面加載過程 1.資源加載過程&#xff1a;URL->DNS查詢->資源請求->瀏覽器解析 ①URL結構&#xff1a;http://www.hhh.com:80/getdata?pid1#title[協議://域名&#xff1a;端口/路徑?參數#哈希] ②DNS查詢&#xff1a;瀏覽器<--&#xff08;ip&#xff09;&am…

2年工作經驗進 初創公司_溝通是關鍵:通過兩家初創公司獲得的成長經驗教訓+找工作...

2年工作經驗進 初創公司by Niki Agrawal通過尼基阿格勞瓦爾(Niki Agrawal) 溝通是關鍵&#xff1a;通過兩家初創公司獲得的成長經驗教訓找工作 (Communication is key: growth lessons learned through two startups a job hunt) It’s been a crazy two years. I founded tw…

Hibernate問題淺析

1、什么是SessionFactory&#xff1f;什么是Session&#xff1f;httpsession和hibernate的session的有什么區別&#xff1f;SessionFactory接口負責初始化Hibernate。它充當數據存儲源的代理&#xff0c;并負責創建Session對象。這里用到了工廠模式。需要注意的是SessionFactor…

Oracle中SQL語句學習五(統計分組語句group by和having)

oracle&#xff08;41&#xff09; 在 應用系統開發中&#xff0c;進行需要統計數據庫中的數據&#xff0c;當執行數據統計時&#xff0c;需要將表中的數據進行分組顯示&#xff0c;在統計分組中是通過group by子句、分組函數、having子句共同實現的。其中group by子句用于指定…

linux系統去吧,要開始另一個linux操作系統的嘗試了,說說我以前的ubuntu吧

我想&#xff0c;除了嘗試一下ubuntu的神奇魅力的同時&#xff0c;我應該去體驗一下RedHat的神奇吧&#xff01;馬上就要告別ubuntu了&#xff0c;我想把我的部分使用經歷和大家分享分享&#xff01;首先&#xff0c;無論是ubuntu8.04、10.04還是10.1的效果都是很好的&#xff…

課程編碼查詢_付出還是不付出:生活中最好的事情(例如編碼課程)是否免費?...

課程編碼查詢by Rick West由里克韋斯特(Rick West) 付出還是不付出&#xff1a;生活中最好的事情(例如編碼課程)是否免費&#xff1f; (To pay or not to pay: are the best things in life — like coding courses — free?) Recently, I’ve been working on a project tha…

做開發十年,我總結出了這些開發經驗

本文由云社區發表,原文轉載地址:https://www.cnblogs.com/qcloud1001/p/10218876.html 在一線做了十年的開發&#xff0c;經歷了網易、百度、騰訊研究院、MIG 等幾個地方&#xff0c;陸續做過 3D 游戲、2D 頁游、瀏覽器、移動端翻譯 app 等。 積累了一些感悟。必然有依然幼稚的…

2016年4月 TIOBE 編程語言排行榜

4月頭條: Visual Basic 正在漸行漸遠 COBOL, BASIC 和 FORTRAN 很長一段時間作為主力開發語言被使用。有很多軟件使用這些語言來編寫&#xff0c;并且發展的不亦樂乎。然而經過多年的發展&#xff0c;COBOL和FORTRAN逐漸被拋棄&#xff0c;而得益于微軟的存在&#xff0c;BASIC…

linux系統不知道電腦密碼怎么辦,Linux如何修復系統的Root密碼 -電腦資料

如果因為忘了root口令導致無法登錄系統&#xff0c;請試用下面的方法來改忘記的root口令&#xff1a;方法一&#xff1a;1、重新啟動系統&#xff0c;2、把光標定位在該選項上按下字母“e”鍵進入這個引導的編輯狀態&#xff1b;3、該選項有三行語句&#xff0c;請用光標選中第…

控制語句(4)

第4章 控制語句if<條件1>&#xff1a; <語句1>elif<條件2>: <語句2>elif<條件3>&#xff1a; <語句3>......else: <語句n>說明&#xff1a;elif語句&#xff0c;只要有一個條件成立&#xff0c;就會將其后的一個部分語句執行…

02 socketserver客戶端

import socket client socket.socket() client.connect((127.0.0.1,8001))while 1:msg input(客戶端說>>>)client.send(msg.encode(utf-8))from_server_msg client.recv(1024)print(from_server_msg.decode(utf-8)) 轉載于:https://www.cnblogs.com/work14/p/10235…

基于zbus的MySQL透明代理(100行)

項目地址 https://git.oschina.net/rushmore/zbus 我們上次講到zbus網絡通訊的核心API&#xff1a; Dispatcher -- 負責-NIO網絡事件Selector引擎的管理&#xff0c;對Selector引擎負載均衡 IoAdaptor -- 網絡事件的處理&#xff0c;服務器與客戶端共用&#xff0c;負責讀寫&am…

linux添加jetdirect協議,Padavan 路由器固件 不能驅動 hp1005、hp1020之類打印機 foo2zjs ZjStream協議的linux打印機驅動程序...

單擊鏈接&#xff0c;或剪切并粘貼下面的整個命令行以下載驅動程序。現在解壓縮它&#xff1a;Unpack:$ tar zxf foo2zjs.tar.gz$ cd foo2zjs現在編譯并安裝它。 INSTALL文件包含更詳細的說明; 請現在閱讀。Compile:$ makeGet extra files from the web, such as .ICM profiles…

返回指定月份的周列表 包含 周序號、開始日期、結束日期(不包含周末)

/*** 返回當前年月的周列表 包含 周序號、開始日期、結束日期(不包含周末)* param year 年* param month 月* returns {Array} */function getYearMonthWeekList(year,month) {var weekList[];var time year "/" month "/01";//取當前月的第…

tez-site.xml_數字支付系統的未來-Google Tez和音頻快速響應

tez-site.xmlby Vaidic Joshi通過Vaidic Joshi 數字支付系統的未來-Google Tez和音頻快速響應 (The future of digital payment systems — Google Tez and Audio Quick Response) Google recently marked its entry into the Indian digital payments market by introducing …

Window上安裝kafka

kafka在windows上的安裝、運行 - 進階者ryan-su - CSDN博客https://blog.csdn.net/u010283894/article/details/77106159 在Windows環境中安裝并使用kafka - 心靈空谷幽蘭 - 博客園https://www.cnblogs.com/xinlingyoulan/p/6054361.html?utm_sourceitdadao&utm_mediumref…

數集合有多少個TOJ(2469)

題目鏈接&#xff1a;http://acm.tju.edu.cn/toj/showp2469.html 感覺這個題目有點問題&#xff0c;算了不管他了&#xff0c;反正A了。 這里要注意的是求這個集合有多少種&#xff0c;那么就是要剔除重復數后&#xff0c;再數一下有多少個。 難一點的算法我也不會&#xff0c;…

linux path環境變量起什么作用,shell基礎(5)PATH環境變量的作用和使用方法

釋放雙眼&#xff0c;帶上耳機&#xff0c;聽聽看~&#xff01;關于PATH的作用PATH說簡單點就是一個字符串變量&#xff0c;當輸入命令的時候LINUX會去查找PATH里面記錄的路徑。比如在根目錄/下可以輸入命令ls,在/usr目錄下也可以輸入ls,但其實ls這個命令根本不在這個兩個目錄下…